Rakefile in katapult-0.2.0 vs Rakefile in katapult-0.3.0

- old
+ new

@@ -10,5 +10,18 @@ Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "features --format pretty" end RSpec::Core::RakeTask.new(:spec) + +task :update_readme do + require_relative 'lib/katapult/version' + readme_path = 'README.md' + readme = File.read readme_path + + # Using \s+ to support line breaks + readme.sub! /(currently\s+it's\s+Rails\s+)[\d\.]+/, "\\1#{Katapult::RAILS_VERSION}" + readme.sub! /(and\s+Ruby\s+)[\d\.]+\d/, "\\1#{Katapult::RUBY_VERSION}" + File.open readme_path, 'w' do |f| + f.write readme + end +end