diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
commit | 9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch) | |
tree | c3cb423d701f7049ba9382de052e2a937cd1302d /lib/rubygems/commands/build_command.rb | |
parent | 3f606b7063fc7a8b191556365ad343a314719a8d (diff) | |
download | ruby-9694bb8cac12969300692dac5a1cf7aa4e3a46cd.tar.gz |
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto.
* common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
* tool/change_maker.rb: Allow invalid UTF-8 characters in source
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/build_command.rb')
-rw-r--r-- | lib/rubygems/commands/build_command.rb | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index 36a6fe48f2..64563ed3db 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -1,5 +1,5 @@ require 'rubygems/command' -require 'rubygems/builder' +require 'rubygems/package' class Gem::Commands::BuildCommand < Gem::Command @@ -22,11 +22,11 @@ class Gem::Commands::BuildCommand < Gem::Command def execute gemspec = get_one_gem_name - if File.exist? gemspec - spec = load_gemspec gemspec + if File.exist? gemspec then + spec = Gem::Specification.load gemspec if spec then - Gem::Builder.new(spec).build options[:force] + Gem::Package.build spec, options[:force] else alert_error "Error loading gemspec. Aborting." terminate_interaction 1 @@ -37,23 +37,5 @@ class Gem::Commands::BuildCommand < Gem::Command end end - def load_gemspec filename - if yaml?(filename) - open(filename) do |f| - begin - Gem::Specification.from_yaml(f) - rescue Gem::EndOfYAMLException - nil - end - end - else - Gem::Specification.load(filename) # can return nil - end - end - - def yaml?(filename) - line = open(filename) { |f| line = f.gets } - result = line =~ %r{!ruby/object:Gem::Specification} - result - end end + |