Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
RUBY_ENGINE is not defined in ruby 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed May 4, 2012
1 parent 9474e88 commit 9a769ac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/bundler/ruby_version.rb
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion spec/support/helpers.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/platforms.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/rubygems_hax/platform.rb
Expand Up @@ -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"
Expand Down

0 comments on commit 9a769ac

Please sign in to comment.