Rakefile in command_exec-0.1.0 vs Rakefile in command_exec-0.1.3

- old
+ new

@@ -1,9 +1,10 @@ #!/usr/bin/env rake require 'bundler/gem_tasks' require 'yard' require 'rubygems/package_task' +require 'active_support/core_ext/string/strip' YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb', 'README.md', 'LICENCE.md'] t.options = ['--output-dir=doc/yard', '--markup-provider=redcarpet', '--markup=markdown' ] end @@ -20,14 +21,18 @@ task :bump do new_version = ENV['VERSION'] - version_string = %Q{ module DataUri - VERSION = '#{new_version}' - end} + raw_module_name = File.open(version_file, "r").readlines.grep(/module/).first + module_name = raw_module_name.chomp.match(/module\s+(\S+)/) {$1} + version_string = %Q{#main #{module_name} +module #{module_name} + VERSION = '#{new_version}' +end} + File.open(version_file, "w") do |f| f.write version_string.strip_heredoc end sh "git add #{version_file}" @@ -44,6 +49,11 @@ else warn "Could not parse version file \"#{version_file}\"" end end + + task :restore do + sh "git checkout #{version_file}" + end + end