summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-04-01 01:17:07 +0100
committerAndre Arko <andre@arko.net>2015-04-01 01:17:30 +0100
commit5684b3e0f5fd081739a9df73b6a1c8392643a083 (patch)
tree659e66192a3cda905711d870b18e698effd94664
parentc8c7d58a6628097bbe58dd47c11b5e9dc25c897a (diff)
downloadbundler-5684b3e0f5fd081739a9df73b6a1c8392643a083.tar.gz
add install:local task for --local installs
fixes #3236
-rw-r--r--lib/bundler/gem_helper.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 6db31901e4..9aac3e0d75 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -44,6 +44,11 @@ module Bundler
install_gem(built_gem_path)
end
+ desc "Build and install #{name}-#{version}.gem into system gems without network access."
+ task 'install:local' => 'build' do
+ install_gem(built_gem_path, :local)
+ end
+
desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems\n" \
"To prevent publishing in Rubygems use `gem_push=no rake release`"
task 'release' => ['build', 'release:guard_clean',
@@ -76,9 +81,9 @@ module Bundler
File.join(base, 'pkg', file_name)
end
- def install_gem(built_gem_path=nil)
+ def install_gem(built_gem_path = nil, local = false)
built_gem_path ||= build_gem
- out, _ = sh_with_code("gem install '#{built_gem_path}' --local")
+ out, _ = sh_with_code("gem install '#{built_gem_path}'#{' --local' if 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