Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RUBY_ENGINE is not defined in ruby 1.8.7

  • Loading branch information...
commit 9a769acdbccc4b8fab0a685f7911168b0001b4ce 1 parent 9474e88
@hone hone authored
View
9 lib/bundler/ruby_version.rb
@@ -69,11 +69,16 @@ def version
end
def engine
- RUBY_ENGINE
+ if defined?(RUBY_ENGINE)
+ RUBY_ENGINE
+ else
+ # not defined in ruby 1.8.7
+ "ruby"
+ end
end
def engine_version
- case RUBY_ENGINE
+ case engine
when "ruby"
RUBY_VERSION
when "rbx"
View
2  spec/support/helpers.rb
@@ -293,7 +293,7 @@ def simulate_platform(platform)
end
def simulate_ruby_engine(engine, version = "1.6.0")
- return if engine == RUBY_ENGINE
+ return if engine == local_ruby_engine
old, ENV['BUNDLER_SPEC_RUBY_ENGINE'] = ENV['BUNDLER_SPEC_RUBY_ENGINE'], engine
old_version, ENV['BUNDLER_SPEC_RUBY_ENGINE_VERSION'] = ENV['BUNDLER_SPEC_RUBY_ENGINE_VERSION'], version
View
2  spec/support/platforms.rb
@@ -51,7 +51,7 @@ def not_local_tag
end
def local_ruby_engine
- ENV["BUNDLER_SPEC_RUBY_ENGINE"] || RUBY_ENGINE
+ ENV["BUNDLER_SPEC_RUBY_ENGINE"] || (defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby")
end
def local_engine_version
View
2  spec/support/rubygems_hax/platform.rb
@@ -12,7 +12,7 @@ module Bundler
class Object
if ENV['BUNDLER_SPEC_RUBY_ENGINE']
- remove_const :RUBY_ENGINE
+ remove_const :RUBY_ENGINE if defined?(RUBY_ENGINE)
RUBY_ENGINE = ENV['BUNDLER_SPEC_RUBY_ENGINE']
if RUBY_ENGINE == "jruby"
Please sign in to comment.
Something went wrong with that request. Please try again.