gitlab-org--gitlab-foss/config/boot.rb
Gabriel Mazetto 31a349e0db Add bootsnap to development/test bundle and enable it if available
This will enable bootsnap whenver the gem is available.
2018-07-20 14:16:01 +02:00

16 lines
431 B
Ruby

def rails5?
%w[1 true].include?(ENV["RAILS5"])
end
require 'rubygems' unless rails5?
gemfile = rails5? ? "Gemfile.rails5" : "Gemfile"
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
# Set up gems listed in the Gemfile.
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
begin
require 'bootsnap/setup'
rescue LoadError
# bootsnap is optional dependency, so if we don't have it it's fine
end