Class: JekyllAndHyde::Github

Inherits:
GroupTask
  • Object
show all
Defined in:
lib/jekyll_and_hyde/tasks/github.rb

Instance Method Summary collapse

Methods inherited from GroupTask

self_task

Methods included from Actions

#run_command, #say_status, #set_color, #validate_installation

Instance Method Details

#check_uncommited_filesObject

Raises:



9
10
11
12
# File 'lib/jekyll_and_hyde/tasks/github.rb', line 9

def check_uncommited_files
  output = run_command 'git status', :capture => true
  raise Error, "There are uncommited changes. Please commit them first." unless output.include?("nothing to commit")
end

#create_github_page_branchObject



14
15
16
17
18
19
# File 'lib/jekyll_and_hyde/tasks/github.rb', line 14

def create_github_page_branch
  run_command 'git checkout -b gh-pages'
  run_command 'git branch -d master'
  say_status :create, 'branch "gh-pages" for GitHub project page, details in http://pages.github.com/.'
  say
end


21
22
23
24
25
26
27
28
# File 'lib/jekyll_and_hyde/tasks/github.rb', line 21

def print_next_steps
  next_step_string = "Next steps:"
  say set_color(next_step_string, :blue, true)
  say "-" * next_step_string.size
  say 'git remote add origin [email protected]:your_github_username/your_git_repo.git'
  say 'git push origin gh-pages'
  say
end

#validate_current_installationObject



5
6
7
# File 'lib/jekyll_and_hyde/tasks/github.rb', line 5

def validate_current_installation
  validate_installation
end