diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-08-09 17:00:28 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-08-09 17:00:28 -0700 |
commit | 23e45e2970c37ec846df3da4ce94fcfeebd3c8e3 (patch) | |
tree | ba9bd471f3c84ee3d8f4a9aac766a39b48f1e4df | |
parent | 7487c0b752393e5049f61cb4f56d40f4e43681c6 (diff) | |
download | bundler-23e45e2970c37ec846df3da4ce94fcfeebd3c8e3.tar.gz |
Revert "work-around for bizarre gem exitcode. use specification to determine name."1.0.0.rc.4
This commit causes 5 test fails :)
This reverts commit 6baa8ee4818c0887ed78179470b7f063a240a3ae.
-rw-r--r-- | lib/bundler/gem_helper.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index c08c64eb11..b86b5738bd 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -11,7 +11,7 @@ module Bundler def initialize(base, name = nil) @base = base - @name = name || determine_name or raise("Cannot automatically determine the name of your gem. Use :name => 'gemname' in #install_tasks to manually set it.") + @name = name || interpolate_name @spec_path = File.join(@base, "#{@name}.gemspec") end @@ -34,8 +34,7 @@ module Bundler def build_gem file_name = nil - sh("gem build #{spec_path}") { |out, err| - raise err if err[/ERROR/] + sh("gem build #{spec_path}") { file_name = File.basename(built_gem_path) FileUtils.mkdir_p(File.join(base, 'pkg')) FileUtils.mv(built_gem_path, 'pkg') @@ -66,11 +65,11 @@ module Bundler Dir[File.join(base, "#{name}-*.gem")].sort_by{|f| File.mtime(f)}.last end - def determine_name + def interpolate_name gemspecs = Dir[File.join(base, "*.gemspec")] raise "Unable to determine name from existing gemspec." unless gemspecs.size == 1 - Gem::Specification.load(File.basename(gemspecs.first)[/^.*\.gemspec$/]).name + File.basename(gemspecs.first)[/^(.*)\.gemspec$/, 1] end def git_push @@ -126,7 +125,7 @@ module Bundler stdin, stdout, stderr = *Open3.popen3(cmd) if $? == 0 output = stdout.read - block.call(output, stderr.read) if block + block.call if block end } [output, $?] |