Class: Toe::Setup::GhPages
- Inherits:
-
Tap::Task
- Object
- Tap::Task
- Toe::Setup::GhPages
- Includes:
- Tap::Utils
- Defined in:
- lib/toe/setup/gh_pages.rb
Overview
:startdoc::task setup github pages
GitHub Pages are about the easiest way to put up documentation possible. This task sets up github pages a-la the instructions that appear when you visit your project homepage before pages is set up:
yourname.github.com/project
Caution: make your working directory clean before you do this (either stash or commit), otherwise this will LOSE any changes you’ve made to your project since the last commit.
% tap setup/gh_pages
Subsequent to this task, your working directory will be empty and you will be on the gh-pages branch. Add content and push to github:
echo "My GitHub Page" > index.html
git add .
git commit -a -m "First pages commit"
git push origin gh-pages
The documentation should be updated in about a minute.
Instance Method Summary collapse
Instance Method Details
#process ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/toe/setup/gh_pages.rb', line 33 def process unless File.exists?(".git") raise "cannot setup pages, not a git repository" end sh "git symbolic-ref HEAD refs/heads/gh-pages" if File.exists?(".git/index") sh "rm .git/index" end if clean sh "git clean -fdx" end end |
#sh(*cmd) ⇒ Object
49 50 51 52 |
# File 'lib/toe/setup/gh_pages.rb', line 49 def sh(*cmd) log :sh, cmd.join(' ') super end |