Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Revert "more gh-pages love""

This reverts commit 285b2e9.
  • Loading branch information...
commit 3ccd4f598dd120d748a21fe68c859123e0677dca 1 parent c71c505
@ot-matt-florence ot-matt-florence authored
Showing with 22 additions and 3 deletions.
  1. +22 −3 RakeFile
View
25 RakeFile
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.