summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-07-28 13:08:14 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-07-28 13:08:14 -0700
commit8006fc82e10037b496dbc4f3ea55ef75f3aa4603 (patch)
treebc32ea077dbca51bdb1c7c054a6923a949a02a2a
parent14e5a6a8010c9f8b671c287246c4b2a2783a78f2 (diff)
downloadbundler-8006fc82e10037b496dbc4f3ea55ef75f3aa4603.tar.gz
Stub out Gem.ruby when rubygems is disabled.
-rw-r--r--lib/bundler/templates/environment.rb1
-rw-r--r--spec/bundler/cli_spec.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/templates/environment.rb b/lib/bundler/templates/environment.rb
index 005a2eb34e..97060aeb04 100644
--- a/lib/bundler/templates/environment.rb
+++ b/lib/bundler/templates/environment.rb
@@ -28,6 +28,7 @@ end
# Define all the Gem errors for gems that reference them.
module Gem
+ def self.ruby ; <%= Gem.ruby.inspect %> ; end
class LoadError < ::LoadError; end
class Exception < RuntimeError; end
class CommandLineError < Exception; end
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 3195e0a8c8..716320850f 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -143,6 +143,11 @@ end
out = `#{tmp_file('bin', 'rake')} -e 'Gem::LoadError ; Gem::Exception ; puts "Win!"'`
out.should =~ /Win!/
end
+
+ it "stubs out Gem.ruby" do
+ out = `#{tmp_file("bin", "rake")} -e 'puts Gem.ruby'`
+ out.should == "#{Gem.ruby}\n"
+ end
end
describe "it working with requiring rubygems automatically" do