Class: Emmett::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/emmett/rake_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Yields:

  • (_self)

Yield Parameters:



23
24
25
26
27
28
29
30
31
32
# File 'lib/emmett/rake_task.rb', line 23

def initialize(*args)
  @task_name = args.shift || :emmett
  yield self if block_given?
  desc "Generates api documentation using emmett" unless ::Rake.application.last_comment
  task task_name do
    configuration.verify!
    Emmett::DocumentManager.render! configuration
  end

end

Instance Attribute Details

#configurationObject



9
10
11
# File 'lib/emmett/rake_task.rb', line 9

def configuration
  @configuration ||= build_default_configuration
end

#task_nameObject

Returns the value of attribute task_name.



20
21
22
# File 'lib/emmett/rake_task.rb', line 20

def task_name
  @task_name
end

Instance Method Details

#index_page=(value) ⇒ Object



15
# File 'lib/emmett/rake_task.rb', line 15

def index_page=(value);  configuration.index_page = value; end

#name=(value) ⇒ Object

Proxy each of the configuration options.



14
# File 'lib/emmett/rake_task.rb', line 14

def name=(value);        configuration.name = value; end

#output_dir=(value) ⇒ Object



17
# File 'lib/emmett/rake_task.rb', line 17

def output_dir=(value);  configuration.output_dir = value; end

#section_dir=(value) ⇒ Object



16
# File 'lib/emmett/rake_task.rb', line 16

def section_dir=(value); configuration.section_dir = value; end

#template=(value) ⇒ Object



18
# File 'lib/emmett/rake_task.rb', line 18

def template=(value);    configuration.template = value; end