Changeset 4958
- Timestamp:
- 01/19/08 19:46:30 (5 years ago)
- Location:
- lang/ruby/shipit/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/shipit/trunk/README
r4432 r4958 55 55 56 56 * NAME -> name of the library. 57 * DESCRIPTION -> description of the library 58 * VERS -> version of the library 57 59 This is MUST reference to version string of ChangeVersion step, or 58 60 the package task will fail and RubyForge step release wrong version. 59 * DESCRIPTION -> description of the library60 * VERS -> version of the library61 61 62 62 If you use different constants, please assign the value to above constants. -
lang/ruby/shipit/trunk/Rakefile
r4148 r4958 117 117 system("svn", "up") 118 118 }.and {} 119 s.Step.new { 120 raise "changelog-with-hatenastar.rb is not found" unless system("which", "changelog-with-hatenastar.rb") 121 }.and { 122 system("changelog-with-hatenastar.rb > ChangeLog") 123 } 119 124 s.Task :rubyforge 120 s.Step.new { 121 raise "svn2cl.sh is not found" unless `svn2cl.sh --version`[/svn2cl.sh/] 122 }.and { 123 system("svn2cl.sh --break-before-msg=2 --group-by-day --include-rev --separate-daylogs") 124 } 125 s.ChangeVersion __FILE__, "VERS" 125 s.ChangeVersion "Rakefile", "VERS" 126 126 s.Commit 127 127 s.Task :clean, :package -
lang/ruby/shipit/trunk/lib/shipit.rb
r4186 r4958 3 3 require "rake/tasklib" 4 4 require "term/ansicolor" 5 require "fileutils" 5 6 6 7 class Rake::ShipitTask < Rake::TaskLib … … 130 131 @match = @content.match(/#{@name}\s*=\s*['"](\d+\.\d+\.\d+)['"]/) 131 132 @new_version = @match[1].succ 133 @newcont = @content[0..@match.begin(1)-1] + @new_version + @content[@match.end(1)..-1] 132 134 raise "Can't find version string in #{@file}." if @match.nil? 133 135 puts "Find version string #{@match[1]} and will change to #{@new_version}" 136 137 # check content of Rakefile 138 @org = @file.parent + "#{@file.basename}.org" 139 FileUtils.cp @file, @org 140 @file.open("w") do |f| 141 f.print @newcont 142 end 143 m = Module.new 144 m.module_eval(File.read("Rakefile")) 145 146 FileUtils.mv @org, @file 147 raise "Constant VERS in Rakefile must be same as 3rd argument of ChangeVersion step." unless @vers == m.const_get(:VERS) 148 134 149 @vers.replace @new_version 135 150 end … … 138 153 puts "Changing version to #{@new_version}" 139 154 @file.open("w") do |f| 140 f.print @content[0..@match.begin(1)-1] 141 f.print @new_version 142 f.print @content[@match.end(1)..-1] 155 f.print @newcont 143 156 end 144 157 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)