expressir 2.1.22 → 2.1.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fab262d4a8c290f1dc292ff8ea22e9f631356945fb76bed736594dad060078b0
4
- data.tar.gz: 45e33a9920262038833f1f00113b12527eb9dc64a71d29d8e0b5f36bd89842ff
3
+ metadata.gz: b862b81010dd9fcdfe17e323db319206a7cae0ee23bbc2f5fa67f2425902c45f
4
+ data.tar.gz: 1e18551038a0e7a0577e7017ca6404c6e0a6424473b969f2ed8d18469ee516fb
5
5
  SHA512:
6
- metadata.gz: 3bbc6a59dc02947a9c2ed5971900094ce183a4bbe0bdc4e3e762906d8d0675bc5c3ed145c37f17a406c406db783d4dcac1055938cdef2f54382bf1647bd57a61
7
- data.tar.gz: ae2c40bc87334138a4ce2cbfdc04bf699da520f62483bf9a8760117ba00b7d45dde639e0c292b5cdb8a285c1d01bd59aef4f5bf70f976ded713c1d7fb4ec5a61
6
+ metadata.gz: eb30354610152c62957729f35389ce727a58e1867701bd22728333459ff291851befa809ba3c7165d6da658a85a31f88603d7a48492c1a6bd5845b2a6df10c68
7
+ data.tar.gz: eb5a9690942e44db8fd304c77efa967e57919b2b5b25149b65abb3c870b6adb5667b94fa8e87ec3d78aab59a5dbf1006350054e5728fbe17e8372a196444bc26
data/.rubocop.yml CHANGED
@@ -1,14 +1,14 @@
1
- require:
2
- - rubocop-performance
3
-
4
1
  inherit_from:
5
2
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
3
  - .rubocop_todo.yml
7
4
 
8
- Naming/VariableName:
9
- Exclude:
10
- - lib/expressir/express/visitor.rb
11
- Layout/LineLength:
12
- Max: 160
5
+ plugins:
6
+ - rubocop-performance
7
+ - rubocop-rake
8
+ - rubocop-rspec
9
+
13
10
  AllCops:
14
- TargetRubyVersion: 2.7
11
+ TargetRubyVersion: 3.0
12
+ NewCops: enable
13
+ Exclude:
14
+ - 'vendor/**/*'
data/.rubocop_todo.yml CHANGED
@@ -1,43 +1,17 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-06-07 07:39:56 UTC using RuboCop version 1.75.2.
3
+ # on 2025-07-04 10:39:56 UTC using RuboCop version 1.77.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- # Configuration parameters: Severity, Include.
11
- # Include: **/*.gemspec
12
- Gemspec/RequiredRubyVersion:
13
- Exclude:
14
- - 'expressir.gemspec'
15
-
16
- # Offense count: 2
17
- # This cop supports safe autocorrection (--autocorrect).
18
- # Configuration parameters: EnforcedStyle, IndentationWidth.
19
- # SupportedStyles: special_inside_parentheses, consistent, align_braces
20
- Layout/FirstHashElementIndentation:
21
- Exclude:
22
- - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
23
-
24
- # Offense count: 1
25
- # This cop supports safe autocorrection (--autocorrect).
26
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
27
- # SupportedHashRocketStyles: key, separator, table
28
- # SupportedColonStyles: key, separator, table
29
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
30
- Layout/HashAlignment:
31
- Exclude:
32
- - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
33
-
34
- # Offense count: 2
9
+ # Offense count: 550
35
10
  # This cop supports safe autocorrection (--autocorrect).
36
- # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
11
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
37
12
  # URISchemes: http, https
38
13
  Layout/LineLength:
39
- Exclude:
40
- - 'lib/expressir/express/parser.rb'
14
+ Enabled: false
41
15
 
42
16
  # Offense count: 1
43
17
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
@@ -45,11 +19,6 @@ Lint/DuplicateBranch:
45
19
  Exclude:
46
20
  - 'lib/expressir/coverage.rb'
47
21
 
