suma 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +77 -0
- data/lib/suma/cli.rb +6 -4
- data/lib/suma/collection_manifest.rb +3 -3
- data/lib/suma/processor.rb +7 -41
- data/lib/suma/schema_attachment.rb +9 -8
- data/lib/suma/schema_collection.rb +7 -8
- data/lib/suma/schema_config/config.rb +36 -25
- data/lib/suma/schema_config/schema.rb +6 -0
- data/lib/suma/schema_document.rb +45 -9
- data/lib/suma/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3574bcc351316187d71e125e1ba19a8c3c275993b1a87d0c24cd050831507ca
|
4
|
+
data.tar.gz: cc8392459a664fcb6cf2202a8ebdc8346b2db0f4712e24e306cc2b805bd03c60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f83fdb2f934c410f4f434a98d49d46dc5a9d0ce619496a627c9803ed049e28a62b8a50c3c7eafddbbe2204f8486657927a5a2936a170292473ed939e6b5b471f
|
7
|
+
data.tar.gz: 7c2ed86bc187638f15957e53299b481563ae874e565bd8a92aedfb3cd30a5825dfb77a37122245132bc6feb9d869b67c8d023e0c6a51e29fd66dc069e6316a3d
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-10-17 02:50:55 UTC using RuboCop version 1.67.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 3
|
10
|
+
# Configuration parameters: Severity, Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/DuplicatedAssignment:
|
13
|
+
Exclude:
|
14
|
+
- 'suma.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Configuration parameters: Severity, Include.
|
18
|
+
# Include: **/*.gemspec
|
19
|
+
Gemspec/RequiredRubyVersion:
|
20
|
+
Exclude:
|
21
|
+
- 'suma.gemspec'
|
22
|
+
|
23
|
+
# Offense count: 21
|
24
|
+
# This cop supports safe autocorrection (--autocorrect).
|
25
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
26
|
+
# URISchemes: http, https
|
27
|
+
Layout/LineLength:
|
28
|
+
Exclude:
|
29
|
+
- 'lib/suma/cli.rb'
|
30
|
+
- 'lib/suma/collection_manifest.rb'
|
31
|
+
- 'lib/suma/processor.rb'
|
32
|
+
- 'lib/suma/schema_attachment.rb'
|
33
|
+
- 'lib/suma/schema_collection.rb'
|
34
|
+
- 'lib/suma/schema_document.rb'
|
35
|
+
- 'lib/suma/thor_ext.rb'
|
36
|
+
- 'suma.gemspec'
|
37
|
+
|
38
|
+
# Offense count: 1
|
39
|
+
Lint/DuplicateMethods:
|
40
|
+
Exclude:
|
41
|
+
- 'lib/suma/express_schema.rb'
|
42
|
+
|
43
|
+
# Offense count: 8
|
44
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
45
|
+
Metrics/AbcSize:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/suma/collection_manifest.rb'
|
48
|
+
- 'lib/suma/processor.rb'
|
49
|
+
- 'lib/suma/schema_attachment.rb'
|
50
|
+
- 'lib/suma/schema_collection.rb'
|
51
|
+
- 'lib/suma/schema_config/config.rb'
|
52
|
+
- 'lib/suma/schema_document.rb'
|
53
|
+
- 'lib/suma/thor_ext.rb'
|
54
|
+
|
55
|
+
# Offense count: 1
|
56
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
57
|
+
# AllowedMethods: refine
|
58
|
+
Metrics/BlockLength:
|
59
|
+
Max: 33
|
60
|
+
|
61
|
+
# Offense count: 2
|
62
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
63
|
+
Metrics/CyclomaticComplexity:
|
64
|
+
Exclude:
|
65
|
+
- 'lib/suma/collection_manifest.rb'
|
66
|
+
- 'lib/suma/thor_ext.rb'
|
67
|
+
|
68
|
+
# Offense count: 7
|
69
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
70
|
+
Metrics/MethodLength:
|
71
|
+
Max: 52
|
72
|
+
|
73
|
+
# Offense count: 1
|
74
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
75
|
+
Metrics/PerceivedComplexity:
|
76
|
+
Exclude:
|
77
|
+
- 'lib/suma/schema_collection.rb'
|
data/lib/suma/cli.rb
CHANGED
@@ -9,8 +9,10 @@ module Suma
|
|
9
9
|
class Cli < Thor
|
10
10
|
extend ThorExt::Start
|
11
11
|
|
12
|
-
desc "build METANORMA_SITE_MANIFEST",
|
13
|
-
|
12
|
+
desc "build METANORMA_SITE_MANIFEST",
|
13
|
+
"Build collection specified in site manifest (`metanorma*.yml`)"
|
14
|
+
option :compile, type: :boolean, default: true,
|
15
|
+
desc: "Compile or skip compile of collection"
|
14
16
|
option :schemas_all_path, type: :string, aliases: "-s",
|
15
17
|
desc: "Generate file that contains all schemas in the collection."
|
16
18
|
|
@@ -22,14 +24,14 @@ module Suma
|
|
22
24
|
|
23
25
|
# Set schemas_all_path to match metanorma_yaml_path
|
24
26
|
schemas_all_path = options[:schemas_all_path] ||
|
25
|
-
|
27
|
+
metanorma_site_manifest.gsub("metanorma", "schemas")
|
26
28
|
|
27
29
|
begin
|
28
30
|
Processor.run(
|
29
31
|
metanorma_yaml_path: metanorma_site_manifest,
|
30
32
|
schemas_all_path: schemas_all_path,
|
31
33
|
compile: options[:compile],
|
32
|
-
output_directory: "_site"
|
34
|
+
output_directory: "_site",
|
33
35
|
)
|
34
36
|
rescue StandardError => e
|
35
37
|
Utils.log "[ERROR] Error occurred during processing. See details below."
|
@@ -69,7 +69,7 @@ module Suma
|
|
69
69
|
|
70
70
|
# If there is collection.yml, this is a document collection, we process
|
71
71
|
# schemas.yaml.
|
72
|
-
if File.basename(file) ==
|
72
|
+
if File.basename(file) == "collection.yml"
|
73
73
|
schemas_yaml_path = File.join(File.dirname(file), "schemas.yaml")
|
74
74
|
if schemas_yaml_path && File.exist?(schemas_yaml_path)
|
75
75
|
@schema_config = Suma::SchemaConfig::Config.from_file(schemas_yaml_path)
|
@@ -99,8 +99,8 @@ module Suma
|
|
99
99
|
# we need to separate this file from the following new entries
|
100
100
|
added = CollectionManifest.new(
|
101
101
|
title: "Collection",
|
102
|
-
type:
|
103
|
-
identifier:
|
102
|
+
type: "collection",
|
103
|
+
identifier: "#{identifier}_",
|
104
104
|
)
|
105
105
|
|
106
106
|
added.entry = [
|
data/lib/suma/processor.rb
CHANGED
@@ -12,8 +12,8 @@ require "metanorma/collection/collection"
|
|
12
12
|
module Suma
|
13
13
|
class Processor
|
14
14
|
class << self
|
15
|
-
|
16
|
-
|
15
|
+
def run(metanorma_yaml_path:, schemas_all_path:, compile:,
|
16
|
+
output_directory: "_site")
|
17
17
|
Utils.log "Current directory: #{Dir.getwd}"
|
18
18
|
|
19
19
|
# This reads the metanorma.yml file
|
@@ -52,42 +52,6 @@ module Suma
|
|
52
52
|
collection_config.manifest.remove_schemas_only_sources
|
53
53
|
collection_config.to_file(new_collection_config_path)
|
54
54
|
|
55
|
-
# TODO: Do we still need this?
|
56
|
-
# Define Proc to resolve fileref
|
57
|
-
my_fileref_proc = proc do |ref_folder, fileref|
|
58
|
-
# move schemas to modified_schemas
|
59
|
-
if File.extname(fileref) == ".exp"
|
60
|
-
fileref.gsub!(
|
61
|
-
"../../schemas",
|
62
|
-
"modified_schemas"
|
63
|
-
)
|
64
|
-
end
|
65
|
-
File.join(ref_folder, fileref)
|
66
|
-
end
|
67
|
-
|
68
|
-
# TODO: Do we still need this?
|
69
|
-
# Define Proc to resolve identifier
|
70
|
-
my_identifier_proc = proc do |identifier|
|
71
|
-
case identifier
|
72
|
-
when %r{^documents/}
|
73
|
-
identifier.gsub("documents/", "")
|
74
|
-
else
|
75
|
-
identifier
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# TODO: Do we still need this?
|
80
|
-
# Define Proc to handle the compilation of express schemas
|
81
|
-
express_schemas_renderer = proc do |collection_model|
|
82
|
-
end
|
83
|
-
|
84
|
-
# TODO: Do we still need this?
|
85
|
-
Metanorma::Collection.tap do |mn|
|
86
|
-
mn.set_identifier_resolver(&my_identifier_proc)
|
87
|
-
mn.set_fileref_resolver(&my_fileref_proc)
|
88
|
-
mn.set_pre_parse_model(&express_schemas_renderer)
|
89
|
-
end
|
90
|
-
|
91
55
|
if compile
|
92
56
|
Utils.log "Compiling complete collection..."
|
93
57
|
|
@@ -105,9 +69,11 @@ module Suma
|
|
105
69
|
}
|
106
70
|
metanorma_collection.render(collection_opts)
|
107
71
|
|
108
|
-
#
|
109
|
-
Dir.glob(File.join(Dir.getwd, output_directory,
|
110
|
-
|
72
|
+
# TODO: Temporarily disable removal of XML files
|
73
|
+
Dir.glob(File.join(Dir.getwd, output_directory,
|
74
|
+
"*.xml")).each do |file|
|
75
|
+
puts "NOT DELETING ANY FILE #{file.inspect}"
|
76
|
+
# File.delete(file)
|
111
77
|
end
|
112
78
|
else
|
113
79
|
Utils.log "No compile option set. Skipping collection compilation."
|
@@ -55,7 +55,7 @@ module Suma
|
|
55
55
|
FileUtils.mkdir_p(File.dirname(filename_adoc))
|
56
56
|
|
57
57
|
relative_path = Pathname.new(filename_config)
|
58
|
-
|
58
|
+
.relative_path_from(Pathname.new(File.dirname(filename_adoc)))
|
59
59
|
|
60
60
|
# Utils.log "relative_path #{relative_path}"
|
61
61
|
|
@@ -68,13 +68,14 @@ module Suma
|
|
68
68
|
File.join(@output_path, "schema_#{@schema.id}.yaml")
|
69
69
|
end
|
70
70
|
|
71
|
-
def to_config
|
71
|
+
def to_config(path: nil)
|
72
72
|
# return @config unless @config
|
73
73
|
@config = SchemaConfig::Config.new
|
74
74
|
@config.schemas << SchemaConfig::Schema.new(
|
75
75
|
id: @schema.id,
|
76
|
-
path: @schema.path
|
76
|
+
path: @schema.path,
|
77
77
|
)
|
78
|
+
path and @config.path = path
|
78
79
|
|
79
80
|
@config
|
80
81
|
end
|
@@ -83,16 +84,16 @@ module Suma
|
|
83
84
|
relative_path = Pathname.new(filename_config).relative_path_from(Dir.pwd)
|
84
85
|
Utils.log "Save schema config: #{relative_path}"
|
85
86
|
|
87
|
+
# Still overwrite even if the file exists
|
86
88
|
# return if File.exist?(filename_config)
|
87
89
|
FileUtils.mkdir_p(File.dirname(filename_config))
|
88
90
|
|
89
|
-
|
90
|
-
file.write(to_config.to_yaml)
|
91
|
-
end
|
91
|
+
to_config.save_to_path(filename_config)
|
92
92
|
end
|
93
93
|
|
94
94
|
# Compile Metanorma adoc per EXPRESS schema
|
95
95
|
def compile
|
96
|
+
# TODO: Clean artifacts after compiling
|
96
97
|
# I am commenting out because I'm playing with the schemas-only status
|
97
98
|
# return self if File.exist?(output_xml_path)
|
98
99
|
|
@@ -104,7 +105,7 @@ module Suma
|
|
104
105
|
Metanorma::Compile.new.compile(
|
105
106
|
filename_adoc,
|
106
107
|
agree_to_terms: true,
|
107
|
-
install_fonts: false
|
108
|
+
install_fonts: false,
|
108
109
|
)
|
109
110
|
Utils.log "Compiling schema (id: #{id}, type: #{self.class}) => #{relative_path}... done!"
|
110
111
|
|
@@ -124,7 +125,7 @@ module Suma
|
|
124
125
|
filename_adoc,
|
125
126
|
filename_adoc("presentation.xml"),
|
126
127
|
filename_adoc("adoc.lutaml.log.txt"),
|
127
|
-
filename_adoc("err.html")
|
128
|
+
filename_adoc("err.html"),
|
128
129
|
].each do |filename|
|
129
130
|
FileUtils.rm_rf(filename)
|
130
131
|
end
|
@@ -9,9 +9,10 @@ require_relative "utils"
|
|
9
9
|
module Suma
|
10
10
|
class SchemaCollection
|
11
11
|
attr_accessor :config, :schemas, :docs, :output_path_docs, :output_path_schemas,
|
12
|
-
|
12
|
+
:manifest
|
13
13
|
|
14
|
-
def initialize(config: nil, config_yaml: nil, output_path_docs: nil,
|
14
|
+
def initialize(config: nil, config_yaml: nil, output_path_docs: nil,
|
15
|
+
output_path_schemas: nil, manifest: nil)
|
15
16
|
@schemas = {}
|
16
17
|
@docs = {}
|
17
18
|
@schema_name_to_docs = {}
|
@@ -44,12 +45,12 @@ module Suma
|
|
44
45
|
s = ExpressSchema.new(
|
45
46
|
id: config_schema.id,
|
46
47
|
path: config_schema.path.to_s,
|
47
|
-
output_path: @output_path_schemas.to_s
|
48
|
+
output_path: @output_path_schemas.to_s,
|
48
49
|
)
|
49
50
|
|
50
51
|
doc = klass.new(
|
51
52
|
schema: s,
|
52
|
-
output_path: @output_path_docs.join(s.id)
|
53
|
+
output_path: @output_path_docs.join(s.id),
|
53
54
|
)
|
54
55
|
|
55
56
|
@docs[s.id] = doc
|
@@ -74,13 +75,11 @@ module Suma
|
|
74
75
|
|
75
76
|
def compile
|
76
77
|
finalize
|
77
|
-
schemas.each_pair do |
|
78
|
+
schemas.each_pair do |_schema_id, entry|
|
78
79
|
entry.save_exp
|
79
80
|
end
|
80
81
|
|
81
|
-
|
82
|
-
# BELONG IN THE MAIN COLLECTION NOT HERE
|
83
|
-
docs.each_pair do |schema_id, entry|
|
82
|
+
docs.each_pair do |_schema_id, entry|
|
84
83
|
entry.compile
|
85
84
|
end
|
86
85
|
|
@@ -9,6 +9,7 @@ module Suma
|
|
9
9
|
class Config < Shale::Mapper
|
10
10
|
attribute :schemas, Schema, collection: true
|
11
11
|
attribute :path, Shale::Type::String
|
12
|
+
attr_accessor :output_path
|
12
13
|
|
13
14
|
def initialize(**args)
|
14
15
|
@path = path_relative_to_absolute(path) if path
|
@@ -39,6 +40,7 @@ module Suma
|
|
39
40
|
@path = path_relative_to_absolute(new_path)
|
40
41
|
schemas.each do |schema|
|
41
42
|
schema.path = path_relative_to_absolute(schema.path)
|
43
|
+
schema.container_path = File.expand_path(@path)
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
@@ -48,17 +50,25 @@ module Suma
|
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
51
|
-
# TODO: I can't get the relative path working. The schemas-*.yaml file is
|
52
|
-
# meant to contain the "path" key, which is a relative path to its
|
53
|
-
# location, then sets the base path to each schema path, which is supposed
|
54
|
-
# to be relative to "path" key. Somehow, the @path variable is always
|
55
|
-
# missing in to_yaml...
|
56
53
|
def schemas_to_yaml(model, doc)
|
57
|
-
# puts "^"*30
|
58
|
-
# pp self
|
59
|
-
# pp @path
|
60
54
|
doc["schemas"] = model.schemas.sort_by(&:id).to_h do |schema|
|
61
|
-
|
55
|
+
# We are outputting the schemas collection file to the directory where
|
56
|
+
# the collection config is at (assumed to be Dir.pwd), not to the
|
57
|
+
# directory we sourced the manifest from, e.g.
|
58
|
+
# documents/iso-10303-41/schemas.yaml.
|
59
|
+
|
60
|
+
# So the schema.container_path = @config.path is not
|
61
|
+
# in fact needed, as the files are already absolute. This notion of
|
62
|
+
# using @path to create relative paths was misconceived
|
63
|
+
[
|
64
|
+
schema.id,
|
65
|
+
{
|
66
|
+
"path" => path_absolute_to_relative(
|
67
|
+
schema.path,
|
68
|
+
model.output_path || Dir.pwd,
|
69
|
+
),
|
70
|
+
},
|
71
|
+
]
|
62
72
|
end
|
63
73
|
end
|
64
74
|
|
@@ -69,19 +79,18 @@ module Suma
|
|
69
79
|
# Or based on current working directory?
|
70
80
|
return relative_path unless @path
|
71
81
|
|
82
|
+
# ... but if this calculates path, we end up expanding it anyway
|
83
|
+
|
72
84
|
Pathname.new(File.dirname(@path)).join(eval_path).expand_path.to_s
|
73
85
|
end
|
74
86
|
|
75
|
-
def path_absolute_to_relative(absolute_path)
|
76
|
-
|
77
|
-
|
78
|
-
# pp path
|
79
|
-
# pp @hello
|
80
|
-
return absolute_path unless @path
|
87
|
+
def path_absolute_to_relative(absolute_path, container_path)
|
88
|
+
container_path ||= @path
|
89
|
+
return absolute_path unless container_path
|
81
90
|
|
82
|
-
|
83
|
-
|
84
|
-
|
91
|
+
p = Pathname.new(container_path)
|
92
|
+
container = p.directory? ? p.to_s : p.dirname
|
93
|
+
Pathname.new(absolute_path).relative_path_from(container).to_s
|
85
94
|
end
|
86
95
|
|
87
96
|
def update_path(new_path)
|
@@ -98,8 +107,8 @@ module Suma
|
|
98
107
|
next if schema_path.absolute?
|
99
108
|
|
100
109
|
schema_path = (Pathname.new(old_base_path) + schema_path).cleanpath
|
101
|
-
|
102
|
-
schema.path =
|
110
|
+
# This is the new relative schema_path
|
111
|
+
schema.path = schema_path.relative_path_from(new_base_path)
|
103
112
|
end
|
104
113
|
|
105
114
|
@path = new_path
|
@@ -107,7 +116,7 @@ module Suma
|
|
107
116
|
|
108
117
|
def concat(another_config)
|
109
118
|
unless another_config.is_a?(self.class)
|
110
|
-
raise StandardError, "Can only
|
119
|
+
raise StandardError, "Can only concat a SchemaConfig::Config object."
|
111
120
|
end
|
112
121
|
|
113
122
|
# We need to update the relative paths when paths exist
|
@@ -120,13 +129,15 @@ module Suma
|
|
120
129
|
end
|
121
130
|
|
122
131
|
def save_to_path(filename)
|
123
|
-
new_config = dup
|
124
|
-
|
125
|
-
|
132
|
+
new_config = dup.tap do |c|
|
133
|
+
c.path = filename
|
134
|
+
c.update_path(File.dirname(filename))
|
135
|
+
c.output_path = filename
|
136
|
+
end
|
126
137
|
|
127
138
|
File.open(filename, "w") do |f|
|
128
139
|
Utils.log "Writing #{filename}..."
|
129
|
-
f.write(to_yaml)
|
140
|
+
f.write(new_config.to_yaml)
|
130
141
|
Utils.log "Done."
|
131
142
|
end
|
132
143
|
end
|
@@ -8,6 +8,12 @@ module Suma
|
|
8
8
|
attribute :id, Shale::Type::String
|
9
9
|
attribute :path, Shale::Type::String
|
10
10
|
# attribute :schemas_only, Shale::Type::Boolean
|
11
|
+
|
12
|
+
# container_path is a copy of Suma::SchemaConfig::Config.path,
|
13
|
+
# used to resolve the path of each schema within
|
14
|
+
# Suma::SchemaConfig::Config.schemas,
|
15
|
+
# when Suma::SchemaConfig::Config.schemas is recursively flattened
|
16
|
+
attr_accessor :container_path
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
data/lib/suma/schema_document.rb
CHANGED
@@ -16,23 +16,23 @@ module Suma
|
|
16
16
|
|
17
17
|
// _constants.liquid
|
18
18
|
{% if schema.constants.size > 0 %}
|
19
|
-
#{bookmark(
|
19
|
+
#{bookmark('constants')}
|
20
20
|
{% for thing in schema.constants %}
|
21
|
-
#{bookmark(
|
21
|
+
#{bookmark('{{thing.id}}')}
|
22
22
|
{% endfor %}
|
23
23
|
{% endif %}
|
24
24
|
|
25
25
|
// _types.liquid
|
26
26
|
{% if schema.types.size > 0 %}
|
27
|
-
#{bookmark(
|
27
|
+
#{bookmark('types')}
|
28
28
|
// _type.liquid
|
29
29
|
{% for thing in schema.types %}
|
30
|
-
#{bookmark(
|
30
|
+
#{bookmark('{{thing.id}}')}
|
31
31
|
{% if thing.items.size > 0 %}
|
32
32
|
// _type_items.liquid
|
33
|
-
#{bookmark(
|
33
|
+
#{bookmark('{{thing.id}}.items')}
|
34
34
|
{% for item in thing.items %}
|
35
|
-
#{bookmark(
|
35
|
+
#{bookmark('{{thing.id}}.items.{{item.id}}')}
|
36
36
|
{% endfor %}
|
37
37
|
{% endif %}
|
38
38
|
{% endfor %}
|
@@ -40,10 +40,46 @@ module Suma
|
|
40
40
|
|
41
41
|
// _entities.liquid
|
42
42
|
{% if schema.entities.size > 0 %}
|
43
|
-
#{bookmark(
|
43
|
+
#{bookmark('entities')}
|
44
44
|
{% for thing in schema.entities %}
|
45
45
|
// _entity.liquid
|
46
|
-
#{bookmark(
|
46
|
+
#{bookmark('{{thing.id}}')}
|
47
|
+
{% endfor %}
|
48
|
+
{% endif %}
|
49
|
+
|
50
|
+
// _subtype_constraints.liquid
|
51
|
+
{% if schema.subtype_constraints.size > 0 %}
|
52
|
+
#{bookmark('subtype_constraints')}
|
53
|
+
// _subtype_constraint.liquid
|
54
|
+
{% for thing in schema.subtype_constraints %}
|
55
|
+
#{bookmark('{{thing.id}}')}
|
56
|
+
{% endfor %}
|
57
|
+
{% endif %}
|
58
|
+
|
59
|
+
// _functions.liquid
|
60
|
+
{% if schema.functions.size > 0 %}
|
61
|
+
#{bookmark('functions')}
|
62
|
+
// _function.liquid
|
63
|
+
{% for thing in schema.functions %}
|
64
|
+
#{bookmark('{{thing.id}}')}
|
65
|
+
{% endfor %}
|
66
|
+
{% endif %}
|
67
|
+
|
68
|
+
// _procedures.liquid
|
69
|
+
{% if schema.procedures.size > 0 %}
|
70
|
+
#{bookmark('procedures')}
|
71
|
+
// _procedure.liquid
|
72
|
+
{% for thing in schema.procedures %}
|
73
|
+
#{bookmark('{{thing.id}}')}
|
74
|
+
{% endfor %}
|
75
|
+
{% endif %}
|
76
|
+
|
77
|
+
// _rules.liquid
|
78
|
+
{% if schema.rules.size > 0 %}
|
79
|
+
#{bookmark('rules')}
|
80
|
+
// _rule.liquid
|
81
|
+
{% for thing in schema.rules %}
|
82
|
+
#{bookmark('{{thing.id}}')}
|
47
83
|
{% endfor %}
|
48
84
|
{% endif %}
|
49
85
|
HEREDOC
|
@@ -81,7 +117,7 @@ module Suma
|
|
81
117
|
|
82
118
|
[[#{@id}]]
|
83
119
|
[%unnumbered,type=express]
|
84
|
-
== #{@id} #{schema_anchors.gsub(%r{//[^\r\n]+},
|
120
|
+
== #{@id} #{schema_anchors.gsub(%r{//[^\r\n]+}, '').gsub(/[\n\r]+/, '').gsub(/^[\n\r]/, '')}
|
85
121
|
|
86
122
|
[source%unnumbered]
|
87
123
|
--
|
data/lib/suma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2024-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expressir
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- ".gitignore"
|
124
124
|
- ".rspec"
|
125
125
|
- ".rubocop.yml"
|
126
|
+
- ".rubocop_todo.yml"
|
126
127
|
- CODE_OF_CONDUCT.md
|
127
128
|
- Gemfile
|
128
129
|
- README.adoc
|