expressir 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -13
  3. data/.rubocop_todo.yml +78 -1
  4. data/Gemfile +1 -2
  5. data/README.adoc +46 -0
  6. data/exe/{format-test → expressir-format-test} +3 -2
  7. data/expressir.gemspec +3 -4
  8. data/lib/expressir/express/cache.rb +6 -6
  9. data/lib/expressir/express/formatter.rb +754 -741
  10. data/lib/expressir/express/hyperlink_formatter.rb +2 -2
  11. data/lib/expressir/express/model_visitor.rb +1 -1
  12. data/lib/expressir/express/parser.rb +224 -100
  13. data/lib/expressir/express/resolve_references_model_visitor.rb +6 -6
  14. data/lib/expressir/express/schema_head_formatter.rb +3 -3
  15. data/lib/expressir/express/visitor.rb +353 -344
  16. data/lib/expressir/liquid/cache_drop.rb +20 -0
  17. data/lib/expressir/liquid/data_type_drop.rb +8 -0
  18. data/lib/expressir/liquid/data_types/aggregate_drop.rb +21 -0
  19. data/lib/expressir/liquid/data_types/array_drop.rb +34 -0
  20. data/lib/expressir/liquid/data_types/bag_drop.rb +26 -0
  21. data/lib/expressir/liquid/data_types/binary_drop.rb +22 -0
  22. data/lib/expressir/liquid/data_types/boolean_drop.rb +10 -0
  23. data/lib/expressir/liquid/data_types/enumeration_drop.rb +30 -0
  24. data/lib/expressir/liquid/data_types/enumeration_item_drop.rb +17 -0
  25. data/lib/expressir/liquid/data_types/generic_drop.rb +17 -0
  26. data/lib/expressir/liquid/data_types/generic_entity_drop.rb +17 -0
  27. data/lib/expressir/liquid/data_types/integer_drop.rb +10 -0
  28. data/lib/expressir/liquid/data_types/list_drop.rb +30 -0
  29. data/lib/expressir/liquid/data_types/logical_drop.rb +10 -0
  30. data/lib/expressir/liquid/data_types/number_drop.rb +10 -0
  31. data/lib/expressir/liquid/data_types/real_drop.rb +18 -0
  32. data/lib/expressir/liquid/data_types/select_drop.rb +34 -0
  33. data/lib/expressir/liquid/data_types/set_drop.rb +26 -0
  34. data/lib/expressir/liquid/data_types/string_drop.rb +22 -0
  35. data/lib/expressir/liquid/declaration_drop.rb +8 -0
  36. data/lib/expressir/liquid/declarations/attribute_drop.rb +37 -0
  37. data/lib/expressir/liquid/declarations/constant_drop.rb +25 -0
  38. data/lib/expressir/liquid/declarations/entity_drop.rb +65 -0
  39. data/lib/expressir/liquid/declarations/function_drop.rb +93 -0
  40. data/lib/expressir/liquid/declarations/interface_drop.rb +30 -0
  41. data/lib/expressir/liquid/declarations/interface_item_drop.rb +22 -0
  42. data/lib/expressir/liquid/declarations/interfaced_item_drop.rb +34 -0
  43. data/lib/expressir/liquid/declarations/parameter_drop.rb +25 -0
  44. data/lib/expressir/liquid/declarations/procedure_drop.rb +89 -0
  45. data/lib/expressir/liquid/declarations/remark_item_drop.rb +22 -0
  46. data/lib/expressir/liquid/declarations/rule_drop.rb +105 -0
  47. data/lib/expressir/liquid/declarations/schema_drop.rb +91 -0
  48. data/lib/expressir/liquid/declarations/schema_version_drop.rb +26 -0
  49. data/lib/expressir/liquid/declarations/schema_version_item_drop.rb +22 -0
  50. data/lib/expressir/liquid/declarations/subtype_constraint_drop.rb +37 -0
  51. data/lib/expressir/liquid/declarations/type_drop.rb +37 -0
  52. data/lib/expressir/liquid/declarations/unique_rule_drop.rb +21 -0
  53. data/lib/expressir/liquid/declarations/variable_drop.rb +25 -0
  54. data/lib/expressir/liquid/declarations/where_rule_drop.rb +21 -0
  55. data/lib/expressir/liquid/expression_drop.rb +8 -0
  56. data/lib/expressir/liquid/expressions/aggregate_initializer_drop.rb +24 -0
  57. data/lib/expressir/liquid/expressions/aggregate_initializer_item_drop.rb +22 -0
  58. data/lib/expressir/liquid/expressions/binary_expression_drop.rb +26 -0
  59. data/lib/expressir/liquid/expressions/entity_constructor_drop.rb +26 -0
  60. data/lib/expressir/liquid/expressions/function_call_drop.rb +26 -0
  61. data/lib/expressir/liquid/expressions/interval_drop.rb +34 -0
  62. data/lib/expressir/liquid/expressions/query_expression_drop.rb +25 -0
  63. data/lib/expressir/liquid/expressions/unary_expression_drop.rb +22 -0
  64. data/lib/expressir/liquid/identifier_drop.rb +33 -0
  65. data/lib/expressir/liquid/literal_drop.rb +8 -0
  66. data/lib/expressir/liquid/literals/binary_drop.rb +18 -0
  67. data/lib/expressir/liquid/literals/integer_drop.rb +18 -0
  68. data/lib/expressir/liquid/literals/logical_drop.rb +18 -0
  69. data/lib/expressir/liquid/literals/real_drop.rb +18 -0
  70. data/lib/expressir/liquid/literals/string_drop.rb +22 -0
  71. data/lib/expressir/liquid/model_element_drop.rb +33 -0
  72. data/lib/expressir/liquid/reference_drop.rb +8 -0
  73. data/lib/expressir/liquid/references/attribute_reference_drop.rb +22 -0
  74. data/lib/expressir/liquid/references/group_reference_drop.rb +22 -0
  75. data/lib/expressir/liquid/references/index_reference_drop.rb +26 -0
  76. data/lib/expressir/liquid/references/simple_reference_drop.rb +22 -0
  77. data/lib/expressir/liquid/repository_drop.rb +22 -0
  78. data/lib/expressir/liquid/statement_drop.rb +8 -0
  79. data/lib/expressir/liquid/statements/alias_drop.rb +29 -0
  80. data/lib/expressir/liquid/statements/assignment_drop.rb +22 -0
  81. data/lib/expressir/liquid/statements/case_action_drop.rb +26 -0
  82. data/lib/expressir/liquid/statements/case_drop.rb +30 -0
  83. data/lib/expressir/liquid/statements/compound_drop.rb +22 -0
  84. data/lib/expressir/liquid/statements/escape_drop.rb +10 -0
  85. data/lib/expressir/liquid/statements/if_drop.rb +34 -0
  86. data/lib/expressir/liquid/statements/null_drop.rb +10 -0
  87. data/lib/expressir/liquid/statements/procedure_call_drop.rb +26 -0
  88. data/lib/expressir/liquid/statements/repeat_drop.rb +45 -0
  89. data/lib/expressir/liquid/statements/return_drop.rb +18 -0
  90. data/lib/expressir/liquid/statements/skip_drop.rb +10 -0
  91. data/lib/expressir/liquid/supertype_expression_drop.rb +8 -0
  92. data/lib/expressir/liquid/supertype_expressions/binary_supertype_expression_drop.rb +26 -0
  93. data/lib/expressir/liquid/supertype_expressions/oneof_supertype_expression_drop.rb +22 -0
  94. data/lib/expressir/liquid.rb +18 -0
  95. data/lib/expressir/model/cache.rb +3 -3
  96. data/lib/expressir/model/data_type.rb +1 -1
  97. data/lib/expressir/model/data_types/aggregate.rb +3 -3
  98. data/lib/expressir/model/data_types/array.rb +6 -6
  99. data/lib/expressir/model/data_types/bag.rb +4 -4
  100. data/lib/expressir/model/data_types/binary.rb +3 -3
  101. data/lib/expressir/model/data_types/boolean.rb +1 -1
  102. data/lib/expressir/model/data_types/enumeration.rb +4 -4
  103. data/lib/expressir/model/data_types/enumeration_item.rb +2 -2
  104. data/lib/expressir/model/data_types/generic.rb +2 -2
  105. data/lib/expressir/model/data_types/generic_entity.rb +2 -2
  106. data/lib/expressir/model/data_types/integer.rb +1 -1
  107. data/lib/expressir/model/data_types/list.rb +5 -5
  108. data/lib/expressir/model/data_types/logical.rb +1 -1
  109. data/lib/expressir/model/data_types/number.rb +1 -1
  110. data/lib/expressir/model/data_types/real.rb +2 -2
  111. data/lib/expressir/model/data_types/select.rb +5 -5
  112. data/lib/expressir/model/data_types/set.rb +4 -4
  113. data/lib/expressir/model/data_types/string.rb +3 -3
  114. data/lib/expressir/model/declaration.rb +1 -1
  115. data/lib/expressir/model/declarations/attribute.rb +7 -7
  116. data/lib/expressir/model/declarations/constant.rb +4 -4
  117. data/lib/expressir/model/declarations/entity.rb +9 -9
  118. data/lib/expressir/model/declarations/function.rb +13 -13
  119. data/lib/expressir/model/declarations/interface.rb +4 -4
  120. data/lib/expressir/model/declarations/interface_item.rb +3 -3
  121. data/lib/expressir/model/declarations/interfaced_item.rb +6 -6
  122. data/lib/expressir/model/declarations/parameter.rb +4 -4
  123. data/lib/expressir/model/declarations/procedure.rb +12 -12
  124. data/lib/expressir/model/declarations/remark_item.rb +3 -3
  125. data/lib/expressir/model/declarations/rule.rb +14 -14
  126. data/lib/expressir/model/declarations/schema.rb +18 -18
  127. data/lib/expressir/model/declarations/schema_version.rb +3 -3
  128. data/lib/expressir/model/declarations/schema_version_item.rb +3 -3
  129. data/lib/expressir/model/declarations/subtype_constraint.rb +6 -6
  130. data/lib/expressir/model/declarations/type.rb +5 -5
  131. data/lib/expressir/model/declarations/unique_rule.rb +3 -3
  132. data/lib/expressir/model/declarations/variable.rb +4 -4
  133. data/lib/expressir/model/declarations/where_rule.rb +3 -3
  134. data/lib/expressir/model/expression.rb +1 -1
  135. data/lib/expressir/model/expressions/aggregate_initializer.rb +2 -2
  136. data/lib/expressir/model/expressions/aggregate_initializer_item.rb +3 -3
  137. data/lib/expressir/model/expressions/binary_expression.rb +12 -5
  138. data/lib/expressir/model/expressions/entity_constructor.rb +3 -3
  139. data/lib/expressir/model/expressions/function_call.rb +3 -3
  140. data/lib/expressir/model/expressions/interval.rb +6 -6
  141. data/lib/expressir/model/expressions/query_expression.rb +4 -4
  142. data/lib/expressir/model/expressions/unary_expression.rb +3 -3
  143. data/lib/expressir/model/identifier.rb +5 -5
  144. data/lib/expressir/model/literal.rb +1 -1
  145. data/lib/expressir/model/literals/binary.rb +2 -2
  146. data/lib/expressir/model/literals/integer.rb +2 -2
  147. data/lib/expressir/model/literals/logical.rb +2 -2
  148. data/lib/expressir/model/literals/real.rb +2 -2
  149. data/lib/expressir/model/literals/string.rb +3 -3
  150. data/lib/expressir/model/model_element.rb +39 -38
  151. data/lib/expressir/model/reference.rb +1 -1
  152. data/lib/expressir/model/references/attribute_reference.rb +3 -3
  153. data/lib/expressir/model/references/group_reference.rb +3 -3
  154. data/lib/expressir/model/references/index_reference.rb +4 -4
  155. data/lib/expressir/model/references/simple_reference.rb +3 -3
  156. data/lib/expressir/model/repository.rb +3 -4
  157. data/lib/expressir/model/statement.rb +1 -1
  158. data/lib/expressir/model/statements/alias.rb +4 -4
  159. data/lib/expressir/model/statements/assignment.rb +3 -3
  160. data/lib/expressir/model/statements/case.rb +4 -4
  161. data/lib/expressir/model/statements/case_action.rb +3 -3
  162. data/lib/expressir/model/statements/compound.rb +2 -2
  163. data/lib/expressir/model/statements/escape.rb +1 -1
  164. data/lib/expressir/model/statements/if.rb +4 -4
  165. data/lib/expressir/model/statements/null.rb +1 -1
  166. data/lib/expressir/model/statements/procedure_call.rb +3 -3
  167. data/lib/expressir/model/statements/repeat.rb +8 -8
  168. data/lib/expressir/model/statements/return.rb +2 -2
  169. data/lib/expressir/model/statements/skip.rb +1 -1
  170. data/lib/expressir/model/supertype_expression.rb +1 -1
  171. data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +4 -4
  172. data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +2 -2
  173. data/lib/expressir/version.rb +1 -1
  174. data/lib/expressir.rb +2 -0
  175. metadata +103 -13
  176. /data/exe/{format → expressir-format} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eb8fca7617066f56f2141e4deadd8b34ac4e0cc8946268448446d6ce11adbb4