48
- # Offense count: 3
49
- Lint/ShadowingOuterLocalVariable:
50
- Exclude:
51
- - 'lib/expressir/express/visitor.rb'
52
-
53
22
  # Offense count: 2
54
23
  # This cop supports safe autocorrection (--autocorrect).
55
24
  # Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
@@ -78,13 +47,13 @@ Metrics/AbcSize:
78
47
  - 'lib/expressir/model/declarations/schema.rb'
79
48
  - 'lib/expressir/model/model_element.rb'
80
49
 
81
- # Offense count: 2
82
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
50
+ # Offense count: 1
51
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
83
52
  # AllowedMethods: refine
84
53
  Metrics/BlockLength:
85
- Max: 143
54
+ Max: 46
86
55
 
87
- # Offense count: 57
56
+ # Offense count: 56
88
57
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
89
58
  Metrics/CyclomaticComplexity:
90
59
  Exclude:
@@ -99,12 +68,12 @@ Metrics/CyclomaticComplexity:
99
68
  - 'lib/expressir/model/model_element.rb'
100
69
  - 'spec/support/model_element_helper.rb'
101
70
 
102
- # Offense count: 103
71
+ # Offense count: 105
103
72
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
104
73
  Metrics/MethodLength:
105
- Max: 82
74
+ Max: 106
106
75
 
107
- # Offense count: 45
76
+ # Offense count: 44
108
77
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
109
78
  Metrics/PerceivedComplexity:
110
79
  Exclude:
@@ -116,39 +85,68 @@ Metrics/PerceivedComplexity:
116
85
  - 'lib/expressir/model/declarations/schema.rb'
117
86
  - 'lib/expressir/model/model_element.rb'
118
87
 
119
- # Offense count: 1
120
- # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
121
- # NamePrefix: is_, has_, have_, does_
122
- # ForbiddenPrefixes: is_, has_, have_, does_
123
- # AllowedMethods: is_a?
124
- # MethodDefinitionMacros: define_method, define_singleton_method
125
- Naming/PredicateName:
88
+ # Offense count: 135
89
+ # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
90
+ # SupportedStyles: snake_case, camelCase
91
+ Naming/VariableName:
126
92
  Exclude:
127
- - 'spec/**/*'
128
- - 'lib/expressir/coverage.rb'
93
+ - 'lib/expressir/express/visitor.rb'
129
94
 
130
95
  # Offense count: 5
131
96
  Performance/FixedSize:
132
97
  Exclude:
133
98
  - 'lib/expressir/express/formatter.rb'
134
99
 
135
- # Offense count: 1
136
- Style/MissingRespondToMissing:
100
+ # Offense count: 6
101
+ Performance/MapMethodChain:
137
102
  Exclude:
138
- - 'lib/expressir/express/visitor.rb'
103
+ - 'lib/expressir/commands/coverage.rb'
104
+ - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
105
+ - 'spec/expressir/coverage_spec.rb'
106
+
107
+ # Offense count: 102
108
+ # Configuration parameters: CountAsOne.
109
+ RSpec/ExampleLength:
110
+ Max: 123
111
+
112
+ # Offense count: 14
113
+ # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
114
+ RSpec/IndexedLet:
115
+ Exclude:
116
+ - 'spec/expressir/model/data_types/array_spec.rb'
117
+ - 'spec/expressir/model/data_types/bag_spec.rb'
118
+ - 'spec/expressir/model/data_types/binary_spec.rb'
119
+ - 'spec/expressir/model/data_types/real_spec.rb'
120
+ - 'spec/expressir/model/data_types/set_spec.rb'
121
+ - 'spec/expressir/model/data_types/string_spec.rb'
139
122
 
140
123
  # Offense count: 1
141
- # This cop supports safe autocorrection (--autocorrect).
142
- # Configuration parameters: EnforcedStyleForMultiline.
143
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
144
- Style/TrailingCommaInArrayLiteral:
124
+ RSpec/IteratedExpectation:
145
125
  Exclude:
