From 4a441565010ae22cb76fbf2ffb78bd3297f1a88f Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 2 Jun 2011 14:40:27 -0700 Subject: Add code to silence deprecation warnings --- lib/bundler/rubygems_integration.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index d4aa825506..643e325f4c 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -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,17 @@ 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 + Deprecate.skip_during do + self.spec_dirs = *args + add_specs(*specs) + end end end -- cgit v1.2.1 From c51006de53921210695acfc36463ef935f1c67a4 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 2 Jun 2011 14:48:24 -0700 Subject: Remove bad test for gits exact error message --- spec/install/git_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 3fd3cf7988..d4f67f4176 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -351,7 +351,9 @@ 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") + + # This isn't true, git can also report that it didn't find omgomg + # err.should include("fatal: The remote end hung up unexpectedly") end it "works when the gem path has spaces in it" do -- cgit v1.2.1 From ed970c2db7218a7a974c7006e7e8e7dfac0769ad Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 2 Jun 2011 15:08:02 -0700 Subject: Finish my sentence --- lib/bundler/rubygems_integration.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 643e325f4c..a9a4245aa8 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -189,6 +189,8 @@ module Bundler # 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) -- cgit v1.2.1 From b5851ec6ae4c3f2b781d5a5e431da689a7f47406 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 2 Jun 2011 15:08:11 -0700 Subject: Remove bad test --- spec/install/git_spec.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index d4f67f4176..62cb887d89 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -351,9 +351,6 @@ describe "bundle install with git sources" do out.should include("Git error:") err.should include("fatal") err.should include("omgomg") - - # This isn't true, git can also report that it didn't find omgomg - # err.should include("fatal: The remote end hung up unexpectedly") end it "works when the gem path has spaces in it" do -- cgit v1.2.1 From b907dd7ccc003f06dd59c6eca50066ce86c6dd33 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 31 May 2011 13:56:02 -0700 Subject: Comment rubygems versions --- lib/bundler/rubygems_integration.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index a9a4245aa8..f2d2f5e29e 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -272,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 @@ -293,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 -- cgit v1.2.1 From dab97111b5450e4c71f1b6b22156ee57c498984f Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 8 Jun 2011 17:00:56 -0700 Subject: check for rubygem-bundler while troubleshooting --- ISSUES.md | 1 + 1 file changed, 1 insertion(+) 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: -- cgit v1.2.1 From 47943277ed39156053ecfb7b2a59aa31cc2f6ea9 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 8 Jun 2011 17:01:11 -0700 Subject: escape git URIs correctly on Windows closes #1212 --- lib/bundler/source.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 581b2e654d..f18ace2046 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -608,11 +608,17 @@ module Bundler Digest::SHA1.hexdigest(input) end - # Escape the URI for shell commands. To support a single quote - # within the URI we must end the string, escape the quote and - # restart. + # Escape the URI for git commands def uri_escaped - "'#{uri.gsub("'") {|s| "'\\''"}}'" + if Bundler::WINDOWS + # Windows quoting requires double quotes only, with double quotes + # inside the string escaped by being doubled. + '"' + uri.gsub('"') {|s| '""'} + '"' + else + # Bash requires single quoted strings, with the single quotes escaped + # by ending the string, escaping the quote, and restarting the string. + "'" + uri.gsub("'") {|s| "'\\''"} + "'" + end end def cache_path -- cgit v1.2.1 From 29248c6119e2e195ab0fae929569eb8a47f91138 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 8 Jun 2011 23:34:15 -0300 Subject: Get rid of warning in ruby 1.9.3 --- lib/bundler/rubygems_integration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index f2d2f5e29e..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) -- cgit v1.2.1 From 1c39e23277a8589e08d112d93f4e1935306fc7a2 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Thu, 9 Jun 2011 02:20:51 -0700 Subject: Version 1.0.15 --- CHANGELOG.md | 10 ++++++++++ lib/bundler/version.rb | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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/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 -- cgit v1.2.1 From 3439848db16b4f66af763f1082677602c0580ba9 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Fri, 10 Jun 2011 14:29:34 -0700 Subject: warn if non-vendored Thor has already been required --- lib/bundler/cli.rb | 4 +--- lib/bundler/vendored_thor.rb | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 lib/bundler/vendored_thor.rb 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/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' -- cgit v1.2.1 From a5d5b6527e1a9626f6f193e2497cabfab6de4924 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Fri, 10 Jun 2011 22:02:20 -0700 Subject: Set default_encoding because the CI box uses ASCII :( --- spec/quality_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 = [] -- cgit v1.2.1