4
- data.tar.gz: 96eb473f78ce645d22e21b8bb1c2887959e98874ea255024b7b13c48eddb05b6
3
+ metadata.gz: 2ae2589e65c9c989edbabf98e4052772fd7abae7c221d00a091983e7f5525ef3
4
+ data.tar.gz: d5b2682aacd2aa4bed76747876c2c8b2d4d1aed0e3f4bcc59b518404e9deae30
5
5
  SHA512:
6
- metadata.gz: 4e6ebf6461e38d58a6a979ffd22de3eebe48f3feda4c179f45ec2919605e1875768683f8a6ec019533f17543b936f72d6f20ceefddf695a60e4dca4675f06cb9
7
- data.tar.gz: 1db94948d3012f7282f5f25ef5f7bfa83a236c9c1fdd42ec1fa07844600e43b89b8cf38955923cbca4c8f72db44131ba17ca7886b19d06946c4933430bf7c939
6
+ metadata.gz: b28fcd1ecee58b9eb7b750731fa28d86866d77c18afdc8b5d3e4857d9816b5c3f92ec6bd38175519526c0add26973d31dbb664a332459f8fcaf5be4938beeffd
7
+ data.tar.gz: 66633c6a8ab3bfa54d6934b53de31b9c9b040e200ad5537ec806160ccc26ad7c7e9ad9a60c84a27836b944ff96a724bd807a21f139394080e193bf71422402d9
data/.rubocop.yml CHANGED
@@ -1,19 +1,14 @@
1
+ require:
2
+ - rubocop-performance
3
+
1
4
  inherit_from:
2
- - .rubocop_todo.yml
3
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+ - .rubocop_todo.yml
4
7
 
5
- AllCops:
6
- TargetRubyVersion: 2.7
7
- NewCops: enable
8
- SuggestExtensions: false
8
+ Naming/VariableName:
9
9
  Exclude:
10
- - 'vendor/**/*'
11
- - 'expressir.gemspec'
12
- - 'tmp/**/*'
13
- - 'pkg/**/*'
14
- - 'exe/format-test'
15
- - 'lib/expressir/express/**/*'
16
- - 'lib/expressir/model/**/*'
17
-
10
+ - lib/expressir/express/visitor.rb
18
11
  Layout/LineLength:
19
12
  Max: 160
13
+ AllCops:
14
+ TargetRubyVersion: 2.7
data/.rubocop_todo.yml CHANGED
@@ -1,7 +1,84 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-11-08 08:38:26 UTC using RuboCop version 1.68.0.
3
+ # on 2024-11-26 21:06:12 UTC using RuboCop version 1.68.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
+
9
+ # Offense count: 1
10
+ # Configuration parameters: AllowedParentClasses.
11
+ Lint/MissingSuper:
12
+ Exclude:
13
+ - 'lib/expressir/model/cache.rb'
14
+
15
+ # Offense count: 3
16
+ Lint/ShadowingOuterLocalVariable:
17
+ Exclude:
18
+ - 'lib/expressir/express/visitor.rb'
19
+
20
+ # Offense count: 2
21
+ # This cop supports safe autocorrection (--autocorrect).
22
+ # Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
23
+ Lint/UnusedMethodArgument:
24
+ Exclude:
25
+ - 'lib/expressir/express/parser.rb'
26
+
27
+ # Offense count: 54
28
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
29
+ Metrics/AbcSize:
30
+ Exclude:
31
+ - 'lib/expressir/express/formatter.rb'
32
+ - 'lib/expressir/express/hyperlink_formatter.rb'
33
+ - 'lib/expressir/express/resolve_references_model_visitor.rb'
34
+ - 'lib/expressir/express/visitor.rb'
35
+ - 'lib/expressir/model/declarations/function.rb'
36
+ - 'lib/expressir/model/declarations/procedure.rb'
37
+ - 'lib/expressir/model/declarations/rule.rb'
38
+ - 'lib/expressir/model/declarations/schema.rb'
39
+ - 'lib/expressir/model/model_element.rb'
40
+
41
+ # Offense count: 1
42
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
43
+ # AllowedMethods: refine
44
+ Metrics/BlockLength:
45
+ Max: 29
46
+
47
+ # Offense count: 40
48
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
49
+ Metrics/CyclomaticComplexity:
50
+ Exclude:
51
+ - 'lib/expressir/express/formatter.rb'
52
+ - 'lib/expressir/express/visitor.rb'
53
+ - 'lib/expressir/model/declarations/function.rb'
54
+ - 'lib/expressir/model/declarations/procedure.rb'
55
+ - 'lib/expressir/model/declarations/rule.rb'
56
+ - 'lib/expressir/model/declarations/schema.rb'
57
+ - 'lib/expressir/model/model_element.rb'
58
+
59
+ # Offense count: 74
60
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
61
+ Metrics/MethodLength:
62
+ Max: 135
63
+
64
+ # Offense count: 36
65
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
66
+ Metrics/PerceivedComplexity:
67
+ Exclude:
68
+ - 'lib/expressir/express/formatter.rb'
69
+ - 'lib/expressir/express/visitor.rb'
70
+ - 'lib/expressir/model/declarations/function.rb'
71
+ - 'lib/expressir/model/declarations/procedure.rb'
72
+ - 'lib/expressir/model/declarations/rule.rb'
73
+ - 'lib/expressir/model/declarations/schema.rb'
74
+ - 'lib/expressir/model/model_element.rb'
75
+
76
+ # Offense count: 5
77
+ Performance/FixedSize:
78
+ Exclude:
79
+ - 'lib/expressir/express/formatter.rb'
80
+
81
+ # Offense count: 1
82
+ Style/MissingRespondToMissing:
83
+ Exclude:
84
+ - 'lib/expressir/express/visitor.rb'
data/Gemfile CHANGED
@@ -5,12 +5,11 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in reeper.gemspec
6
6
  gemspec