146
- - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
126
+ - 'spec/expressir/schema_manifest_spec.rb'
127
+
128
+ # Offense count: 235
129
+ RSpec/MultipleExpectations:
130
+ Max: 114
131
+
132
+ # Offense count: 21
133
+ # Configuration parameters: AllowSubject.
134
+ RSpec/MultipleMemoizedHelpers:
135
+ Max: 13
136
+
137
+ # Offense count: 5
138
+ RSpec/PendingWithoutReason:
139
+ Exclude:
140
+ - 'spec/expressir/model/declarations/remark_item_spec.rb'
141
+ - 'spec/expressir/model/declarations/rule_spec.rb'
142
+ - 'spec/expressir/model/declarations/schema_spec.rb'
143
+
144
+ # Offense count: 2
145
+ RSpec/RepeatedExample:
146
+ Exclude:
147
+ - 'spec/expressir/model/data_types/logical_spec.rb'
147
148
 
148
149
  # Offense count: 1
149
- # This cop supports safe autocorrection (--autocorrect).
150
- # Configuration parameters: EnforcedStyleForMultiline.
151
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
152
- Style/TrailingCommaInHashLiteral:
150
+ Style/MissingRespondToMissing:
153
151
  Exclude:
154
- - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
152
+ - 'lib/expressir/express/visitor.rb'
data/Gemfile CHANGED
@@ -10,6 +10,6 @@ gem "rake"
10
10
  gem "rspec"
11
11
  gem "rubocop"
12
12
  gem "rubocop-performance"
13
- gem "rubocop-rake", require: false
14
- gem "rubocop-rspec", require: false
13
+ gem "rubocop-rake"
14
+ gem "rubocop-rspec"
15
15
  gem "yard"
data/README.adoc CHANGED
@@ -178,17 +178,17 @@ expressir benchmark schemas/resources/action_schema/action_schema.exp --ips
178
178
  expressir benchmark schemas/resources/action_schema/action_schema.exp --format json
179
179
  ----
180
180
 
181
- ==== Benchmark multiple files from YAML
181
+ ==== Benchmark multiple files from schema manifest
182
182
 
183
- Create a YAML file with a list of schema paths:
183
+ Create a schema manifest YAML file with a list of schema paths:
184
184
 
185
185
  .schemas.yml
186
186
  [source, yaml]
187
187
  ----
188
188
  schemas:
189
- - schemas/resources/action_schema/action_schema.exp
190
- - schemas/resources/approval_schema/approval_schema.exp
191
- - schemas/resources/date_time_schema/date_time_schema.exp
189
+ - path: schemas/resources/action_schema/action_schema.exp
190
+ - path: schemas/resources/approval_schema/approval_schema.exp
191
+ - path: schemas/resources/date_time_schema/date_time_schema.exp
192
192
  ----
193
193
 
194
194
  Then benchmark all schemas at once:
@@ -865,6 +865,203 @@ all_entities = Expressir::Coverage.find_entities(schema)
865
865
  puts "Found #{all_entities.size} entities in schema #{schema.id}"
866
866
  ----
867
867
 
