Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
namespace :git do desc "Help" task :help do puts "Use :to_changelog in the following way:" puts " sake git:to_changelog " puts "This will read all commit messages from the" puts "logs and write them to a CHANGELOG file. " puts "Besides this you can use the following options" puts "to redefine the task." puts "" puts "NAME = name of the file to use" puts "FORMAT = specify a format according git-log(1)" puts "SPAN = determine a time span for which the log" puts " should be printed. Defaults to all " puts " messages" end desc "Write the commit messages to CHANGELOG" task :to_changelog do name = ENV["NAME"] || "CHANGELOG" format = "format:" + ENV["FORMAT"] || "%s" span = "" || ENV["SPAN"] system("git log --pretty=\"#{format}\" #{span} >#{name}") end end
This paste will be private.
From the Design Piracy series on my blog: