Module: Rake::DevEiate::Docs

Extended by:
Rake::DSL
Defined in:
lib/rake/deveiate/docs.rb

Overview

Documentation-generation tasks

Instance Method Summary collapse

Instance Method Details

#define_tasksObject

Define documentation tasks



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rake/deveiate/docs.rb', line 17

def define_tasks
  super if defined?( super )

  task :docs => :phony

  RDoc::Task.new( 'docs' ) do |rdoc|
    rdoc.main = self.readme_file.to_s
    rdoc.rdoc_files = self.rdoc_files
    rdoc.generator = :fivefish
    rdoc.title = self.title
    rdoc.rdoc_dir = Rake::DevEiate::DOCS_DIR.to_s
  end

  if self.publish_to
    target = self.publish_to

    desc "Publish API docs to #{target}"
    task :publish_docs => :docs do
      target = File.join( target, self.name ) unless target.end_with?( self.name )
      sh 'rsync', '-COva', Rake::DevEiate::DOCS_DIR.to_s + '/', target
    end
  end

  task :debug => :docs_debug
  task( :docs_debug, &method(:do_docs_debug) )
end

#do_docs_debug(task, args) ⇒ Object

Task body for the :docs_debug task



46
47
48
49
50
51
52
53
54
# File 'lib/rake/deveiate/docs.rb', line 46

def do_docs_debug( task, args )
  self.prompt.say( "Docs are published to:", color: :bright_green )
  if ( publish_url = self.publish_to )
    self.prompt.say( self.indent(publish_url, 4) )
  else
    self.prompt.say( self.indent("n/a"), color: :bright_yellow )
  end
  self.prompt.say( "\n" )
end