7
7
 
8
- # gem "asciidoctor", "~> 2.0.13"
9
8
  gem "pry"
10
9
  gem "rake", "~> 13.0"
11
10
  gem "rspec", "~> 3.0"
12
11
  gem "rubocop", "~> 1.21"
13
- gem "rubocop-performance", require: false
12
+ gem "rubocop-performance"
14
13
  gem "rubocop-rake", require: false
15
14
  gem "rubocop-rspec", require: false
16
15
  gem "webrick", "~> 1.7"
data/README.adoc CHANGED
@@ -142,6 +142,52 @@ schemas = repo_hash['schemas']
142
142
  schemas.map {|s| s["id"] }
143
143
  ----
144
144
 
145
+ === Convert models to liquid
146
+
147
+ Use `to_liquid` method to convert the models of `Expressir::Model::*` to liquid
148
+ drop models (`Expressir::Liquid::*`).
149
+
150
+ Example:
151
+
152
+ [source,ruby]
153
+ ----
154
+ repo = Expressir::Express::Parser.from_file("path/to/file.exp")
155
+ repo_drop = repo.to_liquid
156
+ ----
157
+
158
+ where `repo` is an instance of `Expressir::Model::Repository` and
159
+ `repo_drop` is an instance of `Expressir::Liquid::RepositoryDrop`.
160
+
161
+ The liquid drop models of `Expressir::Liquid::*` have the same attributes
162
+ (`model_attr`) as the models of `Expressir::Model::*`.
163
+
164
+ For example, `Expressir::Model::Repository` has the following attributes:
165
+
166
+ - schemas
167
+
168
+ and each `Expressir::Model::Declarations::Schema` has the following attributes:
169
+
170
+ - file
171
+ - version
172
+ - interfaces
173
+ - constants
174
+ - entities
175
+ - subtype_constraints
176
+ - functions
177
+ - rules
178
+ - procedures
179
+
180
+ Thus, `Expressir::Liquid::Repository` has the same attribute `schemas`
181
+ and `Expressir::Liquid::Declarations::SchemaDrop` has same attribute `file`.
182
+
183
+ [source,ruby]
184
+ ----
185
+ repo = Expressir::Express::Parser.from_file("path/to/file.exp")
186
+ repo_drop = repo.to_liquid
187
+ schema = repo_drop.schemas.first
188
+ schema.file = "path/to/file.exp"
189
+ ----
190
+
145
191
  == Contributing