868
+ === EXPRESS schema manifest
869
+
870
+ ==== General
871
+
872
+ The EXPRESS schema manifest is a file format defined by ELF at
873
+ https://www.expresslang.org/docs[EXPRESS schema manifest specification].
874
+
875
+ Expressir provides a `SchemaManifest` class for managing collections of EXPRESS
876
+ schema files. This is particularly useful when working with multiple related
877
+ schemas or when you need to organize schema files in a structured way.
878
+
879
+ The `SchemaManifest` class allows you to:
880
+
881
+ * Load schema file lists from YAML manifest files
882
+ * Manage schema metadata and paths
883
+ * Programmatically create and manipulate schema collections
884
+ * Save manifest configurations to files
885
+
886
+
887
+ [example]
888
+ .Example project structure with schema manifest:
889
+ ====
890
+ [source]
891
+ ----
892
+ project/
893
+ ├── schemas.yml # Schema manifest
894
+ └── schemas/
895
+ ├── core/
896
+ │ ├── action_schema.exp
897
+ │ └── approval_schema.exp
898
+ └── extensions/
899
+ └── date_time_schema.exp
900
+ ----
901
+
902
+ .schemas.yml
903
+ [source,yaml]
904
+ ----
905
+ schemas:
906
+ - path: schemas/core/action_schema.exp
907
+ id: action_schema
908
+ - path: schemas/core/approval_schema.exp
909
+ id: approval_schema
910
+ - path: schemas/extensions/date_time_schema.exp
911
+ id: date_time_schema
912
+ ----
913
+ ====
914
+
915
+ ==== Creating a schema manifest
916
+
917
+ ===== From a YAML file
918
+
919
+ Load an existing schema manifest from a YAML file:
920
+
921
+ [source,ruby]
922
+ ----
923
+ # Load manifest from file
924
+ manifest = Expressir::SchemaManifest.from_file("schemas.yml")
925
+
926
+ # Access schema entries
927
+ manifest.schemas.each do |schema_entry|
928
+ puts "Schema path: #{schema_entry.path}"
929
+ puts "Schema ID: #{schema_entry.id}" if schema_entry.id
930
+ end
931
+
932
+ # Get all schema file paths
933
+ schema_paths = manifest.schemas.map(&:path)
934
+ ----
935
+
936
+ ===== Programmatically
937
+
938
+ Create a new schema manifest programmatically:
939
+
940
+ [source,ruby]
941
+ ----
942
+ # Create an empty manifest
943
+ manifest = Expressir::SchemaManifest.new
944
+
945
+ # Add schema entries
946
+ manifest.schemas << Expressir::SchemaManifestEntry.new(
947
+ path: "schemas/action_schema.exp",
948
+ id: "action_schema"
949
+ )
950
+
951
+ manifest.schemas << Expressir::SchemaManifestEntry.new(
952
+ path: "schemas/approval_schema.exp"
953
+ )
954
+
955
+ # Set base path for the manifest
956
+ manifest.base_path = "/path/to/schemas"
957
+ ----
958
+
959
+ ==== Schema manifest YAML format
960
+
961
+ The schema manifest uses a structured YAML format:
962
+
963
+ [source,yaml]
964
+ ----
965
+ schemas:
966
+ - path: schemas/resources/action_schema/action_schema.exp
967
+ id: action_schema
968
+ - path: schemas/resources/approval_schema/approval_schema.exp
969
+ id: approval_schema
970
+ - path: schemas/resources/date_time_schema/date_time_schema.exp
971
+ ----
972
+
973
+ ===== Schema entry attributes
974
+
975
+ Each schema entry in the manifest can have the following attributes:
976
+
977
+ `path`:: (Required) The file path to the EXPRESS schema file
978
+ `id`:: (Optional) A unique identifier for the schema
979
+ `container_path`:: (Optional) Container path information
980
+
981
+
982
+ ==== Working with schema manifests
983
+
984
+ ===== Saving manifests
985
+
986
+ Save a manifest to a file:
987
+
988
+ [source,ruby]
989
+ ----
990
+ # Save to a specific file
991
+ manifest.to_file("output_schemas.yml")
992
+
993
+ # Save to a path with automatic filename
994
+ manifest.save_to_path("/path/to/output/")
995
+ ----
996
+
997
+ ===== Concatenating manifests
998
+
999
+ Combine multiple manifests:
1000
+
1001
+ [source,ruby]
1002
+ ----
1003
+ manifest1 = Expressir::SchemaManifest.from_file("schemas1.yml")
1004
+ manifest2 = Expressir::SchemaManifest.from_file("schemas2.yml")
1005
+
1006
+ # Concatenate manifests
1007
+ combined_manifest = manifest1.concat(manifest2)
1008
+
1009
+ # Or use the + operator
1010
+ combined_manifest = manifest1 + manifest2
1011
+ ----
1012
+
1013
+ ===== Using manifests with parsers
1014
+
1015
+ Parse all schemas from a manifest:
1016
+
1017
+ [source,ruby]
1018
+ ----
1019
+ # Load manifest
1020
+ manifest = Expressir::SchemaManifest.from_file("schemas.yml")
1021
+
1022
+ # Get schema file paths
1023
+ schema_paths = manifest.schemas.map(&:path)
1024
+
1025
+ # Parse all schemas
1026
+ repository = Expressir::Express::Parser.from_files(schema_paths)
1027
+
1028
+ # With progress tracking
1029
+ repository = Expressir::Express::Parser.from_files(schema_paths) do |filename, schemas, error|
1030
+ if error
1031
+ puts "Error loading #{filename}: #{error.message}"
1032
+ else
1033
+ puts "Successfully loaded #{schemas.length} schemas from #{filename}"
1034
+ end
1035
+ end
1036
+ ----
1037
+
1038
+ ==== Integration with CLI commands
1039
+
1040
+ Schema manifests are supported by several CLI commands:
1041
+
1042
+ ===== Benchmarking with manifests
1043
+
1044
+ [source,sh]
1045
+ ----
1046
+ # Benchmark all schemas in a manifest
1047
+ expressir benchmark schemas.yml --verbose
1048
+
1049
+ # Benchmark with caching
1050
+ expressir benchmark-cache schemas.yml --cache_path /tmp/cache.bin
1051
+ ----
1052
+
1053
+ ===== Coverage analysis with manifests
1054
+
1055
+ [source,sh]
1056
+ ----
1057
+ # Analyze coverage for all schemas in manifest
1058
+ expressir coverage schemas.yml
1059
+
1060
+ # With output format and exclusions
1061
+ expressir coverage schemas.yml --format json --exclude=TYPE:SELECT
1062
+ ----
1063
+
1064
+
868
1065
 
