Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Created December 17, 2012 23:22
Show Gist options
  • Select an option

  • Save jeffmccune/4323403 to your computer and use it in GitHub Desktop.

Select an option

Save jeffmccune/4323403 to your computer and use it in GitHub Desktop.
Simple script to process recent activity in redmine, e.g. the data listed at http://projects.puppetlabs.com/issues?query_id=304
require 'rubygems'
require 'thor'
require 'csv'
class ActivityApp < Thor
desc "list FILE", "report on activity given a CSV file from redmine"
# e.g. the report at http://projects.puppetlabs.com/issues?query_id=304
def list(file)
# Issue ID, Project, Tracker, Status, Subject, Target version, Updated
rows = Array.new
CSV.foreach(file) { |row| rows << row }
header = rows.shift
list = rows.collect do |field|
(id, project, tracker, status, subject, target_version, updated) = field
puts "[#{project} #{tracker} ##{id}] #{target_version} (#{status}) #{subject}"
end
end
end
# vim:ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment