Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored all gem/bundler code into logstash/bundler.rb and moved pa…
…tches into logstash/patches require bundler/cli to expose expectations classes
- Loading branch information
1 parent
3eb5ba6
commit ae17b41
Showing
11 changed files
with
114 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Bundler monkey patches | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# monkey patch RubyGems to silence ffi warnings: | ||
# | ||
# WARN: Unresolved specs during Gem::Specification.reset: | ||
# ffi (>= 0) | ||
# WARN: Clearing out unresolved specs. | ||
# Please report a bug if this causes problems. | ||
# | ||
# see https://github.com/elasticsearch/logstash/issues/2556 and https://github.com/rubygems/rubygems/issues/1070 | ||
# | ||
# this code is from Rubygems v2.1.9 in JRuby 1.7.17. Per tickets this issue should be solved at JRuby >= 1.7.20. | ||
# | ||
# this method implementation works for Rubygems version 2.1.0 and up, verified up to 2.4.6 | ||
if ::Gem::Version.new(::Gem::VERSION) >= ::Gem::Version.new("2.1.0") && ::Gem::Version.new(::Gem::VERSION) < ::Gem::Version.new("2.5.0") | ||
class ::Gem::Specification | ||
def self.reset | ||
@@dirs = nil | ||
::Gem.pre_reset_hooks.each { |hook| hook.call } | ||
@@all = nil | ||
@@stubs = nil | ||
_clear_load_cache | ||
unresolved = unresolved_deps | ||
unless unresolved.empty? | ||
unless (unresolved.size == 1 && unresolved["ffi"]) | ||
w = "W" + "ARN" | ||
warn "#{w}: Unresolved specs during Gem::Specification.reset:" | ||
unresolved.values.each do |dep| | ||
warn " #{dep}" | ||
end | ||
warn "#{w}: Clearing out unresolved specs." | ||
warn "Please report a bug if this causes problems." | ||
end | ||
unresolved.clear | ||
end | ||
::Gem.post_reset_hooks.each { |hook| hook.call } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters