Permalink
Browse files

special case `ruby` directive

This is light of the upcoming 1.2.0 release which adds this feature.
This way people still using 1.1.x can run 1.2.0 Gemfiles that employ
this feature and get a notification about upgrading.
  • Loading branch information...
1 parent 1a9aefb commit 4f9f810fa52abf3923442d6dad070607daeb3d64 @hone hone committed Jul 17, 2012
Showing with 27 additions and 0 deletions.
  1. +6 −0 lib/bundler/dsl.rb
  2. +21 −0 spec/bundler/dsl_spec.rb
View
@@ -163,6 +163,12 @@ def env(name)
@env = old
end
+ def ruby(*args)
+ msg = "Ignoring `ruby` directive. This is a feature added to Bundler 1.2.0 \n" \
+ "and higher. Please upgrade if you would like to use it. \n\n"
+ Bundler.ui.warn msg
+ end
+
# Deprecated methods
def self.deprecate(name, replacement = nil)
View
@@ -26,5 +26,26 @@
lambda { Bundler::Dsl.evaluate(bundled_app("Gemfile"), nil, true) }.
should raise_error(Bundler::GemfileError)
end
+
+ it "should special case the ruby directive" do
+ gemfile <<-G
+ ruby "1.9.3"
+ G
+ lambda { Bundler::Dsl.evaluate(bundled_app("Gemfile"), nil, true) }.
+ should_not raise_error(Bundler::GemfileError)
+ end
+
+ it "should special case the ruby directive and throws a warning" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ ruby "1.9.3"
+
+ gem "foo"
+ G
+
+ out.should include("Ignoring `ruby` directive")
+ bundled_app("Gemfile.lock").should exist
+ end
end
end

0 comments on commit 4f9f810

Please sign in to comment.