Permalink
Browse files

more gh-pages love

  • Loading branch information...
1 parent ee9a596 commit f4a1728ddbc0057d8e9a145a933b7f128d07d906 @ot-matt-florence ot-matt-florence committed Apr 11, 2012
Showing with 22 additions and 3 deletions.
  1. +22 −3 RakeFile
View
@@ -1,5 +1,6 @@
require 'nokogiri'
require 'cgi'
+require 'date'
require 'zip/zipfilesystem'
desc 'build'
@@ -139,9 +140,16 @@ task :samples, :spec do |t,args|
sh "NSpecRunner/bin/debug/NSpecRunner.exe SampleSpecs/bin/debug/SampleSpecs.dll #{spec}"
end
-desc 'supply the current tutorial markup in source.html and generate new.html containing current source code and output'
+desc 'supply the current tutorial markup in index.html and generate a new index.html containing current source code and output'
task :website => :spec do
- if File.exists? 'source.html'
+ `git checkout gh-pages`
+ `git pull origin gh-pages`
+ `git checkout master`
+ `git checkout gh-pages index.html`
+ if File.exists? 'index.html'
+
+ FileUtils.cp 'index.html', 'source.html'
+
@doc = Nokogiri::HTML.fragment(File.read 'source.html')
Dir['SampleSpecs/WebSite/**/*.*'].each {|f| generate_html f}
@@ -156,8 +164,19 @@ task :website => :spec do
File.open('new.html', 'w') {|f| f.write(@doc) }
else
- puts 'you must download the current markup into source.html'
+ puts 'you must download the current markup into index.html'
end
+
+ version = get_version_node.text
+
+ `git checkout gh-pages`
+
+ FileUtils.cp 'new.html', 'index.html'
+
+ `git add index.html`
+ `git commit -m "#{version} #{DateTime.now}`
+ #`git push`
+ #`git checkout master`
end
def generate_html file

0 comments on commit f4a1728

Please sign in to comment.