Skip to content

Instantly share code, notes, and snippets.

@nicklewis
Created August 27, 2010 01:40
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 nicklewis/552610 to your computer and use it in GitHub Desktop.
Save nicklewis/552610 to your computer and use it in GitHub Desktop.
# 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