add Bundler.reset! method which fixes the .lock file updates

Fixes #2231
This commit is contained in:
Colin Surprenant 2014-12-12 12:33:16 -08:00 committed by Jordan Sissel
parent 4e36552455
commit 0a130cc5ef
3 changed files with 14 additions and 6 deletions

View file

@ -1,10 +1,20 @@
# Patch bundler to write a .lock file specific to the version of ruby.
# This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates
module Bundler
# Patch bundler to write a .lock file specific to the version of ruby.
# This keeps MRI/JRuby/RBX from conflicting over the Gemfile.lock updates
module SharedHelpers
def default_lockfile
ruby = "#{LogStash::Environment.ruby_engine}-#{LogStash::Environment.ruby_abi_version}"
Pathname.new("#{default_gemfile}.#{ruby}.lock")
end
end
# Add the Bundler.reset! method which has been added in master but is not in 1.7.9.
class << self
unless self.method_defined?("reset!")
def reset!
@definition = nil
end
end
end
end

View file

@ -22,8 +22,7 @@ namespace "plugin" do
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
ENV["BUNDLE_PATH"] = LogStash::Environment.logstash_gem_home
ENV["BUNDLE_GEMFILE"] = "tools/Gemfile.plugins"
# Bundler::Retry.attempts = 0
Bundler.definition(true)
Bundler.reset!
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile.plugins", LogStash::Environment::BUNDLE_DIR))
break
rescue => e

View file

@ -220,8 +220,7 @@ namespace "vendor" do
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
ENV["BUNDLE_PATH"] = LogStash::Environment.logstash_gem_home
ENV["BUNDLE_GEMFILE"] = "tools/Gemfile"
# Bundler::Retry.attempts = 0
Bundler.definition(true)
Bundler.reset!
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile", LogStash::Environment::BUNDLE_DIR))
break
rescue => e