Class: Metanorma::Release::PackageCommand

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

Defined Under Namespace

Classes: Config

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ PackageCommand

Returns a new instance of PackageCommand.



11
12
13
# File 'lib/metanorma/release/commands/package.rb', line 11

def initialize(config)
  @config = config
end

Instance Method Details

#callObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/metanorma/release/commands/package.rb', line 15

def call
  config = load_config
  deps = ReleasePipeline::Dependencies.new(
    extractor: Publication,
    filters: [],
    change_detector: ContentHashChangeDetector.new(previous_releases: {}),
    packager: ZipPackager.new(output_dir: @config.output_dir),
    publisher: PlatformFactory.build_publisher("null", {}),
    slug_registry: SlugRegistry.from_config(config),
    manifest: nil,
    channel_override: nil,
    config: config,
  )

  pipeline_config = ReleasePipeline::Config.new(
    output_dir: @config.output_dir,
    manifest_path: @config.manifest,
    force: false,
    force_replace_patterns: nil,
    concurrency: 4,
    default_visibility: "public",
  )

  ReleasePipeline.new(deps).run(pipeline_config)
end