Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
adding own rake tasks file
Browse files Browse the repository at this point in the history
adding nice little task to generate changelog
  • Loading branch information
mcansky committed Jan 30, 2011
1 parent ba510ee commit f0481c3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Rakefile
Expand Up @@ -4,10 +4,4 @@
require File.expand_path('../config/application', __FILE__)
require 'rake'

Mjolk::Application.load_tasks

# yard - rdoc
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'app/**/*.rb'] # optional
#t.options = ['--any', '--extra', '--opts'] # optional
end
Mjolk::Application.load_tasks
26 changes: 26 additions & 0 deletions lib/tasks/undies.rake
@@ -0,0 +1,26 @@
# because they come in handy

namespace :undies do
desc "generate changelog with nice clean output"
task :changelog, :since_c, :until_c do |t,args|
cmd=`git log --pretty='format:%ci::%an <%ae>::%s' #{args[:since_c]}..#{args[:until_c]}`

entries = Hash.new
changelog_content = String.new

cmd.split("\n").each do |entry|
date, author, subject = entry.chomp.split("::")
entries[author] = Array.new unless entries[author]
day = date.split(" ").first
entries[author] << subject unless subject =~ /Merge/
end

# generate clean output
entries.keys.each do |author|
changelog_content += author + "\n"
entries[author].each { |entry| changelog_content += " * #{entry}\n" }
end

puts changelog_content
end
end

0 comments on commit f0481c3

Please sign in to comment.