Skip to content

Commit

Permalink
Fix the bundler for 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz + Carl Lerche committed Nov 4, 2009
1 parent b7cf313 commit 3c70ded
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/commands/bundle_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/commands/exec_command.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion lib/bundler/templates/environment.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
10 changes: 4 additions & 6 deletions spec/bundler/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c70ded

Please sign in to comment.