Class: GithubPagesRakeTasks::PublishTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- GithubPagesRakeTasks::PublishTask
- Extended by:
- Forwardable
- Defined in:
- lib/github_pages_rake_tasks/publish_task.rb
Overview
Instantiate this class to create a Rake task that pushes the contents from a local documentation directory to a GitHub repository branch.
See #initialize for more details.
Instance Method Summary collapse
-
#initialize(*task_args, &initialization_block) {|state, task_args| ... } ⇒ PublishTask
constructor
Create the publish task.
Constructor Details
#initialize(*task_args, &initialization_block) {|state, task_args| ... } ⇒ PublishTask
Create the publish task
By default, the rake task github-pages:publish
is created which pushes the doc
directory within the local copy of your repository to the same repository's
gh-pages
branch. The contents of the branch are completely replaced by the
contents of the documentation directory.
An initialization block can be passed to the initializer to set attributes to customize the behavior of the rake task created. State details all the attributes which can be set and what effect they have on the task.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/github_pages_rake_tasks/publish_task.rb', line 68 def initialize(*task_args, &initialization_block) super @state = State.new # Allow user to override defaults # yield(*[@state, task_args].slice(0, initialization_block.arity)) if initialization_block namespace rake_namespace do desc "Publish #{doc_dir} to #{repo_url}##{branch_name}" task :publish do publish_task end end end |