Skip to content

Commit

Permalink
add support for bundler >= 1.6.x
Browse files Browse the repository at this point in the history
bundler changed their API for Bundler::UI in 1.6.0 via this commit:

  rubygems/bundler@5e38e2d7

This caused various issues, e.g.

  hashicorp#3451
  test-kitchen/test-kitchen#401

which will hopefully be resolved by teaching vagrant to cope with both
API versions.
  • Loading branch information
Adam Spiers committed Apr 30, 2014
1 parent ac95cb5 commit 36e924b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/vagrant/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ def init!(plugins)

# Set the Bundler UI to be a silent UI. We have to add the
# `silence` method to it because Bundler UI doesn't have it.
::Bundler.ui = ::Bundler::UI.new
::Bundler.ui =
if ::Bundler::UI.const_defined? :Silent
# bundler >= 1.6.0
::Bundler::UI::Silent.new
else
# bundler < 1.6.0
::Bundler::UI.new
end
if !::Bundler.ui.respond_to?(:silence)
ui = ::Bundler.ui
def ui.silence(*args)
Expand Down
2 changes: 1 addition & 1 deletion vagrant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "vagrant"

s.add_dependency "bundler", "~> 1.5.2"
s.add_dependency "bundler", ">= 1.5.2", "< 1.7.0"
s.add_dependency "childprocess", "~> 0.5.0"
s.add_dependency "erubis", "~> 2.7.0"
s.add_dependency "i18n", "~> 0.6.0"
Expand Down

0 comments on commit 36e924b

Please sign in to comment.