Skip to content

Instantly share code, notes, and snippets.

@pocke
Created July 15, 2022 07:00
Show Gist options
  • Save pocke/f4936465ea1a3b1de1951216a428a274 to your computer and use it in GitHub Desktop.
Save pocke/f4936465ea1a3b1de1951216a428a274 to your computer and use it in GitHub Desktop.
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