@@ -3,7 +3,11 @@ require 'rubygems'
33require 'rake/gempackagetask'
44require 'rake/rdoctask'
55require 'rake/testtask'
6- require 'lib/ruby-debug/version'
6+ if RUBY_VERSION < "1.9"
7+ require 'lib/ruby-debug/version'
8+ else
9+ require_relative 'lib/ruby-debug/version'
10+ end
711require 'date'
812
913desc 'Default: run unit tests.'
@@ -13,9 +17,9 @@ task :default => [:test]
1317RUBY_DEBUG_IDE_VERSION = Debugger ::IDE_VERSION
1418
1519FILES = FileList [
16- # 'CHANGES',
17- # 'ChangeLog',
18- # 'ChangeLog.archive',
20+ 'CHANGES' ,
21+ 'ChangeLog' ,
22+ 'ChangeLog.archive' ,
1923 'MIT-LICENSE' ,
2024 'Rakefile' ,
2125 'bin/*' ,
@@ -69,44 +73,30 @@ Rake::TestTask.new do |t|
6973end
7074
7175
72- desc "Create a GNU-style ChangeLog via svn2cl"
73- task :ChangeLog do
74- system ( "svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/debug-commons/ruby-debug-ide/trunk -o ChangeLog" )
75- end
76-
77- #desc "Publish ruby-debug to RubyForge."
78- #task :publish do
79- # require 'rake/contrib/sshpublisher'
80- #
81- # # Get ruby-debug path
82- # ruby_debug_path = File.expand_path(File.dirname(__FILE__))
83- #
84- # publisher = Rake::SshDirPublisher.new("kent@rubyforge.org",
85- # "/var/www/gforge-projects/ruby-debug", ruby_debug_path)
86- #end
87- #
88- #desc "Clear temp files"
89- #task :clean do
90- # cd "ext" do
91- # if File.exists?("Makefile")
92- # sh "make clean"
93- # rm "Makefile"
94- # end
95- # end
96- #end
97- #
98- ## --------- RDoc Documentation ------
99- #desc "Generate rdoc documentation"
100- #Rake::RDocTask.new("rdoc") do |rdoc|
101- # rdoc.rdoc_dir = 'doc'
102- # rdoc.title = "ruby-debug"
103- # # Show source inline with line numbers
104- # rdoc.options << "--inline-source" << "--line-numbers"
105- # # Make the readme file the start page for the generated html
106- # rdoc.options << '--main' << 'README'
107- # rdoc.rdoc_files.include('bin/**/*',
108- # 'lib/**/*.rb',
109- # 'ext/**/ruby_debug.c',
110- # 'README',
111- # 'LICENSE')
112- #end
76+ desc "Create a ChangeLog"
77+ # simple rake task to output a changelog between two commits, tags ...
78+ # output is formatted simply, commits are grouped under each author name
79+ desc "generate changelog with nice clean output"
80+ task :changelog , :since_c , :until_c do |t , args |
81+ since_c = args [ :since_c ] || `git tag | head -1` . chomp
82+ until_c = args [ :until_c ]
83+ cmd = `git log --pretty='format:%ci::%an <%ae>::%s::%H' #{ since_c } ..#{ until_c } `
84+
85+ entries = Hash . new
86+ changelog_content = String . new
87+
88+ cmd . split ( "\n " ) . each do |entry |
89+ date , author , subject , hash = entry . chomp . split ( "::" )
90+ entries [ author ] = Array . new unless entries [ author ]
91+ day = date . split ( " " ) . first
92+ entries [ author ] << "#{ subject } (#{ hash } )" unless subject =~ /Merge/
93+ end
94+
95+ # generate clean output
96+ entries . keys . each do |author |
97+ changelog_content += author + "\n "
98+ entries [ author ] . reverse . each { |entry | changelog_content += " * #{ entry } \n " }
99+ end
100+
101+ puts changelog_content
102+ end
0 commit comments