869
1066
  == Contributing
870
1067
 
data/bin/rspec CHANGED
@@ -15,7 +15,8 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
15
15
  bundle_binstub = File.expand_path("bundle", __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
- if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
18
+ if File.read(bundle_binstub,
19
+ 300).include?("This file was generated by Bundler")
19
20
  load(bundle_binstub)
20
21
  else
21
22
  abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
@@ -249,7 +249,7 @@ Attributes:
249
249
  `attributes`:: Array of AttributeDrop objects
250
250
  `unique_rules`:: Array of UniqueRuleDrop objects
251
251
  `where_rules`:: Array of WhereRuleDrop objects
252
- `informal_propositions`:: Array of RemarkItemDrop objects
252
+ `informal_propositions`:: Array of InformalPropositionRule objects
253
253
 
254
254
  ==== FunctionDrop
255
255
 
data/expressir.gemspec CHANGED
@@ -31,8 +31,6 @@ Gem::Specification.new do |spec|
31
31
  end
32
32
  end
33
33
 
34
- spec.test_files = `git ls-files -- {spec}/*`.split("\n")
35
-
36
34
  spec.add_dependency "base64"
37
35
  spec.add_dependency "benchmark-ips"
38
36
  spec.add_dependency "csv"
@@ -146,7 +146,8 @@ module Expressir
146
146
 
147
147
  # Measure cache reading time
148
148
  cache_read_time = ::Benchmark.measure do
149
- results[:cached_repository] = Expressir::Express::Cache.from_file(cache_path)
149
+ results[:cached_repository] =
150
+ Expressir::Express::Cache.from_file(cache_path)
150
151
  end
151
152
  results[:cache_read_time] = cache_read_time.real
152
153
 
@@ -287,8 +288,10 @@ module Expressir
287
288
  }
288
289
  puts JSON.generate(result)
289
290
  when "csv"
290
- headers = ["Files", "Schemas", "Objects", "Total Time (s)", "Avg Time (s)", "Objects/s"]
291
- values = [count, schema_count, total_objects, total_time.round(4), avg_time.round(4), objects_per_second]
291
+ headers = ["Files", "Schemas", "Objects", "Total Time (s)",
292
+ "Avg Time (s)", "Objects/s"]
293
+ values = [count, schema_count, total_objects, total_time.round(4),
294
+ avg_time.round(4), objects_per_second]
292
295
 
293
296
  puts headers.join(",")
