Permalink
Browse files

Fix the bundler for 1.9

  • Loading branch information...
1 parent b7cf313 commit 3c70ded6cbb4a9f6d4fd30b1ae6009e71d4c994a Yehuda Katz + Carl Lerche committed Nov 4, 2009
@@ -26,7 +26,7 @@ def initialize
add_option('--list', "List all gems that are part of the active bundle") do
options[:list] = true
end
-
+
add_option('--list-outdated', "List all outdated gems that are part of the active bundle") do
options[:list_outdated] = true
end
@@ -1,5 +1,5 @@
if exec = ARGV.index("exec")
- $command = ARGV[(exec + 1)..-1].join(" ")
+ $command = ARGV[(exec + 1)..-1]
ARGV.replace ARGV[0..exec]
end
View
@@ -4,7 +4,7 @@ class ManifestFileNotFound < StandardError; end
class Dsl
def self.evaluate(environment, file)
builder = new(environment)
- builder.instance_eval(File.read(file), file)
+ builder.instance_eval(File.read(file.to_s), file.to_s, 1)
end
def initialize(environment)
@@ -69,6 +69,7 @@ module Bundler
return if except && except.any? {|e| e == @env }
if files = opt[:require_as] || opt["require_as"]
+ files = Array(files)
files.each { |f| require f }
else
begin
@@ -94,7 +95,7 @@ module Bundler
except
end
end
- context.new(env && env.to_s).instance_eval(File.read(@gemfile))
+ context.new(env && env.to_s).instance_eval(File.read(@gemfile), @gemfile, 1)
end
end
View
@@ -98,10 +98,8 @@
it "runs exec with options correctly" do
Dir.chdir(bundled_app) do
- out = gem_command :exec, %[ruby --version 2>&1], :no_quote => true
- puts out
- out.should_not =~ /version unknown/
- out.should =~ /patchlevel/
+ out = gem_command :exec, %[ruby -e 'puts "hello"'], :no_quote => true
+ out.should == "hello"
end
end
@@ -441,11 +439,11 @@
clear_sources
Gemfile
m.install
-
+
Dir.chdir(bundled_app) do
@output = gem_command :bundle, "--list-outdated"
end
-
+
@output.should =~ /All gems are up to date/
end
View
@@ -25,8 +25,8 @@ def build_manifest_file(*args)
path = bundled_app("Gemfile")
path = args.shift if args.first.is_a?(Pathname)
str = args.shift || ""
- FileUtils.mkdir_p(path.dirname)
- File.open(path, 'w') do |f|
+ FileUtils.mkdir_p(path.dirname.to_s)
+ File.open(path.to_s, 'w') do |f|
f.puts str
end
end

0 comments on commit 3c70ded

Please sign in to comment.