Rakefile in bobes-textmagic-0.2.3 vs Rakefile in bobes-textmagic-0.3.0
- old
+ new
@@ -1,7 +1,8 @@
require 'rubygems'
require 'rake'
+require 'sdoc'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "textmagic"
@@ -55,6 +56,37 @@
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "textmagic #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.options << '--charset' << 'utf8'
+ rdoc.options << '--fmt' << 'shtml'
+ rdoc.template = 'direct'
+end
+
+desc "Build, commit and publish the RDOC files"
+task :doc => :rerdoc do
+ cmd = <<-EOS
+ echo 'Packing and deleting rdoc directory'
+ tar -cf rdoc.tar rdoc
+ rm -rf rdoc
+ echo 'Checking out gh-pages branch'
+ git checkout -m gh-pages
+ echo 'Replacing rdoc directory'
+ rm -rf rdoc
+ tar -xf rdoc.tar
+ rm rdoc.tar
+ echo 'Commiting'
+ git add rdoc
+ git commit -m 'Updated RDoc'
+ echo 'Pushing to origin'
+ git push origin gh-pages
+ EOS
+
+ system cmd.split(/\n\s*/).join(' && ')
+
+ system <<-EOS
+ echo 'Checking out master'
+ git checkout master
+ echo 'Done'
+ EOS
end