class Semverve::DocsPublisher::Task
Defines Rake tasks for publishing generated documentation.
Attributes
Whether dirty source working trees are allowed.
@return [Boolean]
Branch that receives generated documentation.
@return [String]
Rake task that builds documentation before publishing.
@return [String]
Commit message for generated documentation updates.
@return [String]
Output stream for status messages.
@return [#puts]
Whether the publishing branch should be pushed.
@return [Boolean]
Remote used when pushing the publishing branch.
@return [String]
Source project root.
@return [String]
Directory containing generated documentation.
@return [String]
Documentation directory on the publishing branch.
@return [String]
Namespace for the generated tasks.
@return [Symbol, String]
Optional path for the temporary worktree.
@return [String, nil]
Public Class Methods
Source
# File lib/semverve/docs_publisher/task.rb, line 92 def initialize @root = Dir.pwd @build_task = "rerdoc" @source_dir = "docs" @target_dir = "docs" @branch = "gh-pages" @remote = "origin" @commit_message = "Update generated documentation" @worktree_path = nil @allow_dirty = false @push = true @output = $stdout @task_namespace = :docs yield self if block_given? define end
Initializes and defines documentation publishing tasks.
@yieldparam [Semverve::DocsPublisher::Task] task
@return [Semverve::DocsPublisher::Task]
Public Instance Methods
Source
# File lib/semverve/docs_publisher/task.rb, line 115 def define namespace namespace_name do desc "Publish generated documentation to #{branch}" task :publish do publish(dry_run: false) end namespace :publish do desc "Show whether generated documentation would change #{branch}" task :dry_run do publish(dry_run: true) end end end end
Defines the documentation publishing tasks.
@return [void]