diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2025-12-11 17:57:37 -0800 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-12-11 17:57:38 -0800 |
| commit | be43ad37b7fe7dbeaec653c4ec3dfcf5999e2824 (patch) | |
| tree | 1242893513c9fd0be05ed478f227892f85234521 /tool | |
| parent | 8fba4b0f6008b68845be89861ddb73190d53511e (diff) | |
release.yml: Fix tag conversion for Ruby 4.0
and PREVIOUS_RELEASE_TAG for any .0 releases
Diffstat (limited to 'tool')
| -rwxr-xr-x[-rw-r--r--] | tool/ruby-version.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tool/ruby-version.rb b/tool/ruby-version.rb index aaaa345e75..3bbec576e1 100644..100755 --- a/tool/ruby-version.rb +++ b/tool/ruby-version.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + module RubyVersion def self.tag(version) major_version = Integer(version.split('.', 2)[0]) @@ -35,3 +37,16 @@ module RubyVersion end end end + +if __FILE__ == $0 + case ARGV[0] + when "tag" + print RubyVersion.tag(ARGV[1]) + when "previous" + print RubyVersion.previous(ARGV[1]) + when "previous-tag" + print RubyVersion.tag(RubyVersion.previous(ARGV[1])) + else + "#{$0}: unexpected command #{ARGV[0].inspect}" + end +end |
