metanorma-release 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +19 -1
- data/.rubocop_todo.yml +250 -319
- data/README.adoc +120 -233
- data/Rakefile +2 -2
- data/exe/metanorma-release +2 -2
- data/lib/metanorma/release/aggregation_pipeline.rb +59 -45
- data/lib/metanorma/release/asset_processor.rb +10 -8
- data/lib/metanorma/release/cache_store.rb +6 -6
- data/lib/metanorma/release/change_detector.rb +7 -3
- data/lib/metanorma/release/channel.rb +13 -39
- data/lib/metanorma/release/channel_filter.rb +26 -10
- data/lib/metanorma/release/cli.rb +129 -100
- data/lib/metanorma/release/commands/aggregate.rb +39 -54
- data/lib/metanorma/release/commands/package.rb +20 -12
- data/lib/metanorma/release/commands/{publish.rb → release_command.rb} +20 -12
- data/lib/metanorma/release/config.rb +104 -0
- data/lib/metanorma/release/content_hash.rb +11 -3
- data/lib/metanorma/release/delta_state.rb +55 -18
- data/lib/metanorma/release/file_routing.rb +8 -5
- data/lib/metanorma/release/index.rb +132 -0
- data/lib/metanorma/release/interfaces.rb +15 -15
- data/lib/metanorma/release/platform/github/manifest_reader.rb +4 -4
- data/lib/metanorma/release/platform/github/publisher.rb +23 -11
- data/lib/metanorma/release/platform/github/release_fetcher.rb +12 -3
- data/lib/metanorma/release/platform/github.rb +10 -7
- data/lib/metanorma/release/platform/local/directory_discoverer.rb +1 -1
- data/lib/metanorma/release/platform/local/fetcher.rb +17 -12
- data/lib/metanorma/release/platform/local/publisher.rb +9 -7
- data/lib/metanorma/release/platform/local.rb +4 -4
- data/lib/metanorma/release/platform/null/publisher.rb +3 -2
- data/lib/metanorma/release/platform/null.rb +1 -1
- data/lib/metanorma/release/platform.rb +3 -3
- data/lib/metanorma/release/platform_factory.rb +48 -29
- data/lib/metanorma/release/publication.rb +335 -0
- data/lib/metanorma/release/release_pipeline.rb +85 -52
- data/lib/metanorma/release/repo_ref.rb +5 -2
- data/lib/metanorma/release/site.rb +66 -0
- data/lib/metanorma/release/slug_strategy.rb +163 -0
- data/lib/metanorma/release/version.rb +1 -1
- data/lib/metanorma/release/zip_packager.rb +31 -8
- data/lib/metanorma/release.rb +68 -94
- metadata +22 -26
- data/lib/metanorma/release/aggregation_interfaces.rb +0 -27
- data/lib/metanorma/release/channel_audience.rb +0 -24
- data/lib/metanorma/release/channel_config.rb +0 -55
- data/lib/metanorma/release/channel_manifest.rb +0 -192
- data/lib/metanorma/release/channel_registry.rb +0 -60
- data/lib/metanorma/release/config_fetcher.rb +0 -11
- data/lib/metanorma/release/config_locator.rb +0 -37
- data/lib/metanorma/release/config_resolver.rb +0 -37
- data/lib/metanorma/release/document_id.rb +0 -45
- data/lib/metanorma/release/document_index.rb +0 -183
- data/lib/metanorma/release/document_metadata.rb +0 -39
- data/lib/metanorma/release/document_stage.rb +0 -86
- data/lib/metanorma/release/document_type.rb +0 -55
- data/lib/metanorma/release/document_version.rb +0 -50
- data/lib/metanorma/release/naming_strategy.rb +0 -158
- data/lib/metanorma/release/platform/github/config_fetcher.rb +0 -40
- data/lib/metanorma/release/platform/local/config_fetcher.rb +0 -20
- data/lib/metanorma/release/rake_tasks.rb +0 -71
- data/lib/metanorma/release/relaton_enricher.rb +0 -138
- data/lib/metanorma/release/release_metadata.rb +0 -79
- data/lib/metanorma/release/release_tag.rb +0 -49
- data/lib/metanorma/release/rxl_extractor.rb +0 -115
- data/lib/metanorma/release/stage_filter.rb +0 -18
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
require "yaml"
|
|
5
|
+
require "fileutils"
|
|
6
|
+
|
|
7
|
+
module Metanorma
|
|
8
|
+
module Release
|
|
9
|
+
class Site
|
|
10
|
+
attr_reader :index, :output_dir
|
|
11
|
+
|
|
12
|
+
def initialize(index:, output_dir:)
|
|
13
|
+
@index = index
|
|
14
|
+
@output_dir = output_dir
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def write!
|
|
18
|
+
FileUtils.mkdir_p(output_dir)
|
|
19
|
+
index.write(File.join(output_dir, "index.json"))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def enrich!
|
|
23
|
+
return if index.empty?
|
|
24
|
+
|
|
25
|
+
documents = index.publications.map do |pub|
|
|
26
|
+
rxl_file = pub.files.find { |f| f.format == "rxl" }
|
|
27
|
+
next pub.to_h unless rxl_file
|
|
28
|
+
|
|
29
|
+
rxl_path = File.join(output_dir, rxl_file.path)
|
|
30
|
+
next pub.to_h unless File.exist?(rxl_path)
|
|
31
|
+
|
|
32
|
+
bib = Relaton::Bib::Item.from_xml(File.read(rxl_path))
|
|
33
|
+
enriched = pub.to_h
|
|
34
|
+
enriched["bibliographic"] = bib.to_h
|
|
35
|
+
enriched
|
|
36
|
+
rescue StandardError => e
|
|
37
|
+
warn " Skip #{pub.identifier}: #{e.message}"
|
|
38
|
+
pub.to_h
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
dest = File.join(output_dir, "relaton")
|
|
42
|
+
FileUtils.mkdir_p(dest)
|
|
43
|
+
index_data = { "root" => { "title" => "Document Registry",
|
|
44
|
+
"items" => documents.compact } }
|
|
45
|
+
File.write(File.join(dest, "index.json"),
|
|
46
|
+
JSON.pretty_generate(index_data))
|
|
47
|
+
File.write(File.join(dest, "index.yaml"), YAML.dump(index_data))
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def package!(zip_path: nil)
|
|
51
|
+
require "zip"
|
|
52
|
+
|
|
53
|
+
path = zip_path || "#{output_dir}.zip"
|
|
54
|
+
Zip::File.open(path, Zip::File::CREATE) do |zipfile|
|
|
55
|
+
Dir.glob("#{output_dir}/**/*").each do |file|
|
|
56
|
+
next if File.directory?(file)
|
|
57
|
+
|
|
58
|
+
entry_name = file.sub("#{File.dirname(output_dir)}/", "")
|
|
59
|
+
zipfile.add(entry_name, file)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
path
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Metanorma
|
|
4
|
+
module Release
|
|
5
|
+
module SlugStrategy
|
|
6
|
+
def compute_tag(publication)
|
|
7
|
+
raise NotImplementedError, "#{self.class} must implement #compute_tag"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def compute_asset_name(publication)
|
|
11
|
+
raise NotImplementedError,
|
|
12
|
+
"#{self.class} must implement #compute_asset_name"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class EditionSlug
|
|
17
|
+
include SlugStrategy
|
|
18
|
+
|
|
19
|
+
def compute_tag(publication)
|
|
20
|
+
tag = "#{publication.slug}/ed#{publication.edition}"
|
|
21
|
+
{ tag: tag, pre_release: draft?(publication) }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def compute_asset_name(publication)
|
|
25
|
+
"#{publication.slug}-ed#{publication.edition}.zip"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def draft?(publication)
|
|
31
|
+
%w[20 30 40 50].include?(publication.stage.to_s)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class VersionSlug
|
|
36
|
+
include SlugStrategy
|
|
37
|
+
|
|
38
|
+
def compute_tag(publication)
|
|
39
|
+
tag = "#{publication.slug}/v#{publication.edition}"
|
|
40
|
+
{ tag: tag, pre_release: draft?(publication) }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def compute_asset_name(publication)
|
|
44
|
+
"#{publication.slug}-v#{publication.edition}.zip"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def draft?(publication)
|
|
50
|
+
%w[20 30 40 50].include?(publication.stage.to_s)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class InternetDraftSlug
|
|
55
|
+
include SlugStrategy
|
|
56
|
+
|
|
57
|
+
DRAFT_PATTERN = /\Adraft-ietf-([a-z0-9-]+?)-(\d+)\z/i
|
|
58
|
+
|
|
59
|
+
def compute_tag(publication)
|
|
60
|
+
match = publication.identifier.match(DRAFT_PATTERN)
|
|
61
|
+
return fallback_tag(publication) unless match
|
|
62
|
+
|
|
63
|
+
name = match[1]
|
|
64
|
+
num = match[2]
|
|
65
|
+
{ tag: "id-#{name}/#{num}", pre_release: true }
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def compute_asset_name(publication)
|
|
69
|
+
"#{publication.identifier}.zip"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
private
|
|
73
|
+
|
|
74
|
+
def fallback_tag(publication)
|
|
75
|
+
{ tag: "#{publication.identifier}/draft", pre_release: true }
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class RfcSlug
|
|
80
|
+
include SlugStrategy
|
|
81
|
+
|
|
82
|
+
def compute_tag(publication)
|
|
83
|
+
tag = "#{publication.slug}/ed#{publication.edition}"
|
|
84
|
+
{ tag: tag, pre_release: false }
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def compute_asset_name(publication)
|
|
88
|
+
"#{publication.slug}.zip"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
class DraftSuffixSlug
|
|
93
|
+
include SlugStrategy
|
|
94
|
+
|
|
95
|
+
DRAFT_SUFFIX = /-d(\d+)\z/
|
|
96
|
+
|
|
97
|
+
def compute_tag(publication)
|
|
98
|
+
match = publication.identifier.match(DRAFT_SUFFIX)
|
|
99
|
+
return @fallback.compute_tag(publication) unless match
|
|
100
|
+
|
|
101
|
+
base = publication.identifier.sub(DRAFT_SUFFIX, "")
|
|
102
|
+
num = match[1]
|
|
103
|
+
{ tag: "#{base}/#{num}", pre_release: true }
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def compute_asset_name(publication)
|
|
107
|
+
match = publication.identifier.match(DRAFT_SUFFIX)
|
|
108
|
+
return @fallback.compute_asset_name(publication) unless match
|
|
109
|
+
|
|
110
|
+
"#{publication.slug}.zip"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def initialize
|
|
114
|
+
@fallback = EditionSlug.new
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
class SlugRegistry
|
|
119
|
+
def initialize(default: EditionSlug.new)
|
|
120
|
+
@default = default
|
|
121
|
+
@strategies = {}
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def register(publisher, strategy)
|
|
125
|
+
@strategies[publisher.to_s] = strategy
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def resolve(publisher)
|
|
129
|
+
@strategies.fetch(publisher.to_s, @default)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def self.from_config(config)
|
|
133
|
+
registry = new
|
|
134
|
+
config.slug_strategies.each do |publisher, strategy_name|
|
|
135
|
+
strategy = build_strategy(strategy_name)
|
|
136
|
+
registry.register(publisher, strategy) if strategy
|
|
137
|
+
end
|
|
138
|
+
default = build_strategy(config.slug_default_strategy) || EditionSlug.new
|
|
139
|
+
registry.instance_variable_set(:@default, default)
|
|
140
|
+
registry
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def self.build_strategy(name)
|
|
144
|
+
case name.to_s
|
|
145
|
+
when "edition" then EditionSlug.new
|
|
146
|
+
when "version" then VersionSlug.new
|
|
147
|
+
when "internet-draft" then InternetDraftSlug.new
|
|
148
|
+
when "rfc" then RfcSlug.new
|
|
149
|
+
when "draft-suffix" then DraftSuffixSlug.new
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def self.default
|
|
154
|
+
registry = new
|
|
155
|
+
registry.register("ietf", InternetDraftSlug.new)
|
|
156
|
+
registry.register("ieee", DraftSuffixSlug.new)
|
|
157
|
+
registry.register("iho", VersionSlug.new)
|
|
158
|
+
registry.register("ogc", VersionSlug.new)
|
|
159
|
+
registry
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
begin
|
|
4
|
-
require
|
|
4
|
+
require "zip"
|
|
5
5
|
rescue LoadError
|
|
6
|
-
raise LoadError,
|
|
6
|
+
raise LoadError,
|
|
7
|
+
"The rubyzip gem is required for ZipPackager. Add `gem 'rubyzip'` to your Gemfile."
|
|
7
8
|
end
|
|
8
9
|
|
|
9
10
|
module Metanorma
|
|
10
11
|
module Release
|
|
12
|
+
Artifact = Struct.new(:zip_path, :asset_name, :size, keyword_init: true)
|
|
13
|
+
|
|
11
14
|
class ZipPackager
|
|
12
15
|
include Packager
|
|
13
16
|
|
|
14
|
-
def
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
def initialize(output_dir: nil)
|
|
18
|
+
@output_dir = output_dir
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def package(publication, canonical_base:)
|
|
22
|
+
dir = @output_dir || derive_dir(publication)
|
|
23
|
+
slug = publication.slug
|
|
24
|
+
|
|
25
|
+
files = Dir.glob(File.join(dir, "**", "#{slug}.*")).reject do |f|
|
|
26
|
+
File.directory?(f)
|
|
27
|
+
end
|
|
28
|
+
if files.empty?
|
|
29
|
+
identifier = File.basename(publication.identifier.to_s)
|
|
30
|
+
files = Dir.glob(File.join(dir, "**",
|
|
31
|
+
"#{identifier}.*")).reject do |f|
|
|
32
|
+
File.directory?(f)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
18
35
|
|
|
19
36
|
zip_path = File.join(dir, "#{canonical_base}.zip")
|
|
20
|
-
|
|
37
|
+
FileUtils.rm_f(zip_path)
|
|
21
38
|
Zip::File.open(zip_path, Zip::File::CREATE) do |zipfile|
|
|
22
39
|
files.each do |file|
|
|
23
40
|
ext = File.extname(file)
|
|
@@ -29,9 +46,15 @@ module Metanorma
|
|
|
29
46
|
Artifact.new(
|
|
30
47
|
zip_path: zip_path,
|
|
31
48
|
asset_name: "#{canonical_base}.zip",
|
|
32
|
-
size: File.size(zip_path)
|
|
49
|
+
size: File.size(zip_path),
|
|
33
50
|
)
|
|
34
51
|
end
|
|
52
|
+
|
|
53
|
+
private
|
|
54
|
+
|
|
55
|
+
def derive_dir(publication)
|
|
56
|
+
publication.base_dir
|
|
57
|
+
end
|
|
35
58
|
end
|
|
36
59
|
end
|
|
37
60
|
end
|
data/lib/metanorma/release.rb
CHANGED
|
@@ -2,114 +2,88 @@
|
|
|
2
2
|
|
|
3
3
|
module Metanorma
|
|
4
4
|
module Release
|
|
5
|
-
require_relative
|
|
6
|
-
|
|
7
|
-
# Domain
|
|
8
|
-
autoload :
|
|
9
|
-
autoload :
|
|
10
|
-
autoload :
|
|
11
|
-
autoload :
|
|
12
|
-
autoload :
|
|
13
|
-
autoload :
|
|
14
|
-
autoload :
|
|
15
|
-
autoload :
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
autoload :
|
|
19
|
-
autoload :
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
autoload :
|
|
23
|
-
autoload :
|
|
24
|
-
autoload :
|
|
25
|
-
autoload :InternetDraftNaming, 'metanorma/release/naming_strategy'
|
|
26
|
-
autoload :RfcNaming, 'metanorma/release/naming_strategy'
|
|
27
|
-
autoload :DraftSuffixNaming, 'metanorma/release/naming_strategy'
|
|
28
|
-
autoload :NamingRegistry, 'metanorma/release/naming_strategy'
|
|
29
|
-
|
|
30
|
-
# Manifest & policy
|
|
31
|
-
autoload :ChannelManifest, 'metanorma/release/channel_manifest'
|
|
32
|
-
autoload :DocumentReleasePolicy, 'metanorma/release/channel_manifest'
|
|
33
|
-
autoload :ManifestEntry, 'metanorma/release/channel_manifest'
|
|
34
|
-
|
|
35
|
-
# Metadata
|
|
36
|
-
autoload :DocumentMetadata, 'metanorma/release/document_metadata'
|
|
37
|
-
autoload :ReleaseMetadata, 'metanorma/release/release_metadata'
|
|
38
|
-
autoload :RxlExtractor, 'metanorma/release/rxl_extractor'
|
|
5
|
+
require_relative "release/version"
|
|
6
|
+
|
|
7
|
+
# Domain models
|
|
8
|
+
autoload :Publication, "metanorma/release/publication"
|
|
9
|
+
autoload :PublicationFile, "metanorma/release/publication"
|
|
10
|
+
autoload :PublicationSource, "metanorma/release/publication"
|
|
11
|
+
autoload :Index, "metanorma/release/index"
|
|
12
|
+
autoload :Site, "metanorma/release/site"
|
|
13
|
+
autoload :Channel, "metanorma/release/channel"
|
|
14
|
+
autoload :Config, "metanorma/release/config"
|
|
15
|
+
autoload :ContentHash, "metanorma/release/content_hash"
|
|
16
|
+
|
|
17
|
+
# Strategies
|
|
18
|
+
autoload :SlugStrategy, "metanorma/release/slug_strategy"
|
|
19
|
+
autoload :EditionSlug, "metanorma/release/slug_strategy"
|
|
20
|
+
autoload :VersionSlug, "metanorma/release/slug_strategy"
|
|
21
|
+
autoload :InternetDraftSlug, "metanorma/release/slug_strategy"
|
|
22
|
+
autoload :RfcSlug, "metanorma/release/slug_strategy"
|
|
23
|
+
autoload :DraftSuffixSlug, "metanorma/release/slug_strategy"
|
|
24
|
+
autoload :SlugRegistry, "metanorma/release/slug_strategy"
|
|
39
25
|
|
|
40
26
|
# Interfaces
|
|
41
|
-
autoload :
|
|
42
|
-
autoload :
|
|
43
|
-
autoload :
|
|
44
|
-
autoload :
|
|
45
|
-
autoload :
|
|
27
|
+
autoload :Filter, "metanorma/release/interfaces"
|
|
28
|
+
autoload :ChangeDetector, "metanorma/release/interfaces"
|
|
29
|
+
autoload :Packager, "metanorma/release/interfaces"
|
|
30
|
+
autoload :Publisher, "metanorma/release/interfaces"
|
|
31
|
+
autoload :RepoDiscoverer, "metanorma/release/interfaces"
|
|
32
|
+
autoload :ReleaseFetcher, "metanorma/release/interfaces"
|
|
33
|
+
autoload :ManifestReader, "metanorma/release/interfaces"
|
|
46
34
|
|
|
47
35
|
# Pipeline components
|
|
48
|
-
autoload :
|
|
49
|
-
autoload :
|
|
50
|
-
autoload :
|
|
51
|
-
autoload :
|
|
52
|
-
autoload :
|
|
53
|
-
autoload :
|
|
54
|
-
autoload :
|
|
55
|
-
|
|
36
|
+
autoload :RepoRef, "metanorma/release/repo_ref"
|
|
37
|
+
autoload :ChangeResult, "metanorma/release/change_detector"
|
|
38
|
+
autoload :Artifact, "metanorma/release/zip_packager"
|
|
39
|
+
autoload :PublishResult, "metanorma/release/release_pipeline"
|
|
40
|
+
autoload :ReleasedArtifact, "metanorma/release/release_pipeline"
|
|
41
|
+
autoload :ReleaseResult, "metanorma/release/release_pipeline"
|
|
42
|
+
autoload :FetchResult,
|
|
43
|
+
"metanorma/release/aggregation_pipeline"
|
|
44
|
+
autoload :RepoReport,
|
|
45
|
+
"metanorma/release/aggregation_pipeline"
|
|
46
|
+
autoload :RepoError,
|
|
47
|
+
"metanorma/release/aggregation_pipeline"
|
|
48
|
+
autoload :ContentHashChangeDetector, "metanorma/release/change_detector"
|
|
49
|
+
autoload :ZipPackager, "metanorma/release/zip_packager"
|
|
50
|
+
autoload :ReleasePipeline, "metanorma/release/release_pipeline"
|
|
51
|
+
autoload :AggregationPipeline,
|
|
52
|
+
"metanorma/release/aggregation_pipeline"
|
|
53
|
+
|
|
54
|
+
# Filters
|
|
55
|
+
autoload :MetadataFilter, "metanorma/release/channel_filter"
|
|
56
56
|
|
|
57
57
|
# Cache
|
|
58
|
-
autoload :CacheStore,
|
|
59
|
-
autoload :FileCacheStore,
|
|
60
|
-
autoload :NullCacheStore,
|
|
61
|
-
|
|
62
|
-
# Aggregation filters
|
|
63
|
-
autoload :ChannelFilter, 'metanorma/release/channel_filter'
|
|
64
|
-
autoload :ConfigFetcher, 'metanorma/release/config_fetcher'
|
|
65
|
-
autoload :StageFilter, 'metanorma/release/stage_filter'
|
|
66
|
-
autoload :DeltaState, 'metanorma/release/delta_state'
|
|
67
|
-
autoload :NullDeltaState, 'metanorma/release/delta_state'
|
|
68
|
-
|
|
69
|
-
# Document index
|
|
70
|
-
autoload :DocumentFile, 'metanorma/release/document_index'
|
|
71
|
-
autoload :DocumentSource, 'metanorma/release/document_index'
|
|
72
|
-
autoload :IndexParameters, 'metanorma/release/document_index'
|
|
73
|
-
autoload :IndexSummary, 'metanorma/release/document_index'
|
|
74
|
-
autoload :AggregatedDocument, 'metanorma/release/document_index'
|
|
75
|
-
autoload :DocumentIndex, 'metanorma/release/document_index'
|
|
58
|
+
autoload :CacheStore, "metanorma/release/cache_store"
|
|
59
|
+
autoload :FileCacheStore, "metanorma/release/cache_store"
|
|
60
|
+
autoload :NullCacheStore, "metanorma/release/cache_store"
|
|
76
61
|
|
|
77
62
|
# Asset processing
|
|
78
|
-
autoload :FileRouting,
|
|
79
|
-
autoload :ByDocument,
|
|
80
|
-
autoload :Flat,
|
|
81
|
-
autoload :ByFormat,
|
|
82
|
-
autoload :FileRoutingFactory,
|
|
83
|
-
autoload :AssetProcessor,
|
|
84
|
-
|
|
85
|
-
#
|
|
86
|
-
autoload :
|
|
87
|
-
autoload :
|
|
88
|
-
autoload :
|
|
89
|
-
autoload :FetchResult, 'metanorma/release/aggregation_interfaces'
|
|
90
|
-
autoload :RepoReport, 'metanorma/release/aggregation_interfaces'
|
|
91
|
-
autoload :RepoError, 'metanorma/release/aggregation_interfaces'
|
|
92
|
-
autoload :AggregationPipeline, 'metanorma/release/aggregation_pipeline'
|
|
63
|
+
autoload :FileRouting, "metanorma/release/file_routing"
|
|
64
|
+
autoload :ByDocument, "metanorma/release/file_routing"
|
|
65
|
+
autoload :Flat, "metanorma/release/file_routing"
|
|
66
|
+
autoload :ByFormat, "metanorma/release/file_routing"
|
|
67
|
+
autoload :FileRoutingFactory, "metanorma/release/file_routing"
|
|
68
|
+
autoload :AssetProcessor, "metanorma/release/asset_processor"
|
|
69
|
+
|
|
70
|
+
# Delta state
|
|
71
|
+
autoload :DeltaStateManager, "metanorma/release/delta_state"
|
|
72
|
+
autoload :DeltaState, "metanorma/release/delta_state"
|
|
73
|
+
autoload :NullDeltaState, "metanorma/release/delta_state"
|
|
93
74
|
|
|
94
75
|
# Platform namespace
|
|
95
|
-
autoload :Platform,
|
|
76
|
+
autoload :Platform, "metanorma/release/platform"
|
|
96
77
|
|
|
97
78
|
# Platform factory
|
|
98
|
-
autoload :PlatformFactory,
|
|
79
|
+
autoload :PlatformFactory, "metanorma/release/platform_factory"
|
|
99
80
|
|
|
100
|
-
#
|
|
101
|
-
autoload :
|
|
102
|
-
|
|
103
|
-
# CLI & Rake
|
|
104
|
-
autoload :CLI, 'metanorma/release/cli'
|
|
105
|
-
autoload :RakeTasks, 'metanorma/release/rake_tasks'
|
|
81
|
+
# CLI
|
|
82
|
+
autoload :CLI, "metanorma/release/cli"
|
|
106
83
|
|
|
107
84
|
# Commands
|
|
108
|
-
autoload :PackageCommand,
|
|
109
|
-
autoload :
|
|
110
|
-
autoload :AggregateCommand,
|
|
111
|
-
|
|
112
|
-
# Config resolution
|
|
113
|
-
autoload :ConfigResolver, 'metanorma/release/config_resolver'
|
|
85
|
+
autoload :PackageCommand, "metanorma/release/commands/package"
|
|
86
|
+
autoload :ReleaseCommand, "metanorma/release/commands/release_command"
|
|
87
|
+
autoload :AggregateCommand, "metanorma/release/commands/aggregate"
|
|
114
88
|
end
|
|
115
89
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-release
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: relaton-bib
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '2.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: thor
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: rake
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,58 +86,40 @@ files:
|
|
|
72
86
|
- Rakefile
|
|
73
87
|
- exe/metanorma-release
|
|
74
88
|
- lib/metanorma/release.rb
|
|
75
|
-
- lib/metanorma/release/aggregation_interfaces.rb
|
|
76
89
|
- lib/metanorma/release/aggregation_pipeline.rb
|
|
77
90
|
- lib/metanorma/release/asset_processor.rb
|
|
78
91
|
- lib/metanorma/release/cache_store.rb
|
|
79
92
|
- lib/metanorma/release/change_detector.rb
|
|
80
93
|
- lib/metanorma/release/channel.rb
|
|
81
|
-
- lib/metanorma/release/channel_audience.rb
|
|
82
|
-
- lib/metanorma/release/channel_config.rb
|
|
83
94
|
- lib/metanorma/release/channel_filter.rb
|
|
84
|
-
- lib/metanorma/release/channel_manifest.rb
|
|
85
|
-
- lib/metanorma/release/channel_registry.rb
|
|
86
95
|
- lib/metanorma/release/cli.rb
|
|
87
96
|
- lib/metanorma/release/commands/aggregate.rb
|
|
88
97
|
- lib/metanorma/release/commands/package.rb
|
|
89
|
-
- lib/metanorma/release/commands/
|
|
90
|
-
- lib/metanorma/release/
|
|
91
|
-
- lib/metanorma/release/config_locator.rb
|
|
92
|
-
- lib/metanorma/release/config_resolver.rb
|
|
98
|
+
- lib/metanorma/release/commands/release_command.rb
|
|
99
|
+
- lib/metanorma/release/config.rb
|
|
93
100
|
- lib/metanorma/release/content_hash.rb
|
|
94
101
|
- lib/metanorma/release/delta_state.rb
|
|
95
|
-
- lib/metanorma/release/document_id.rb
|
|
96
|
-
- lib/metanorma/release/document_index.rb
|
|
97
|
-
- lib/metanorma/release/document_metadata.rb
|
|
98
|
-
- lib/metanorma/release/document_stage.rb
|
|
99
|
-
- lib/metanorma/release/document_type.rb
|
|
100
|
-
- lib/metanorma/release/document_version.rb
|
|
101
102
|
- lib/metanorma/release/file_routing.rb
|
|
103
|
+
- lib/metanorma/release/index.rb
|
|
102
104
|
- lib/metanorma/release/interfaces.rb
|
|
103
|
-
- lib/metanorma/release/naming_strategy.rb
|
|
104
105
|
- lib/metanorma/release/platform.rb
|
|
105
106
|
- lib/metanorma/release/platform/github.rb
|
|
106
|
-
- lib/metanorma/release/platform/github/config_fetcher.rb
|
|
107
107
|
- lib/metanorma/release/platform/github/manifest_reader.rb
|
|
108
108
|
- lib/metanorma/release/platform/github/publisher.rb
|
|
109
109
|
- lib/metanorma/release/platform/github/release_fetcher.rb
|
|
110
110
|
- lib/metanorma/release/platform/github/topic_discoverer.rb
|
|
111
111
|
- lib/metanorma/release/platform/local.rb
|
|
112
|
-
- lib/metanorma/release/platform/local/config_fetcher.rb
|
|
113
112
|
- lib/metanorma/release/platform/local/directory_discoverer.rb
|
|
114
113
|
- lib/metanorma/release/platform/local/fetcher.rb
|
|
115
114
|
- lib/metanorma/release/platform/local/publisher.rb
|
|
116
115
|
- lib/metanorma/release/platform/null.rb
|
|
117
116
|
- lib/metanorma/release/platform/null/publisher.rb
|
|
118
117
|
- lib/metanorma/release/platform_factory.rb
|
|
119
|
-
- lib/metanorma/release/
|
|
120
|
-
- lib/metanorma/release/relaton_enricher.rb
|
|
121
|
-
- lib/metanorma/release/release_metadata.rb
|
|
118
|
+
- lib/metanorma/release/publication.rb
|
|
122
119
|
- lib/metanorma/release/release_pipeline.rb
|
|
123
|
-
- lib/metanorma/release/release_tag.rb
|
|
124
120
|
- lib/metanorma/release/repo_ref.rb
|
|
125
|
-
- lib/metanorma/release/
|
|
126
|
-
- lib/metanorma/release/
|
|
121
|
+
- lib/metanorma/release/site.rb
|
|
122
|
+
- lib/metanorma/release/slug_strategy.rb
|
|
127
123
|
- lib/metanorma/release/version.rb
|
|
128
124
|
- lib/metanorma/release/zip_packager.rb
|
|
129
125
|
homepage: https://github.com/metanorma/metanorma-release
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Release
|
|
5
|
-
module RepoDiscoverer
|
|
6
|
-
def discover
|
|
7
|
-
raise NotImplementedError, "#{self.class} must implement #discover"
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
module ReleaseFetcher
|
|
12
|
-
def fetch(repo, etag: nil)
|
|
13
|
-
raise NotImplementedError, "#{self.class} must implement #fetch"
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
module ManifestReader
|
|
18
|
-
def read(repo)
|
|
19
|
-
raise NotImplementedError, "#{self.class} must implement #read"
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
FetchResult = Struct.new(:releases, :etag, :unchanged?, keyword_init: true)
|
|
24
|
-
RepoReport = Struct.new(:releases, :included, :skipped, :reason, :errors, keyword_init: true)
|
|
25
|
-
RepoError = Struct.new(:tag, :message, keyword_init: true)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Release
|
|
5
|
-
module ChannelAudience
|
|
6
|
-
PUBLIC = 'public'
|
|
7
|
-
MEMBERS = 'members'
|
|
8
|
-
INTERNAL = 'internal'
|
|
9
|
-
|
|
10
|
-
ALL = [PUBLIC, MEMBERS, INTERNAL].freeze
|
|
11
|
-
|
|
12
|
-
def self.values
|
|
13
|
-
ALL
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def self.from_string(raw)
|
|
17
|
-
normalized = raw.to_s.downcase.strip
|
|
18
|
-
return normalized if ALL.include?(normalized)
|
|
19
|
-
|
|
20
|
-
raise ArgumentError, "Unknown audience: #{raw.inspect}. Expected one of: #{ALL.join(', ')}"
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|