lib/bundler/geminabox/gem_helper.rb in bundler-geminabox-0.0.1 vs lib/bundler/geminabox/gem_helper.rb in bundler-geminabox-0.1.0

- old
+ new

@@ -4,12 +4,10 @@ module Bundler module Geminabox class GemHelper extend Forwardable include Rake::DSL if defined? Rake::DSL - - GEMINABOX = ENV['GEMINABOX'] || 'https://your.rubygems.org' class << self def install_tasks(opts = {}) obj = Bundler::GemHelper.new(opts[:dir], opts[:name]) obj.install @@ -29,11 +27,11 @@ desc "[WARN] Release to rubygems.org is prohibited, use rake geminabox_release." task 'release' do abort 'gem release to rubygems.org is prohibited.' end - desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{GEMINABOX}" + desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{geminabox}" task 'geminabox_release' => 'build' do geminabox_release_gem(built_gem_path) end end @@ -45,11 +43,15 @@ tag_version { git_push } unless already_tagged? geminabox_rubygem_push(built_gem_path) if gem_push? # custom end def geminabox_rubygem_push(path) - sh("gem push '#{path}' --host #{GEMINABOX}") - Bundler.ui.confirm "Pushed #{name} #{version} to #{GEMINABOX}." + sh("gem push '#{path}' --host #{geminabox}") + Bundler.ui.confirm "Pushed #{name} #{version} to #{geminabox}." + end + + def geminabox + ENV['GEMINABOX'] || 'https://your.rubygems.org' end end end end