Class: Prmd::RakeTasks::Doc

Inherits:
Base
  • Object
show all
Defined in:
lib/prmd/rake_tasks/doc.rb

Overview

Documentation rake task

Examples:

Prmd::RakeTasks::Doc.new do |t|
  t.files = { 'schema/api.json' => 'schema/api.md' }
end

Instance Attribute Summary collapse

Attributes inherited from Base

#name, #options

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Doc #initialize(options) ⇒ Doc

Creates a new task with name name.

Overloads:

  • #initialize(name) ⇒ Doc

    Parameters:

    • (String)
  • #initialize(options) ⇒ Doc

    Parameters:

    • options (Hash<Symbol, Object>)

      .option [Array<String>, Hash<String, String>] files schema files


31
32
33
34
35
36
# File 'lib/prmd/rake_tasks/doc.rb', line 31

def initialize(*args, &block)
  options = legacy_parameters(*args)
  @files = options.fetch(:files) { [] }
  super options, &block
  @options[:template] ||= Prmd::Template.template_dirname
end

Instance Attribute Details

#filesArray<String>, Hash<String, String>

Schema files that should be rendered

Returns:

  • (Array<String>, Hash<String, String>)

    list of files


22
23
24
# File 'lib/prmd/rake_tasks/doc.rb', line 22

def files
  @files
end