Skip to content

Instantly share code, notes, and snippets.

@eregon
Forked from mame/dev-meeting-agenda-setup.rb
Created January 9, 2020 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eregon/b4aa78dca42e4204e3a276c922205ade to your computer and use it in GitHub Desktop.
Save eregon/b4aa78dca42e4204e3a276c922205ade to your computer and use it in GitHub Desktop.
A script to create an agenda for dev-meeting https://bugs.ruby-lang.org/issues/14770
#!/usr/bin/env ruby
require "open-uri"
require "json"
unless ARGV[0] =~ %r{\Ahttps://bugs.ruby-lang.org/issues/(\d+)\z}
puts "Usage: #$0 https://bugs.ruby-lang.org/issues/XXXX"
exit 1
end
open("https://bugs.ruby-lang.org/issues/#$1.json?include=journals") do |f|
comments = JSON.parse(f.read, symbolize_names: true)[:issue][:journals]
comments.each do |comment|
comment[:notes].gsub("\r\n", "\n").scan(/^[*\-] (\[(?:Bug|Feature|Misc) #(\d+)\]) (.*?)( \(\w+\))?\s*\n((?: [*\-] .*(?:\n|$))+)/) do
issue, nb, title, author, summary = $~.captures
author = " (#{comment[:user][:name].split(' ').first})" unless author
puts "### [#{issue}](https://bugs.ruby-lang.org/issues/#{nb}) #{title}#{author}"
puts
puts summary.gsub(/^ /, "")
puts
puts "Discussion:"
puts
puts "* in short: "
puts
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment