Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make 'install' and 'build' tasks depend on 'build'

This patch attempts to fix issue #2121 in Bundler.
  • Loading branch information...
commit 71e14bc4a7b6e198f08a0fe5f2b4a025f25898c5 1 parent 4880143
@sunaku sunaku authored indirect committed
Showing with 11 additions and 9 deletions.
  1. +11 −9 lib/bundler/gem_helper.rb
View
20 lib/bundler/gem_helper.rb
@@ -33,19 +33,21 @@ def initialize(base = nil, name = nil)
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 @@ def build_gem
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
Please sign in to comment.
Something went wrong with that request. Please try again.