diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-06-22 12:41:13 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-07-15 16:05:12 +0900 |
commit | 4f9c673cabcf9ae1d7ac2aa9d4a632f41ae76e38 (patch) | |
tree | 588251298a0fe39ff5c3e3ebec13a5755e8e80c3 /lib | |
parent | ca133c03669d495d297579e1f14bc904db591e1d (diff) | |
download | ruby-4f9c673cabcf9ae1d7ac2aa9d4a632f41ae76e38.tar.gz |
[rubygems/rubygems] Allow setting a tag prefix to be used by gem release tasks
https://github.com/rubygems/rubygems/commit/679008f23a
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/gem_helper.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index eab894638e..272e7ecb69 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -15,6 +15,10 @@ module Bundler new(opts[:dir], opts[:name]).install end + def tag_prefix=(prefix) + instance.tag_prefix = prefix + end + def gemspec(&block) gemspec = instance.gemspec block.call(gemspec) if block @@ -24,12 +28,15 @@ module Bundler attr_reader :spec_path, :base, :gemspec + attr_writer :tag_prefix + def initialize(base = nil, name = nil) @base = File.expand_path(base || SharedHelpers.pwd) gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : Dir[File.join(@base, "{,*}.gemspec")] raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1 @spec_path = gemspecs.first @gemspec = Bundler.load_gemspec(@spec_path) + @tag_prefix = "" end def install @@ -168,7 +175,7 @@ module Bundler end def version_tag - "v#{version}" + "#{@tag_prefix}v#{version}" end def name |