146
192
 
147
193
  First, thank you for contributing! We love pull requests from everyone. By
@@ -49,7 +49,8 @@ exp_files = [
49
49
  "../iso-10303-stepmod/data/resources/security_classification_schema/security_classification_schema_annotated.exp",
50
50
  "../iso-10303-stepmod/data/resources/support_resource_schema/support_resource_schema_annotated.exp",
51
51
  # full test (6m18s + 8s = 6m26s)
52
- # *`bundle exec ../stepmod-utils/exe/stepmod-find-express-files ../iso-10303-stepmod`.strip.split("\n").map{|file| File.exists?(file.sub(/\.exp$/, '_annotated.exp')) ? file.sub(/\.exp$/, '_annotated.exp') : file}
52
+ # *`bundle exec ../stepmod-utils/exe/stepmod-find-express-files ../iso-10303-stepmod`.strip
53
+ # .split("\n").map{|file| File.exists?(file.sub(/\.exp$/, '_annotated.exp')) ? file.sub(/\.exp$/, '_annotated.exp') : file}
53
54
  ]
54
55
 
55
56
  start = Time.now
@@ -75,7 +76,7 @@ formatter = Class.new(Expressir::Express::Formatter) do
75
76
  include Expressir::Express::SchemaHeadFormatter
76
77
  include Expressir::Express::HyperlinkFormatter
77
78
  end
78
- result = repository.to_hash(formatter: formatter)
79
+ repository.to_hash(formatter: formatter)
79
80
  puts "Repository.to_hash time: #{(Time.now - start).round(2)}s"
80
81
 
81
82
  # puts YAML.dump(result)
data/expressir.gemspec CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.bindir = "exe"
18
18
  spec.require_paths = ["lib"]
19
- spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
20
19
 
21
20
  spec.metadata["homepage_uri"] = spec.homepage
22
21
  spec.metadata["source_code_uri"] = spec.homepage
23
22
  spec.metadata["changelog_uri"] = "https://github.com/lutaml/expressir/releases"
23
+ spec.metadata["rubygems_mfa_required"] = "true"
24
24
 
25
25
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
26
26
 
@@ -30,10 +30,9 @@ Gem::Specification.new do |spec|
30
30
  end
31
31
  end
32
32
 
33
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
33
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
35
34
 
36
- spec.add_dependency "thor", "~> 1.0"
35
+ spec.add_dependency "liquid"
37
36
  spec.add_dependency "parslet", "~> 2.0"
38
- spec.metadata["rubygems_mfa_required"] = "true"
37
+ spec.add_dependency "thor", "~> 1.0"
39
38
  end
@@ -1,6 +1,6 @@
1
- require 'yaml'
2
- require 'zlib'
3
- require 'expressir/model'
1
+ require "yaml"
2
+ require "zlib"
3
+ require "expressir/model"
4
4
 
5
5
  module Expressir
6
6
  module Express
@@ -16,7 +16,7 @@ module Expressir
16
16
 
17
17
  cache = Model::Cache.new(
18
18
  version: version,
19
- content: content
19
+ content: content,
20
20
  )
21
21
 
22
22
  hash = cache.to_hash(root_path: root_path)
@@ -37,7 +37,7 @@ module Expressir
37
37
 
38
38
  yaml_compressed = File.binread(file)
39
39
  yaml = Zlib::Inflate.inflate(yaml_compressed)
40
- hash = YAML.load(yaml)
40
+ hash = YAML.safe_load(yaml)
41
41
  cache = Model::ModelElement.from_hash(hash, root_path: root_path)
42
42
 
43
43
  if cache.version != version
@@ -48,4 +48,4 @@ module Expressir
48
48
  end
49
49
  end
50
50
  end
51
- end
51
+ end