module RJack::TarPit::DocTaskDefiner

Attributes

publish_rdoc_rsync_flags[RW]

Rsync flags for publish_rdoc. (default: %w[ -a -u -i ])

rdoc_destinations[RW]

Remote destinations array for publish_rdoc. (default: [])

rdoc_dir[RW]

Local destination directory for RDoc generated files. (default: doc)

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/rjack-tarpit/doc.rb, line 31
def initialize
  super

  @rdoc_dir = 'doc'
  @rdoc_destinations = []
  @publish_rdoc_rsync_flags = %w[ -a -u -i ]

  add_define_hook( :define_doc_tasks )
end

Public Instance Methods

define_doc_tasks() click to toggle source
# File lib/rjack-tarpit/doc.rb, line 41
def define_doc_tasks
  require 'rdoc/task'

  RDoc::Task.new( :rdoc ) do |t|
    t.rdoc_dir = rdoc_dir
    t.rdoc_files += spec.require_paths
    t.rdoc_files += spec.extra_rdoc_files
    t.options = spec.rdoc_options
  end

  unless rdoc_destinations.empty?
    desc "Publish rdoc to #{ rdoc_destinations.join( ', ' ) }"
    task :publish_rdoc => [ :docs ] do
      rdoc_destinations.each do |dest|
        sh( *[ 'rsync', publish_rdoc_rsync_flags,
               rdoc_dir + '/', dest ].flatten )
      end
    end
  end

  desc "Alias rdoc task"
  task :docs => [ :rdoc ]
end