Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Open all rails/rails release between specified versions
# Usage:
# # Open all releases between 6.1 and 7.0
# $ ruby open-releases.rb 6.1 7.0
tags = `git tag`.lines(chomp: true).map { _1[/^v(.+)$/, 1] }.compact.map { Gem::Version.new _1 rescue nil }.compact
s, e = ARGV.map { Gem::Version.new _1 }
vs = tags.select { s < _1 && _1 <= e }
vs.each do |v|
url = "https://github.com/rails/rails/releases/tag/v#{v}"
`open #{url}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment