diff --git a/Rakefile b/Rakefile index c626766..78890ec 100644 --- a/Rakefile +++ b/Rakefile @@ -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 \ No newline at end of file +Mjolk::Application.load_tasks \ No newline at end of file diff --git a/lib/tasks/undies.rake b/lib/tasks/undies.rake new file mode 100644 index 0000000..1180fd1 --- /dev/null +++ b/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 \ No newline at end of file