summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorAndrew Horsman <minirobotics@gmail.com>2010-12-03 20:04:04 -0500
committerAndrew Horsman <minirobotics@gmail.com>2010-12-03 20:04:04 -0500
commita5f828efb59411e5a0becdcea99e55babde89cd3 (patch)
tree2938217f86c1f03172465f57d1c5042dd5c71324 /Rakefile
parentf80987b9c24935e5ede3d789113d3b0051302924 (diff)
downloadslop-a5f828efb59411e5a0becdcea99e55babde89cd3.tar.gz
Added readme:compile to automatically change readme slop version in gem commands.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 65e6342..addd358 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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