294
297
  puts values.join(",")
data/lib/expressir/cli.rb CHANGED
@@ -24,26 +24,33 @@ module Expressir
24
24
  end
25
25
 
26
26
  desc "clean PATH", "Strip remarks and prettify EXPRESS schema at PATH"
27
- method_option :output, type: :string, desc: "Output file path (defaults to stdout)"
27
+ method_option :output, type: :string,
28
+ desc: "Output file path (defaults to stdout)"
28
29
  def clean(path)
29
30
  Commands::Clean.new(options).run(path)
30
31
  end
31
32
 
32
- desc "benchmark FILE_OR_YAML", "Benchmark schema loading performance for a file or list of files from YAML"
33
- method_option :ips, type: :boolean, desc: "Use benchmark-ips for detailed statistics"
33
+ desc "benchmark FILE_OR_YAML",
34
+ "Benchmark schema loading performance for a file or list of files from YAML"
35
+ method_option :ips, type: :boolean,
36
+ desc: "Use benchmark-ips for detailed statistics"
34
37
  method_option :verbose, type: :boolean, desc: "Show verbose output"
35
38
  method_option :save, type: :boolean, desc: "Save benchmark results to file"
36
- method_option :format, type: :string, desc: "Output format (json, csv, default)"
39
+ method_option :format, type: :string,
40
+ desc: "Output format (json, csv, default)"
37
41
  def benchmark(path)
38
42
  Commands::Benchmark.new(options).run(path)
39
43
  end
40
44
 
41
45
  desc "benchmark-cache FILE_OR_YAML", "Benchmark schema loading with caching"
42
- method_option :ips, type: :boolean, desc: "Use benchmark-ips for detailed statistics"
46
+ method_option :ips, type: :boolean,
47
+ desc: "Use benchmark-ips for detailed statistics"
43
48
  method_option :verbose, type: :boolean, desc: "Show verbose output"
44
49
  method_option :save, type: :boolean, desc: "Save benchmark results to file"
45
- method_option :format, type: :string, desc: "Output format (json, csv, default)"
46
- method_option :cache_path, type: :string, desc: "Path to store the cache file"
50
+ method_option :format, type: :string,
51
+ desc: "Output format (json, csv, default)"
52
+ method_option :cache_path, type: :string,
53
+ desc: "Path to store the cache file"
47
54
  def benchmark_cache(path)
48
55
  Commands::BenchmarkCache.new(options).run(path)
49
56
  end
@@ -53,11 +60,16 @@ module Expressir
53
60
  Commands::Validate.new(options).run(paths)
54
61
  end
55
62
 
56
- desc "coverage *PATH", "List EXPRESS entities and check documentation coverage"
57
- method_option :format, type: :string, desc: "Output format (text, json, yaml)", default: "text"
58
- method_option :exclude, type: :string, desc: "Comma-separated list of EXPRESS entity types to skip from coverage (e.g., TYPE,CONSTANT,TYPE:SELECT)"
59
- method_option :output, type: :string, desc: "Output file path for JSON/YAML formats (defaults to coverage_report.json/yaml)"
60
- method_option :ignore_files, type: :string, desc: "Path to YAML file containing array of files to ignore from overall coverage calculation"
63
+ desc "coverage *PATH",
64
+ "List EXPRESS entities and check documentation coverage"
65
+ method_option :format, type: :string,
66
+ desc: "Output format (text, json, yaml)", default: "text"
67
+ method_option :exclude, type: :string,
68
+ desc: "Comma-separated list of EXPRESS entity types to skip from coverage (e.g., TYPE,CONSTANT,TYPE:SELECT)"
69
+ method_option :output, type: :string,
70
+ desc: "Output file path for JSON/YAML formats (defaults to coverage_report.json/yaml)"
71
+ method_option :ignore_files, type: :string,
72
+ desc: "Path to YAML file containing array of files to ignore from overall coverage calculation"
61
73
  def coverage(*paths)
62
74
  Commands::Coverage.new(options).run(paths)
63
75
  end
