diaspora/script/configure_bundler
2018-06-30 23:27:32 +02:00

32 lines
793 B
Ruby
Executable file

#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative "../config/bundler_helper"
require "etc"
rails_env = BundlerHelper.rails_env
database = BundlerHelper.database
puts "Configuring Bundler for #{rails_env} environment and #{database} database."
def config(option)
puts "$ bin/bundle config --local #{option}"
system("#{File.join(__dir__, '../bin/bundle')} config --local #{option}")
end
config("jobs #{Etc.nprocessors}")
config("with #{database}")
if rails_env == "production"
config("without test:development")
elsif rails_env == "test"
config("without development")
end
if rails_env != "development"
config("path vendor/bundle")
config("frozen true")
config("disable_shared_gems true")
end
puts "Bundler configured! Please run 'bin/bundle install' now."