2018-05-09 12:01:36 +05:30
|
|
|
def rails5?
|
2018-12-23 12:14:25 +05:30
|
|
|
!%w[0 false].include?(ENV["RAILS5"])
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
require 'rubygems' unless rails5?
|
|
|
|
|
2018-12-23 12:14:25 +05:30
|
|
|
gemfile = rails5? ? "Gemfile" : "Gemfile.rails4"
|
2018-05-09 12:01:36 +05:30
|
|
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
# Set up gems listed in the Gemfile.
|
2016-06-02 11:05:42 +05:30
|
|
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
2018-11-18 11:00:15 +05:30
|
|
|
begin
|
|
|
|
require 'bootsnap/setup'
|
|
|
|
rescue LoadError
|
2018-12-23 12:14:25 +05:30
|
|
|
# bootsnap is an optional dependency, so if we don't have it, it's fine
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|