diff options
author | Andrew Horsman <minirobotics@gmail.com> | 2010-12-03 20:04:04 -0500 |
---|---|---|
committer | Andrew Horsman <minirobotics@gmail.com> | 2010-12-03 20:04:04 -0500 |
commit | a5f828efb59411e5a0becdcea99e55babde89cd3 (patch) | |
tree | 2938217f86c1f03172465f57d1c5042dd5c71324 /Rakefile | |
parent | f80987b9c24935e5ede3d789113d3b0051302924 (diff) | |
download | slop-a5f828efb59411e5a0becdcea99e55babde89cd3.tar.gz |
Added readme:compile to automatically change readme slop version in gem commands.
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -5,4 +5,20 @@ RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = 'spec/**/*_spec.rb' end -task :default => :spec
\ No newline at end of file +namespace :readme do + + desc "Modify readme documentation automatically" + task :compile do + latest_version = 'slop-' + `git tag -l`.split("\n").last + readme_filepath = File.join(File.dirname(__FILE__), "README.md") + + working_readme = File.read(readme_filepath) + working_readme.gsub! /(slop-[0-9]+\.[0-9]+\.[0-9]+)/, latest_version + + File.open(readme_filepath, "w") { |readme| readme.puts working_readme } + end + +end + + +task :default => :spec |