Class: Prmd::RakeTasks::Combine

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

Overview

Schema combine rake task

Examples:

Prmd::RakeTasks::Combine.new do |t|
  t.options[:meta] = 'schema/meta.json'
  t.paths << 'schema/schemata/api'
  t.output_file = 'schema/api.json'
end

Instance Attribute Summary collapse

Attributes inherited from Base

#name, #options

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Combine #initialize(options) ⇒ Combine

Creates a new task with name name.

Overloads:

  • #initialize(name) ⇒ Combine

    Parameters:

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

    Parameters:

    • options (Hash<Symbol, Object>)

      .option [String] output_file .option [Array<String>] paths


33
34
35
36
37
38
# File 'lib/prmd/rake_tasks/combine.rb', line 33

def initialize(*args, &block)
  options = legacy_parameters(*args)
  @paths = options.fetch(:paths) { [] }
  @output_file = options[:output_file]
  super options, &block
end

Instance Attribute Details

#output_fileString

target file the combined result should be written

Returns:

  • (String)

    ] target filename


23
24
25
# File 'lib/prmd/rake_tasks/combine.rb', line 23

def output_file
  @output_file
end

#pathsArray<String>

Returns list of paths

Returns:

  • (Array<String>)

    list of paths


19
20
21
# File 'lib/prmd/rake_tasks/combine.rb', line 19

def paths
  @paths
end