Changed to clearner solution proposed by @limhoff-r7.

bug/bundler_fix
kn0 2014-02-21 15:31:12 -06:00
parent fcfb48fda1
commit 4ac8e23e48
1 changed files with 19 additions and 5 deletions

View File

@ -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