Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Rake task to generate website/documentation with Rocco [http://…

…rtomayko.github.com/rocco/] and push it to Github
  • Loading branch information...
commit ae131a51991a5b43259beddf85da1fadf8a99157 1 parent 5ed5cf7
@karmi authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 Rakefile
View
20 Rakefile
@@ -50,3 +50,23 @@ rescue LoadError
abort "RCov is not available. In order to run rcov, you must: sudo gem install rcov"
end
end
+
+namespace :web do
+
+ desc "Generate and update website documentation"
+ task :update do
+ system "rocco examples/slingshot-dsl.rb"
+ html = File.read('examples/slingshot-dsl.html').gsub!(/slingshot\-dsl\.rb/, 'slingshot.rb')
+ File.open('examples/slingshot-dsl.html', 'w') { |f| f.write html }
+ system "open examples/slingshot-dsl.html"
+
+ # Update the Github website
+ current_branch = `git branch --no-color`.split("\n").select { |line| line =~ /^\* / }.to_s.gsub(/\* (.*)/, '\1')
+ (puts "Unable to determine current branch"; exit(1) ) unless current_branch
+ system "git stash save && git checkout web"
+ system "cp examples/slingshot-dsl.html index.html"
+ system "git add index.html && git co -m 'Updated Slingshot website'"
+ system "git push origin web:gh-pages -f"
+ system "git checkout #{current_branch} && git stash pop"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.