public
Created

  • Download Gist
ticket
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Requires the redmine_client gem
#!/usr/bin/env ruby
 
require 'rubygems'
require 'redmine_client'
 
NORMAL = "\e[00;00m"
NORMAL_BOLD = "\e[00;01m"
YELLOW = "\e[00;33m"
BORING_CYAN = "\e[00;36m"
BLUE = "\e[00;34m"
CYAN = "\e[01;36m"
RED = "\e[00;31m"
GREEN = "\e[00;32m"
BOLD_GREEN = "\e[01;32m"
DEEP_BLUE = "\e[01;34m"
 
SEPARATOR = "#{RED}===#{NORMAL}"
 
RedmineClient::Base.site = "http://project.puppetlabs.com"
 
RedmineClient::Issue.site = "http://projects.puppetlabs.com"
# The request fails with a 500 error if User-Agent isn't set
RedmineClient::Issue.headers["User-Agent"] = "Anything"
 
issue = RedmineClient::Issue.find(ARGV[0])
puts "#{NORMAL_BOLD}#{issue.subject} #{BORING_CYAN}[#{issue.status.name}]#{NORMAL}"
puts
puts "#{YELLOW}#{issue.author.name}#{NORMAL}\n"
# Boldify code blocks
puts issue.description.gsub("<pre>",NORMAL_BOLD).gsub("</pre>",NORMAL)
issue.journals.journal.each do |journal|
next unless journal.notes
puts
puts "#{YELLOW}#{journal.user.name}#{NORMAL}\n"
puts journal.notes
end rescue nil

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.