diff options
author | Andre Arko <andre@arko.net> | 2011-04-30 12:53:56 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-04-30 12:53:56 -0700 |
commit | b9f760d7933ec4046d22461ed196ab227084f1a5 (patch) | |
tree | 03ca01b52758d53859315611412001e46aa6af4a | |
parent | 4faa8e4a24d4665d1a4eabb4c64e00c90b2cb827 (diff) | |
parent | fe1ea11e5133b17c7c3d290fc23983be3802af04 (diff) | |
download | bundler-b9f760d7933ec4046d22461ed196ab227084f1a5.tar.gz |
Merge v1.0.13 from branch '1-0-stable'
Conflicts:
CHANGELOG.md
lib/bundler/version.rb
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | Rakefile | 6 | ||||
-rw-r--r-- | lib/bundler/gem_helper.rb | 13 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 13 | ||||
-rw-r--r-- | lib/bundler/setup.rb | 14 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/flex_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/builders.rb | 10 |
9 files changed, 41 insertions, 25 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 598c9e694d..30d3be9a0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ Removed: - Removed bundle install --production - Removed bundle install --disable-shared-gems -## 1.0.13 (April 28, 2011) +## 1.0.13 (April 30, 2011) Features: @@ -71,12 +71,16 @@ begin unless File.directory?("tmp/rubygems") system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems") end + hash = nil + Dir.chdir("tmp/rubygems") do system("git remote update") system("git checkout #{rg}") system("git pull origin master") if rg == "master" + hash = `git rev-parse HEAD`.strip end - puts "Running bundler specs against rubygems '#{rg}'" + + puts "Running bundler specs against rubygems '#{rg}' at #{hash}" ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}" end diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index b2510f60de..fbee3bde9f 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -2,6 +2,13 @@ $:.unshift File.expand_path('../vendor', __FILE__) require 'thor' require 'bundler' +begin + # Support Rake > 0.8.7 + require 'rake/dsl_definition' + include Rake::DSL +rescue LoadError +end + module Bundler class GemHelper def self.install_tasks(opts = {}) @@ -39,7 +46,7 @@ module Bundler def build_gem file_name = nil - sh("gem build #{spec_path}") { |out, code| + sh("gem build '#{spec_path}'") { |out, code| raise out unless out[/Successfully/] file_name = File.basename(built_gem_path) FileUtils.mkdir_p(File.join(base, 'pkg')) @@ -51,7 +58,7 @@ module Bundler def install_gem built_gem_path = build_gem - out, _ = sh_with_code("gem install #{built_gem_path}") + out, _ = sh_with_code("gem install '#{built_gem_path}'") raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" unless out[/Successfully installed/] Bundler.ui.confirm "#{name} (#{version}) installed" end @@ -68,7 +75,7 @@ module Bundler protected def rubygem_push(path) - out, _ = sh("gem push #{path}") + out, _ = sh("gem push '#{path}'") raise "Gem push failed due to lack of RubyGems.org credentials." if out[/Enter your RubyGems.org credentials/] Bundler.ui.confirm "Pushed #{name} #{version} to rubygems.org" end diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index ee472bd345..59d9f61783 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -5,16 +5,6 @@ module Bundler configuration end - def is_19? - false - end - - # Make sure that rubygems has fully loaded (1.9 partially loads - # sometimes) - def fully_load! - Gem.source_index if is_19? - end - def loaded_specs(name) Gem.loaded_specs[name] end @@ -68,7 +58,8 @@ module Bundler end def gem_path - Gem.path.to_s + # Convert Gem::FS from Rubygems >= 1.8 into strings + Gem.path.map{|p| p.to_s } end def marshal_spec_dir diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index 3930d1607c..dd658cd833 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -2,12 +2,16 @@ require 'bundler/shared_helpers' if Bundler::SharedHelpers.in_bundle? require 'bundler' - begin + if STDOUT.tty? + begin + Bundler.setup + rescue Bundler::BundlerError => e + puts "\e[31m#{e.message}\e[0m" + puts e.backtrace.join("\n") if ENV["DEBUG"] + exit e.status_code + end + else Bundler.setup - rescue Bundler::BundlerError => e - puts "\e[31m#{e.message}\e[0m" - puts e.backtrace.join("\n") if ENV["DEBUG"] - exit e.status_code end # Add bundler to the load path after disabling system gems diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 66aa3a2bb4..10cb91237f 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -3,8 +3,6 @@ require 'rubygems' require 'bundler/rubygems_integration' -Bundler.rubygems.fully_load! - module Gem class Dependency if !instance_methods.map { |m| m.to_s }.include?("requirement") diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 532c599199..28c9e869ff 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -191,6 +191,7 @@ module Bundler s.version = VERSION s.platform = Gem::Platform::RUBY s.source = self + s.authors = ["bundler team"] s.loaded_from = File.expand_path("..", __FILE__) end idx << bundler @@ -354,6 +355,7 @@ module Bundler s.platform = Gem::Platform::RUBY s.summary = "Fake gemspec for #{@name}" s.relative_loaded_from = "#{@name}.gemspec" + s.authors = ["no one"] if expanded_path.join("bin").exist? binaries = expanded_path.join("bin").children binaries.reject!{|p| File.directory?(p) } diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index baafe1ae64..c48b7b6302 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -185,10 +185,10 @@ describe "bundle flex_install" do it "does not install gems whose dependencies are not met" do bundle :install - ruby <<-RUBY + ruby <<-RUBY, :expect_err => true require 'bundler/setup' RUBY - out.should =~ /could not find gem 'rack-obama/i + err.should =~ /could not find gem 'rack-obama/i end it "suggests bundle update when the Gemfile requires different versions than the lock" do diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 90290f157a..9634a32b18 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -322,6 +322,9 @@ module Spec Array(versions).each do |version| spec = builder.new(self, name, version) + if !spec.authors or spec.authors.empty? + spec.authors = ["no one"] + end yield spec if block_given? spec._build(options) end @@ -454,6 +457,8 @@ module Spec @files = _default_files.merge(@files) end + @spec.authors = ["no one"] + @files.each do |file, source| file = Pathname.new(path).join(file) FileUtils.mkdir_p(file.dirname) @@ -563,6 +568,11 @@ module Spec Dir.chdir(lib_path) do destination = opts[:path] || _default_path FileUtils.mkdir_p(destination) + + if !@spec.authors or @spec.authors.empty? + @spec.authors = ["that guy"] + end + Gem::Builder.new(@spec).build if opts[:to_system] `gem install --ignore-dependencies #{@spec.full_name}.gem` |