summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanial Pearce <git@tigris.id.au>2011-06-11 18:14:05 +1000
committerDanial Pearce <git@tigris.id.au>2011-06-11 18:14:05 +1000
commitd0fc8b5a3e0bec35476325b5dab2834ed18f176f (patch)
tree2946d014e76eae12f3113d0cb46d597db94e6b12
parent830e0ad0fe5a1a1059eaf3e9139d0f59afb0bad8 (diff)
parenta5d5b6527e1a9626f6f193e2497cabfab6de4924 (diff)
downloadbundler-d0fc8b5a3e0bec35476325b5dab2834ed18f176f.tar.gz
Merge https://github.com/carlhuda/bundler into 1-0-stable
Conflicts: lib/bundler/source.rb
-rw-r--r--CHANGELOG.md10
-rw-r--r--ISSUES.md1
-rw-r--r--lib/bundler/cli.rb4
-rw-r--r--lib/bundler/rubygems_integration.rb30
-rw-r--r--lib/bundler/source.rb14
-rw-r--r--lib/bundler/vendored_thor.rb7
-rw-r--r--lib/bundler/version.rb2
-rw-r--r--spec/install/git_spec.rb1
-rw-r--r--spec/quality_spec.rb4
9 files changed, 60 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5b8a396fd..e9176ca1dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## 1.0.15 (June 9, 2011)
+
+Features:
+
+ - Improved Rubygems integration, removed many deprecation notices
+
+Bugfixes:
+
+ - Escape URL arguments to git correctly on Windows (1.0.14 regression)
+
## 1.0.14 (May 27, 2011)
Features:
diff --git a/ISSUES.md b/ISSUES.md
index 3fe035fcb2..b1220dadd6 100644
--- a/ISSUES.md
+++ b/ISSUES.md
@@ -49,6 +49,7 @@ Instructions that allow the Bundler team to reproduce your issue are vitally imp
- What version of Ruby you are using (run `ruby -v`)
- What version of Rubygems you are using (run `gem -v`)
- Whether you are using RVM, and if so what version (run `rvm -v`)
+ - Whether you have the `rubygems-bundler` gem, which can break gem binares
If you are using Rails 2.3, please also include:
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 5df8af8dfd..2c6e992668 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -1,6 +1,4 @@
-$:.unshift File.expand_path('../vendor', __FILE__)
-require 'thor'
-require 'thor/actions'
+require 'bundler/vendored_thor'
require 'rubygems/user_interaction'
require 'rubygems/config_file'
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index d4aa825506..6460fab5a5 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -123,7 +123,7 @@ module Bundler
if executables.include? File.basename(caller.first.split(':').first)
return
end
- opts = reqs.last.is_a?(Hash) ? reqs.pop : {}
+ reqs.pop if reqs.last.is_a?(Hash)
unless dep.respond_to?(:name) && dep.respond_to?(:requirement)
dep = Gem::Dependency.new(dep, reqs)
@@ -157,6 +157,16 @@ module Bundler
end
end
+ if defined? ::Deprecate
+ Deprecate = ::Deprecate
+ elsif defined? Gem::Deprecate
+ Deprecate = Gem::Deprecate
+ else
+ class Deprecate
+ def skip_during; yield; end
+ end
+ end
+
def stub_source_index137(specs)
# Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
source_index_class = (class << Gem::SourceIndex ; self ; end)
@@ -172,8 +182,19 @@ module Bundler
def stub_source_index170(specs)
Gem::SourceIndex.send(:define_method, :initialize) do |*args|
@gems = {}
- self.spec_dirs = *args
- add_specs(*specs)
+ # You're looking at this thinking: Oh! This is how I make those
+ # rubygems deprecations go away!
+ #
+ # You'd be correct BUT using of this method in production code
+ # must be approved by the rubygems team itself!
+ #
+ # This is your warning. If you use this and don't have approval
+ # we can't protect you.
+ #
+ Deprecate.skip_during do
+ self.spec_dirs = *args
+ add_specs(*specs)
+ end
end
end
@@ -251,7 +272,7 @@ module Bundler
end
end
- # Rubygems 1.8
+ # Rubygems 1.8.5
class Modern < RubygemsIntegration
def stub_rubygems(specs)
Gem::Specification.all = specs
@@ -272,6 +293,7 @@ module Bundler
end
end
+ # Rubygems 1.8.0 to 1.8.4
class AlmostModern < Modern
# Rubygems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever
# you call Gem::Installer#install with an :install_dir set. We have to
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index b3f94b465e..fe9ac1dbfd 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -608,11 +608,17 @@ module Bundler
Digest::SHA1.hexdigest(input)
end
- # Escape an argument for shell commands. To support a single quote
- # within the argument we must end the string, escape the quote and
- # restart.
+ # Escape an argument for shell commands.
def escape(string)
- "'#{string.to_s.gsub("'") {|s| "'\\''"}}'"
+ if Bundler::WINDOWS
+ # Windows quoting requires double quotes only, with double quotes
+ # inside the string escaped by being doubled.
+ '"' + string.gsub('"') {|s| '""'} + '"'
+ else
+ # Bash requires single quoted strings, with the single quotes escaped
+ # by ending the string, escaping the quote, and restarting the string.
+ "'" + string.gsub("'") {|s| "'\\''"} + "'"
+ end
end
def cache_path
diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb
new file mode 100644
index 0000000000..bd837ba9e4
--- /dev/null
+++ b/lib/bundler/vendored_thor.rb
@@ -0,0 +1,7 @@
+if defined?(Thor)
+ Bundler.ui.warn "Thor has already been required. " +
+ "This may cause Bundler to malfunction in unexpected ways."
+end
+$:.unshift File.expand_path('../vendor', __FILE__)
+require 'thor'
+require 'thor/actions'
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 759409fe8b..9f8590d5af 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -2,5 +2,5 @@ module Bundler
# We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to
# handle this better.
- VERSION = "1.0.14" unless defined?(::Bundler::VERSION)
+ VERSION = "1.0.15" unless defined?(::Bundler::VERSION)
end
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index 3fd3cf7988..62cb887d89 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -351,7 +351,6 @@ describe "bundle install with git sources" do
out.should include("Git error:")
err.should include("fatal")
err.should include("omgomg")
- err.should include("fatal: The remote end hung up unexpectedly")
end
it "works when the gem path has spaces in it" do
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index 9b84be4bce..ee097ea0bf 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -1,5 +1,9 @@
require "spec_helper"
+if defined?(Encoding)
+ Encoding.default_external = "UTF-8"
+end
+
describe "The library itself" do
def check_for_tab_characters(filename)
failing_lines = []