Loading Rakefile +47 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,53 @@ task :sass do system "compass compile --quiet template/resources/sass" end def write_version_file(version) File.open('./lib/jsduck/version.rb', 'w') do |f| f.write(<<-EORUBY) # This file is updated by rake bump task. # Do not edit by hand. module JsDuck VERSION = "#{version}" end EORUBY end end def commit_version(version) system "git commit lib/jsduck/version.rb -m 'Up version to #{version}.'" puts "Creating tag v#{version}" system "git tag -a v#{version} -m 'Tagging #{version} release.'" end desc <<-EOTEXT Bumps JSDuck minor version number up by one. Or sets the specified version number, when invoked like: rake bump['1.2.3'] Also commits and tags the change in git. EOTEXT task :bump, :new_version do |t, args| require "./lib/jsduck/version.rb" if args[:new_version] new = args[:new_version] puts "Bumping version from #{JsDuck::VERSION} to #{new}" write_version_file(new) commit_version(new) else if JsDuck::VERSION =~ /\A([0-9]+)\.([0-9]+)\.([0-9]+)\z/ new = "#{$1}.#{$2}.#{$3.to_i+1}" puts "Bumping version from #{JsDuck::VERSION} to #{new}" write_version_file(new) commit_version(new) else puts "Unable to automatically bump the version: #{JsDuck::VERSION}" exit 1 end end end desc "Build JSDuck gem" task :gem => :sass do compress Loading lib/jsduck/version.rb +2 −0 Original line number Diff line number Diff line # This file is updated by rake bump task. # Do not edit by hand. module JsDuck VERSION = "5.3.3" end Loading
Rakefile +47 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,53 @@ task :sass do system "compass compile --quiet template/resources/sass" end def write_version_file(version) File.open('./lib/jsduck/version.rb', 'w') do |f| f.write(<<-EORUBY) # This file is updated by rake bump task. # Do not edit by hand. module JsDuck VERSION = "#{version}" end EORUBY end end def commit_version(version) system "git commit lib/jsduck/version.rb -m 'Up version to #{version}.'" puts "Creating tag v#{version}" system "git tag -a v#{version} -m 'Tagging #{version} release.'" end desc <<-EOTEXT Bumps JSDuck minor version number up by one. Or sets the specified version number, when invoked like: rake bump['1.2.3'] Also commits and tags the change in git. EOTEXT task :bump, :new_version do |t, args| require "./lib/jsduck/version.rb" if args[:new_version] new = args[:new_version] puts "Bumping version from #{JsDuck::VERSION} to #{new}" write_version_file(new) commit_version(new) else if JsDuck::VERSION =~ /\A([0-9]+)\.([0-9]+)\.([0-9]+)\z/ new = "#{$1}.#{$2}.#{$3.to_i+1}" puts "Bumping version from #{JsDuck::VERSION} to #{new}" write_version_file(new) commit_version(new) else puts "Unable to automatically bump the version: #{JsDuck::VERSION}" exit 1 end end end desc "Build JSDuck gem" task :gem => :sass do compress Loading
lib/jsduck/version.rb +2 −0 Original line number Diff line number Diff line # This file is updated by rake bump task. # Do not edit by hand. module JsDuck VERSION = "5.3.3" end