Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

finish --ruby flag on bundle platform

  • Loading branch information...
commit e8a44c5bc9242391c42e728d8390eab4ac2df4e2 1 parent b484ed1
Terence Lee hone authored
Showing with 23 additions and 15 deletions.
  1. +19 −11 lib/bundler/cli.rb
  2. +4 −4 spec/other/ruby_spec.rb
30 lib/bundler/cli.rb
View
@@ -634,20 +634,28 @@ def platform
ruby_version = Bundler.definition.ruby_version
output = []
- output << "Your platform is: #{RUBY_PLATFORM}"
- output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
+ if options[:ruby]
+ if ruby_version
+ output << ruby_version
+ else
+ output << "No ruby version specified"
+ end
+ else
+ output << "Your platform is: #{RUBY_PLATFORM}"
+ output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
- if ruby_version
- output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
+ if ruby_version
+ output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
- begin
- Bundler.definition.validate_ruby!
- output << "Your current platform satisfies the Ruby version requirement."
- rescue RubyVersionMismatch => e
- output << e.message
+ begin
+ Bundler.definition.validate_ruby!
+ output << "Your current platform satisfies the Ruby version requirement."
+ rescue RubyVersionMismatch => e
+ output << e.message
+ end
+ else
+ output << "Your Gemfile does not specify a Ruby version requirement."
end
- else
- output << "Your Gemfile does not specify a Ruby version requirement."
end
Bundler.ui.info output.join("\n\n")
8 spec/other/ruby_spec.rb
View
@@ -76,7 +76,7 @@
gem "foo"
G
- bundle "platform"
+ bundle "platform --ruby"
out.should eq("ruby 1.9.3")
end
@@ -89,7 +89,7 @@
gem "foo"
G
- bundle "platform"
+ bundle "platform --ruby"
out.should eq("ruby 1.9.3")
end
@@ -102,7 +102,7 @@
gem "foo"
G
- bundle "platform"
+ bundle "platform --ruby"
out.should eq("ruby 1.8.7 (jruby 1.6.5)")
end
@@ -115,7 +115,7 @@
gem "foo"
G
- bundle "platform"
+ bundle "platform --ruby"
out.should eq("ruby 1.8.7 (rbx 1.2.4)")
end
Please sign in to comment.
Something went wrong with that request. Please try again.