Sha256: ebd43da69e0547983f37bdf28aa56bcd84a79b0ec6d70fe8eb081c3dc28783ea

Contents?: true

Size: 886 Bytes

Versions: 3

Compression:

Stored size: 886 Bytes

Contents

require 'rake/sdoctask'

namespace :pages do
  task :publish => [ :check_dirty, :rerdoc ] do
    `git checkout gh-pages`
    `ls -1 | grep -v docs | xargs rm -rf; mv docs/* .; rm -rf docs`
    `git add .; git commit -m "update docs"; git push origin gh-pages`
    `git checkout master`
    puts :done
  end

  desc "Initialize GitHub Pages with documentation"
  task :init => [ :check_dirty, :rerdoc ] do
    `git symbolic-ref HEAD refs/heads/gh-pages`
    `rm .git/index`
    `ls -1 | grep -v docs | xargs rm -rf; mv docs/* .; rm -rf docs`
    `git add .;git commit -m "create docs"; git push origin gh-pages`
    `git checkout master`
    puts :done
  end

  task :check_dirty do
    if !`git status`.include?('nothing to commit')
      abort "dirty index - not publishing!"
    end
  end
end

desc "Build and publish documentation using GitHub Pages."
task :pages => "pages:publish"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brianjlandau-sdoc-helpers-0.1.5 lib/sdoc_helpers/pages.rb
brianjlandau-sdoc-helpers-0.1.4 lib/sdoc_helpers/pages.rb
brianjlandau-sdoc-helpers-0.1.2 lib/sdoc_helpers/pages.rb