Class: Metanorma::Release::PublishCommand
- Inherits:
-
Object
- Object
- Metanorma::Release::PublishCommand
- Includes:
- ConfigResolver
- Defined in:
- lib/metanorma/release/commands/publish.rb
Defined Under Namespace
Classes: Config
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config) ⇒ PublishCommand
constructor
A new instance of PublishCommand.
Methods included from ConfigResolver
#load_manifest, #resolve_channel_config
Constructor Details
#initialize(config) ⇒ PublishCommand
Returns a new instance of PublishCommand.
14 15 16 |
# File 'lib/metanorma/release/commands/publish.rb', line 14 def initialize(config) @config = config end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/metanorma/release/commands/publish.rb', line 18 def call manifest = load_manifest(@config.manifest) channel_config = resolve_channel_config(@config.config_source, manifest) = { token: @config.token } publisher = PlatformFactory.build_publisher(@config.platform, ) channel_override = Channel.parse_list(@config.channels) if @config.channels deps = ReleasePipeline::Dependencies.new( extractor: RxlExtractor.new, filters: [], change_detector: ContentHashChangeDetector.new(previous_releases: {}), packager: ZipPackager.new, publisher: publisher, naming_registry: NamingRegistry.default_registry, manifest: manifest, channel_override: channel_override, channel_config: channel_config ) pipeline_config = ReleasePipeline::Config.new( output_dir: @config.output_dir, manifest_path: @config.manifest, force: @config.force, force_replace_patterns: @config.force_replace && !@config.force_replace.empty? ? @config.force_replace : nil, concurrency: @config.concurrency, default_visibility: 'public' ) ReleasePipeline.new(deps).run(pipeline_config) end |