Class: Metanorma::Release::AggregateCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/release/commands/aggregate.rb

Defined Under Namespace

Classes: Config

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ AggregateCommand

Returns a new instance of AggregateCommand.



13
14
15
# File 'lib/metanorma/release/commands/aggregate.rb', line 13

def initialize(config)
  @config = config
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/metanorma/release/commands/aggregate.rb', line 17

def call
  result = run_aggregation
  return result unless result.publications.any?

  index = build_index(result)
  site = Site.new(index: index, output_dir: @config.output_dir)
  site.write!
  site.enrich!
  site.package! if @config.create_zip

  stamp_primary_identifiers(index)
  result
end