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

Commit

Permalink
Fix #2075. Return to old namespace behavior.
Browse files Browse the repository at this point in the history
$1 gets overidden by gsub.
  • Loading branch information
hone committed Aug 25, 2012
1 parent 8acc82f commit 3cadcec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bundler/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def require(*groups)
Kernel.require namespaced_file
rescue LoadError
REGEXPS.find { |r| r =~ e.message }
raise if dep.autorequire || ($1 && $1.gsub('-', '/') != namespaced_file)
raise e if $1.nil?
regex_name = $1
raise if dep.autorequire || (regex_name && regex_name.gsub('-', '/') != namespaced_file)
raise e if regex_name.nil?
end
else
REGEXPS.find { |r| r =~ e.message }
Expand Down
18 changes: 18 additions & 0 deletions spec/runtime/require_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@
out.should eq("jquery/rails")
end

it "silently passes if the require fails" do
build_lib "bcrypt-ruby", "1.0.0", :no_default => true do |s|
s.write "lib/brcrypt.rb", "BCrypt = '1.0.0'"
end
gemfile <<-G
path "#{lib_path}"
gem "bcrypt-ruby"
G

cmd = <<-RUBY
require 'bundler'
Bundler.require
RUBY
ruby(cmd, :expect_err => true)

err.should be_empty
end

it "does not mangle explictly given requires" do
gemfile <<-G
path "#{lib_path}"
Expand Down

0 comments on commit 3cadcec

Please sign in to comment.