Changed to clearner solution proposed by @limhoff-r7.
parent
fcfb48fda1
commit
4ac8e23e48
|
@ -2,11 +2,25 @@
|
|||
# Use bundler to load dependencies
|
||||
#
|
||||
|
||||
gemfile_base = ::File.expand_path(::File.join(::File.dirname(__FILE__), ".."))
|
||||
if File.readable?(::File.join(gemfile_base,"Gemfile.local"))
|
||||
ENV['BUNDLE_GEMFILE'] ||= ::File.join(gemfile_base, "Gemfile.local")
|
||||
else
|
||||
ENV['BUNDLE_GEMFILE'] ||= ::File.join(gemfile_base, "Gemfile")
|
||||
GEMFILE_EXTENSIONS = [
|
||||
'.local',
|
||||
''
|
||||
]
|
||||
|
||||
unless ENV['BUNDLE_GEMFILE']
|
||||
require 'pathname'
|
||||
|
||||
msfenv_real_pathname = Pathname.new(__FILE__).realpath
|
||||
root = msfenv_real_pathname.parent.parent
|
||||
|
||||
GEMFILE_EXTENSIONS.each do |extension|
|
||||
extension_pathname = root.join("Gemfile#{extension}")
|
||||
|
||||
if extension_pathname.readable?
|
||||
ENV['BUNDLE_GEMFILE'] = extension_pathname.to_path
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
|
|
Loading…
Reference in New Issue