aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/gem_helper.rb
diff options
context:
space:
mode:
authorSuraj N. Kurapati <sunaku@gmail.com>2013-02-23 12:16:18 -0800
committerAndre Arko <andre@arko.net>2013-03-01 23:11:44 -0800
commit71e14bc4a7b6e198f08a0fe5f2b4a025f25898c5 (patch)
treee76f7ea2cb786a2d326b414eba266ed35ff49bdc /lib/bundler/gem_helper.rb
parent4880143f8bea90ae63120c8d8855116b01ed9b57 (diff)
downloadbundler-71e14bc4a7b6e198f08a0fe5f2b4a025f25898c5.tar.gz
make 'install' and 'build' tasks depend on 'build'
This patch attempts to fix issue #2121 in Bundler.
Diffstat (limited to 'lib/bundler/gem_helper.rb')
-rw-r--r--lib/bundler/gem_helper.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index d5ea8a74..dc9897be 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -33,19 +33,21 @@ module Bundler
end
def install
+ built_gem_path = nil
+
desc "Build #{name}-#{version}.gem into the pkg directory."
task 'build' do
- build_gem
+ built_gem_path = build_gem
end
desc "Build and install #{name}-#{version}.gem into system gems."
- task 'install' do
- install_gem
+ task 'install' => 'build' do
+ install_gem(built_gem_path)
end
desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems"
- task 'release' do
- release_gem
+ task 'release' => 'build' do
+ release_gem(built_gem_path)
end
GemHelper.instance = self
@@ -62,16 +64,16 @@ module Bundler
File.join(base, 'pkg', file_name)
end
- def install_gem
- built_gem_path = build_gem
+ def install_gem(built_gem_path=nil)
+ built_gem_path ||= build_gem
out, _ = sh_with_code("gem install '#{built_gem_path}' --local")
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
- def release_gem
+ def release_gem(built_gem_path=nil)
guard_clean
- built_gem_path = build_gem
+ built_gem_path ||= build_gem
tag_version { git_push } unless already_tagged?
rubygem_push(built_gem_path) if gem_push?
end