From a318f9180811fee3f0fd9db98c39916695502091 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 19 Jan 2011 09:14:40 -0800 Subject: adding requires and default yaml parser to psych if possible --- lib/bundler.rb | 6 ++++++ lib/bundler/cli.rb | 1 + lib/bundler/source.rb | 1 + lib/bundler/ui.rb | 2 ++ spec/support/rubygems_ext.rb | 2 ++ 5 files changed, 12 insertions(+) diff --git a/lib/bundler.rb b/lib/bundler.rb index dd1ad009b0..10425f8419 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -1,6 +1,12 @@ require 'rbconfig' require 'fileutils' require 'pathname' + +begin + require 'psych' +rescue LoadError +end + require 'yaml' require 'bundler/rubygems_ext' require 'bundler/version' diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 68751ce606..5c03a97263 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -1,6 +1,7 @@ $:.unshift File.expand_path('../vendor', __FILE__) require 'thor' require 'thor/actions' +require 'rubygems/user_interaction' require 'rubygems/config_file' # Work around a RubyGems bug diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 934743f991..b374fdd89e 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,4 +1,5 @@ require "uri" +require 'rubygems/user_interaction' require "rubygems/installer" require "rubygems/spec_fetcher" require "rubygems/format" diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb index e6331921aa..10d5df9eb1 100644 --- a/lib/bundler/ui.rb +++ b/lib/bundler/ui.rb @@ -1,3 +1,5 @@ +require 'rubygems/user_interaction' + module Bundler class UI def warn(message) diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 9e1aa7fa8c..7f312e9547 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -1,3 +1,5 @@ +require 'rubygems/user_interaction' + module Spec module Rubygems def self.setup -- cgit v1.2.1 From ac9c3c9906cb9dae576ba65714950aa0d8ccf6b1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 19 Jan 2011 09:26:25 -0800 Subject: implement encode_with to squash warnings from psych --- lib/bundler/rubygems_ext.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 29b12d79d4..f2c640c664 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -105,6 +105,12 @@ module Gem alias eql? == + def encode_with(coder) + to_yaml_properties.each do |ivar| + coder[ivar.to_s.sub(/^@/, '')] = instance_variable_get(ivar) + end + end + def to_yaml_properties instance_variables.reject { |p| ["@source", "@groups"].include?(p.to_s) } end -- cgit v1.2.1 From 30319c65136c7ecf7f4377257c8f19f144439adb Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Fri, 21 Jan 2011 13:50:28 -0800 Subject: Hey, did you know it's 2011 now? --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edd9e30f2a..478f398ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.0.9 (January 19, 2010) +## 1.0.9 (January 19, 2011) Bugfixes: @@ -6,7 +6,7 @@ Bugfixes: path. In Rails apps with a default application.rb, this removed all gems in groups other than :default and Rails.env. -## 1.0.8 (January 18, 2010) +## 1.0.8 (January 18, 2011) Features: -- cgit v1.2.1 From f0e9ca3fc851e0bd858d3da64f86751a26db533a Mon Sep 17 00:00:00 2001 From: Sam Umbach Date: Tue, 18 Jan 2011 23:43:07 -0500 Subject: Pass Gem::Specification.from_yaml a string containing the gemspec (instead of the filename) --- lib/bundler.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bundler.rb b/lib/bundler.rb index 10425f8419..405fa7cb84 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -230,12 +230,13 @@ module Bundler path = Pathname.new(file) # Eval the gemspec from its parent directory Dir.chdir(path.dirname.to_s) do + contents = File.read(path.basename.to_s) begin - Gem::Specification.from_yaml(path.basename.to_s) + Gem::Specification.from_yaml(contents) # Raises ArgumentError if the file is not valid YAML rescue ArgumentError, SyntaxError, Gem::EndOfYAMLException, Gem::Exception begin - eval(File.read(path.basename.to_s), TOPLEVEL_BINDING, path.expand_path.to_s) + eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s) rescue LoadError => e original_line = e.backtrace.find { |line| line.include?(path.to_s) } msg = "There was a LoadError while evaluating #{path.basename}:\n #{e.message}" -- cgit v1.2.1 From 7e6cac483a0fefcc8e3f8c4e021d87607123376a Mon Sep 17 00:00:00 2001 From: Andre Arko and Terence Lee Date: Mon, 24 Jan 2011 16:22:01 -0800 Subject: Add test for :path gems with YAML specs --- spec/install/gems/simple_case_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb index c27642ac7a..a427367b26 100644 --- a/spec/install/gems/simple_case_spec.rb +++ b/spec/install/gems/simple_case_spec.rb @@ -545,6 +545,15 @@ describe "bundle install with gem sources" do bundle :install err.should be_empty end + + it "still installs correctly when using path" do + build_lib 'yaml_spec', :gemspec => :yaml + + install_gemfile <<-G + gem 'yaml_spec', :path => "#{lib_path('yaml_spec-1.0')}" + G + err.should == "" + end end describe "when the gem has an architecture in its platform" do -- cgit v1.2.1 From e2f6a1cc668586aca9faecb23b80e8b8724ea97f Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 26 Jan 2011 17:46:36 -0800 Subject: Make the license VERY explicit --- LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index 66f44e9729..4d62f8af36 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,8 @@ Portions copyright (c) 2010 Andre Arko Portions copyright (c) 2009 Engine Yard +MIT License + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including -- cgit v1.2.1 From c7349b78e202ab07f5c9f19703717b31690531cb Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 1 Feb 2011 00:01:32 -0800 Subject: Initialize Gem::SilentUI --- lib/bundler/ui.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb index 10d5df9eb1..d91cceeae3 100644 --- a/lib/bundler/ui.rb +++ b/lib/bundler/ui.rb @@ -58,6 +58,7 @@ module Bundler class RGProxy < Gem::SilentUI def initialize(ui) @ui = ui + super() end def say(message) -- cgit v1.2.1 From 13a2d27c8bbadf6b913faa30c3a65166e6fdf5aa Mon Sep 17 00:00:00 2001 From: jfelchner Date: Mon, 31 Jan 2011 23:28:31 -0600 Subject: Fix for Error w/ Ruby 1.9.2 and Rubygems 1.5 `': uninitialized constant Gem::SilentUI (NameError) --- lib/bundler/ui.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb index d91cceeae3..c483216aaf 100644 --- a/lib/bundler/ui.rb +++ b/lib/bundler/ui.rb @@ -55,7 +55,7 @@ module Bundler end end - class RGProxy < Gem::SilentUI + class RGProxy < ::Gem::SilentUI def initialize(ui) @ui = ui super() -- cgit v1.2.1 From 3d724d6d8c696297c24f3137d8dec98bf1dc8e59 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 1 Feb 2011 00:41:02 -0800 Subject: Update Rubygems test versions --- Rakefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index bddc63dc5a..b68bc10ccc 100644 --- a/Rakefile +++ b/Rakefile @@ -60,7 +60,7 @@ begin namespace :rubygems do # Rubygems 1.3.5, 1.3.6, and HEAD specs rubyopt = ENV["RUBYOPT"] - %w(master v1.3.5 v1.3.6 v1.3.7 v1.4.0 v1.4.1).each do |rg| + %w(master v1.3.6 v1.3.7 v1.4.0 v1.4.1 v1.5.0).each do |rg| desc "Run specs with Rubygems #{rg}" RSpec::Core::RakeTask.new(rg) do |t| t.rspec_opts = %w(-fs --color) @@ -68,10 +68,11 @@ begin end task "clone_rubygems_#{rg}" do - unless File.directory?("tmp/rubygems_#{rg}") - system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems_#{rg} && cd tmp/rubygems_#{rg} && git reset --hard #{rg}") + unless File.directory?("tmp/rubygems") + system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems") end - ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems_#{rg}/lib")} #{rubyopt}" + system("cd tmp/rubygems && git remote update && git reset --hard origin/#{rg}") + ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}" end task rg => "clone_rubygems_#{rg}" -- cgit v1.2.1 From 800e408b785c60ad5bbaddc56a845cefd0a6385d Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 1 Feb 2011 00:53:24 -0800 Subject: Version 1.0.10 --- CHANGELOG.md | 7 +++++++ lib/bundler/version.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 478f398ae7..efc7be298a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.0.10 (February 1, 2011) + +Bugfixes: + + - Fix a regression loading YAML gemspecs from :git and :path gems + - Requires, namespaces, etc. to work with changes in Rubygems 1.5 + ## 1.0.9 (January 19, 2011) Bugfixes: diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 85fc21c2d8..f3cfc0fd9e 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.9" unless defined?(::Bundler::VERSION) + VERSION = "1.0.10" unless defined?(::Bundler::VERSION) end -- cgit v1.2.1 From 63a5b62ce1d7acacf87749e94ad1bda1624e0009 Mon Sep 17 00:00:00 2001 From: Terence Lee Date: Tue, 1 Feb 2011 03:32:13 -0600 Subject: rubygems checkout in only 1 directory now --- spec/support/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index e81ce4f06a..90a82c99af 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -3,7 +3,7 @@ module Spec def reset! @in_p, @out_p, @err_p = nil, nil, nil Dir["#{tmp}/{gems/*,*}"].each do |dir| - next if %(base remote1 gems rubygems_v1.3.5 rubygems_v1.3.6 rubygems_v1.3.7 rubygems_v1.4.0 rubygems_v1.4.1 rubygems_master).include?(File.basename(dir)) + next if %(base remote1 gems rubygems).include?(File.basename(dir)) unless ENV['BUNDLER_SUDO_TESTS'] FileUtils.rm_rf(dir) else -- cgit v1.2.1 From 2c9d47949444dc6f0216c096d9bfdedac95db630 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 1 Feb 2011 17:27:42 -0800 Subject: Check out Rubygems tags correctly --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index b68bc10ccc..6f9e3c4d7b 100644 --- a/Rakefile +++ b/Rakefile @@ -71,7 +71,8 @@ begin unless File.directory?("tmp/rubygems") system("git clone git://github.com/rubygems/rubygems.git tmp/rubygems") end - system("cd tmp/rubygems && git remote update && git reset --hard origin/#{rg}") + system("cd tmp/rubygems && git checkout #{rg}") + system("git pull") if rg == "master" ENV["RUBYOPT"] = "-I#{File.expand_path("tmp/rubygems/lib")} #{rubyopt}" end -- cgit v1.2.1