Created
August 27, 2010 01:40
-
-
Save nicklewis/552610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment