2018-03-21 18:37:57 -04:00
|
|
|
def rails5?
|
2018-08-22 08:09:28 -04:00
|
|
|
!%w[0 false].include?(ENV["RAILS5"])
|
2018-03-21 18:37:57 -04:00
|
|
|
end
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2018-03-21 18:37:57 -04:00
|
|
|
require 'rubygems' unless rails5?
|
|
|
|
|
2018-08-22 08:09:28 -04:00
|
|
|
gemfile = rails5? ? "Gemfile" : "Gemfile.rails4"
|
2018-03-21 18:37:57 -04:00
|
|
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2018-03-21 18:37:57 -04:00
|
|
|
# Set up gems listed in the Gemfile.
|
2016-05-08 17:33:34 -04:00
|
|
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
2018-07-20 07:58:17 -04:00
|
|
|
begin
|
|
|
|
require 'bootsnap/setup'
|
|
|
|
rescue LoadError
|
2018-11-19 09:08:23 -05:00
|
|
|
# bootsnap is an optional dependency, so if we don't have it, it's fine
|
2018-07-20 07:58:17 -04:00
|
|
|
end
|