@@ -5,7 +5,7 @@ module Expressir
5
5
  configure_benchmarking
6
6
 
7
7
  if [".yml", ".yaml"].include?(File.extname(path).downcase)
8
- benchmark_from_yaml(path)
8
+ benchmark_from_manifest(path)
9
9
  else
10
10
  benchmark_file(path)
11
11
  end
@@ -36,24 +36,15 @@ module Expressir
36
36
  end
37
37
  end
38
38
 
39
- def benchmark_from_yaml(yaml_path)
40
- say "Express Schema Loading Benchmark from YAML"
39
+ def benchmark_from_manifest(manifest_path)
40
+ say "Express Schema Loading Benchmark from Manifest"
41
41
  say "--------------------------------"
42
42
 
43
- # Load schema list from YAML
44
- schema_list = YAML.load_file(yaml_path)
45
- if schema_list.is_a?(Hash) && schema_list["schemas"]
46
- # Handle format: { "schemas": ["path1", "path2", ...] }
47
- schema_files = schema_list["schemas"]
48
- elsif schema_list.is_a?(Array)
49
- # Handle format: ["path1", "path2", ...]
50
- schema_files = schema_list
51
- else
52
- say "Invalid YAML format. Expected an array of schema paths or a hash with a 'schemas' key."
53
- return
54
- end
43
+ # Load schema manifest
44
+ manifest = Expressir::SchemaManifest.from_file(manifest_path)
45
+ schema_files = manifest.schemas.map(&:path)
55
46
 
56
- say "YAML File: #{yaml_path}"
47
+ say "Manifest File: #{manifest_path}"
57
48
  say "Number of schemas in list: #{schema_files.size}"
58
49
  say "--------------------------------"
59
50
 
@@ -8,7 +8,7 @@ module Expressir
8
8
  cache_path = options[:cache_path] || generate_temp_cache_path
9
9
 
10
10
  if [".yml", ".yaml"].include?(File.extname(path).downcase)
11
- benchmark_cache_from_yaml(path, cache_path)
11
+ benchmark_cache_from_manifest(path, cache_path)
12
12
  else
13
13
  benchmark_cache_file(path, cache_path)
14
14
  end
@@ -32,7 +32,8 @@ module Expressir
32
32
  say "--------------------------------"
33
33
 
34
34
  # Benchmark with caching
35
- results = Expressir::Benchmark.measure_with_cache(path, cache_path) do |file|
35
+ results = Expressir::Benchmark.measure_with_cache(path,
36
+ cache_path) do |file|
36
37
  Expressir::Express::Parser.from_file(file)
37
38
  end
38
39
 
@@ -44,24 +45,15 @@ module Expressir
44
45
  end
45
46
  end
46
47
 
47
- def benchmark_cache_from_yaml(yaml_path, cache_path)
48
- say "Express Schema Loading Benchmark with Caching from YAML"
48
+ def benchmark_cache_from_manifest(manifest_path, cache_path)
49
+ say "Express Schema Loading Benchmark with Caching from Manifest"
49
50
  say "--------------------------------"
50
51
 
51
- # Load schema list from YAML
52
- schema_list = YAML.load_file(yaml_path)
53
- if schema_list.is_a?(Hash) && schema_list["schemas"]
54
- # Handle format: { "schemas": ["path1", "path2", ...] }
55
- schema_files = schema_list["schemas"]
56
- elsif schema_list.is_a?(Array)
57
- # Handle format: ["path1", "path2", ...]
58
- schema_files = schema_list
59
- else
60
- say "Invalid YAML format. Expected an array of schema paths or a hash with a 'schemas' key."
61
- return
62
- end
52
+ # Load schema manifest
53
+ manifest = Expressir::SchemaManifest.from_file(manifest_path)
54
+ schema_files = manifest.schemas.map(&:path)
63
55
 
64
- say "YAML File: #{yaml_path}"
56
+ say "Manifest File: #{manifest_path}"
65
57
  say "Number of schemas in list: #{schema_files.size}"
66
58
  say "Cache: #{cache_path}"
67
59
  say "--------------------------------"