expressir 1.2.5-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.cross_rubies +15 -0
- data/.github/workflows/rake.yml +300 -0
- data/.github/workflows/release.yml +120 -0
- data/.gitignore +23 -0
- data/.gitmodules +6 -0
- data/.hound.yml +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +17 -0
- data/.yardopts +11 -0
- data/Gemfile +4 -0
- data/README.adoc +147 -0
- data/Rakefile +17 -0
- data/bin/console +11 -0
- data/bin/rspec +29 -0
- data/bin/setup +8 -0
- data/docs/development.md +90 -0
- data/exe/expressir +22 -0
- data/exe/format +18 -0
- data/exe/format-test +81 -0
- data/exe/generate-parser +51 -0
- data/expressir.gemspec +48 -0
- data/lib/expressir/cli/ui.rb +36 -0
- data/lib/expressir/cli.rb +21 -0
- data/lib/expressir/config.rb +23 -0
- data/lib/expressir/express/3.1/express_parser.so +0 -0
- data/lib/expressir/express/cache.rb +51 -0
- data/lib/expressir/express/formatter.rb +1608 -0
- data/lib/expressir/express/hyperlink_formatter.rb +36 -0
- data/lib/expressir/express/model_visitor.rb +24 -0
- data/lib/expressir/express/parser.rb +84 -0
- data/lib/expressir/express/resolve_references_model_visitor.rb +31 -0
- data/lib/expressir/express/schema_head_formatter.rb +23 -0
- data/lib/expressir/express/visitor.rb +2578 -0
- data/lib/expressir/model/cache.rb +17 -0
- data/lib/expressir/model/data_type.rb +9 -0
- data/lib/expressir/model/data_types/aggregate.rb +31 -0
- data/lib/expressir/model/data_types/array.rb +31 -0
- data/lib/expressir/model/data_types/bag.rb +25 -0
- data/lib/expressir/model/data_types/binary.rb +22 -0
- data/lib/expressir/model/data_types/boolean.rb +10 -0
- data/lib/expressir/model/data_types/enumeration.rb +25 -0
- data/lib/expressir/model/data_types/enumeration_item.rb +26 -0
- data/lib/expressir/model/data_types/generic.rb +26 -0
- data/lib/expressir/model/data_types/generic_entity.rb +26 -0
- data/lib/expressir/model/data_types/integer.rb +10 -0
- data/lib/expressir/model/data_types/list.rb +28 -0
- data/lib/expressir/model/data_types/logical.rb +10 -0
- data/lib/expressir/model/data_types/number.rb +10 -0
- data/lib/expressir/model/data_types/real.rb +19 -0
- data/lib/expressir/model/data_types/select.rb +28 -0
- data/lib/expressir/model/data_types/set.rb +25 -0
- data/lib/expressir/model/data_types/string.rb +22 -0
- data/lib/expressir/model/declaration.rb +9 -0
- data/lib/expressir/model/declarations/attribute.rb +47 -0
- data/lib/expressir/model/declarations/constant.rb +34 -0
- data/lib/expressir/model/declarations/entity.rb +53 -0
- data/lib/expressir/model/declarations/function.rb +67 -0
- data/lib/expressir/model/declarations/interface.rb +28 -0
- data/lib/expressir/model/declarations/interface_item.rb +23 -0
- data/lib/expressir/model/declarations/interfaced_item.rb +37 -0
- data/lib/expressir/model/declarations/parameter.rb +34 -0
- data/lib/expressir/model/declarations/procedure.rb +64 -0
- data/lib/expressir/model/declarations/remark_item.rb +21 -0
- data/lib/expressir/model/declarations/rule.rb +71 -0
- data/lib/expressir/model/declarations/schema.rb +117 -0
- data/lib/expressir/model/declarations/schema_version.rb +22 -0
- data/lib/expressir/model/declarations/schema_version_item.rb +22 -0
- data/lib/expressir/model/declarations/subtype_constraint.rb +40 -0
- data/lib/expressir/model/declarations/type.rb +45 -0
- data/lib/expressir/model/declarations/unique_rule.rb +31 -0
- data/lib/expressir/model/declarations/variable.rb +34 -0
- data/lib/expressir/model/declarations/where_rule.rb +31 -0
- data/lib/expressir/model/expression.rb +9 -0
- data/lib/expressir/model/expressions/aggregate_initializer.rb +19 -0
- data/lib/expressir/model/expressions/aggregate_initializer_item.rb +22 -0
- data/lib/expressir/model/expressions/binary_expression.rb +53 -0
- data/lib/expressir/model/expressions/entity_constructor.rb +22 -0
- data/lib/expressir/model/expressions/function_call.rb +22 -0
- data/lib/expressir/model/expressions/interval.rb +34 -0
- data/lib/expressir/model/expressions/query_expression.rb +35 -0
- data/lib/expressir/model/expressions/unary_expression.rb +27 -0
- data/lib/expressir/model/identifier.rb +34 -0
- data/lib/expressir/model/literal.rb +9 -0
- data/lib/expressir/model/literals/binary.rb +19 -0
- data/lib/expressir/model/literals/integer.rb +19 -0
- data/lib/expressir/model/literals/logical.rb +23 -0
- data/lib/expressir/model/literals/real.rb +19 -0
- data/lib/expressir/model/literals/string.rb +22 -0
- data/lib/expressir/model/model_element.rb +208 -0
- data/lib/expressir/model/reference.rb +9 -0
- data/lib/expressir/model/references/attribute_reference.rb +22 -0
- data/lib/expressir/model/references/group_reference.rb +22 -0
- data/lib/expressir/model/references/index_reference.rb +27 -0
- data/lib/expressir/model/references/simple_reference.rb +24 -0
- data/lib/expressir/model/repository.rb +23 -0
- data/lib/expressir/model/statement.rb +9 -0
- data/lib/expressir/model/statements/alias.rb +35 -0
- data/lib/expressir/model/statements/assignment.rb +22 -0
- data/lib/expressir/model/statements/case.rb +25 -0
- data/lib/expressir/model/statements/case_action.rb +22 -0
- data/lib/expressir/model/statements/compound.rb +19 -0
- data/lib/expressir/model/statements/escape.rb +10 -0
- data/lib/expressir/model/statements/if.rb +25 -0
- data/lib/expressir/model/statements/null.rb +10 -0
- data/lib/expressir/model/statements/procedure_call.rb +22 -0
- data/lib/expressir/model/statements/repeat.rb +47 -0
- data/lib/expressir/model/statements/return.rb +19 -0
- data/lib/expressir/model/statements/skip.rb +10 -0
- data/lib/expressir/model/supertype_expression.rb +9 -0
- data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +29 -0
- data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +19 -0
- data/lib/expressir/model.rb +79 -0
- data/lib/expressir/version.rb +3 -0
- data/lib/expressir.rb +20 -0
- data/rakelib/antlr4-native.rake +63 -0
- data/rakelib/cross-ruby.rake +367 -0
- data/spec/acceptance/version_spec.rb +17 -0
- data/spec/expressir/express/cache_spec.rb +67 -0
- data/spec/expressir/express/formatter_spec.rb +135 -0
- data/spec/expressir/express/parser_spec.rb +104 -0
- data/spec/expressir/model/model_element_spec.rb +274 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/console_helper.rb +29 -0
- data/spec/syntax/multiple.exp +23 -0
- data/spec/syntax/multiple.yaml +198 -0
- data/spec/syntax/multiple_formatted.exp +71 -0
- data/spec/syntax/multiple_hyperlink_formatted.exp +71 -0
- data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +13 -0
- data/spec/syntax/remark.exp +191 -0
- data/spec/syntax/remark.yaml +466 -0
- data/spec/syntax/remark_formatted.exp +227 -0
- data/spec/syntax/single.exp +4 -0
- data/spec/syntax/single.yaml +18 -0
- data/spec/syntax/single_formatted.exp +10 -0
- data/spec/syntax/single_formatted.yaml +36 -0
- data/spec/syntax/syntax.exp +333 -0
- data/spec/syntax/syntax.yaml +3509 -0
- data/spec/syntax/syntax_formatted.exp +902 -0
- data/spec/syntax/syntax_hyperlink_formatted.exp +902 -0
- data/spec/syntax/syntax_schema_head_formatted.exp +18 -0
- metadata +387 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bf27397757214c08451f20644b6abc825df6b1ed614fcb946a6535e88dd8b5ba
|
4
|
+
data.tar.gz: 654e9d67e7e5734808168db3579d7a05652d18dec561316d1f5c6bfc16df6d35
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0070ae5767e12b7a176e3c436644d5b5c031d57ccadc7318deaca512b0610072447a7ef8208211868fc2855dbee014c1e431274afb362c6412de5c30e0abfdf0
|
7
|
+
data.tar.gz: cae85a41b62eb4973dca485fc99842c67e109c78a78c605693cc9e4a304dd80c5c7ef27381927967dddaaf316140db195d2b9b1f017683f7c531f9a2c54e6b4d
|
data/.cross_rubies
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
3.1.0:x86_64-w64-mingw32
|
2
|
+
3.1.0:x86_64-linux-gnu
|
3
|
+
3.1.0:aarch64-linux-gnu
|
4
|
+
3.1.0:x86_64-darwin
|
5
|
+
3.1.0:arm64-darwin
|
6
|
+
3.0.0:x86_64-w64-mingw32
|
7
|
+
3.0.0:x86_64-linux-gnu
|
8
|
+
3.0.0:aarch64-linux-gnu
|
9
|
+
3.0.0:x86_64-darwin
|
10
|
+
3.0.0:arm64-darwin
|
11
|
+
2.7.0:x86_64-w64-mingw32
|
12
|
+
2.7.0:x86_64-linux-gnu
|
13
|
+
2.7.0:aarch64-linux-gnu
|
14
|
+
2.7.0:x86_64-darwin
|
15
|
+
2.7.0:arm64-darwin
|
@@ -0,0 +1,300 @@
|
|
1
|
+
name: rake
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master, main ]
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rubocop:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- name: Checkout
|
13
|
+
uses: actions/checkout@v3
|
14
|
+
with:
|
15
|
+
submodules: recursive
|
16
|
+
|
17
|
+
- name: Install Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 3.0
|
21
|
+
bundler-cache: true
|
22
|
+
|
23
|
+
- name: Bundle
|
24
|
+
run: bundle install --jobs 4 --retry 3
|
25
|
+
|
26
|
+
- name: Rubocop
|
27
|
+
run: bundle exec rake rubocop
|
28
|
+
|
29
|
+
rake:
|
30
|
+
name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }}
|
31
|
+
runs-on: ${{ matrix.os }}
|
32
|
+
continue-on-error: ${{ matrix.experimental }}
|
33
|
+
strategy:
|
34
|
+
fail-fast: false
|
35
|
+
matrix:
|
36
|
+
ruby: [ '3.1', '3.0', '2.7' ]
|
37
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
38
|
+
experimental: [ false ]
|
39
|
+
include:
|
40
|
+
- ruby: 'head'
|
41
|
+
os: 'ubuntu-latest'
|
42
|
+
experimental: true
|
43
|
+
- ruby: 'head'
|
44
|
+
os: 'windows-latest'
|
45
|
+
experimental: true
|
46
|
+
- ruby: 'head'
|
47
|
+
os: 'macos-latest'
|
48
|
+
experimental: true
|
49
|
+
|
50
|
+
steps:
|
51
|
+
- name: Checkout
|
52
|
+
uses: actions/checkout@v3
|
53
|
+
with:
|
54
|
+
submodules: recursive
|
55
|
+
|
56
|
+
- name: Setup packages
|
57
|
+
if: startsWith(matrix.os, 'macos')
|
58
|
+
run: brew install autoconf automake libtool
|
59
|
+
|
60
|
+
- name: Install Ruby
|
61
|
+
uses: ruby/setup-ruby@v1
|
62
|
+
with:
|
63
|
+
ruby-version: ${{ matrix.ruby }}
|
64
|
+
bundler-cache: true
|
65
|
+
|
66
|
+
- name: Process cache
|
67
|
+
uses: actions/cache@v2
|
68
|
+
id: cache
|
69
|
+
with:
|
70
|
+
path: lib/expressir/express/express_parser.*
|
71
|
+
key: v4-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}
|
72
|
+
|
73
|
+
- name: Build native extension
|
74
|
+
if: steps.cache.outputs.cache-hit != 'true'
|
75
|
+
run: bundle exec rake compile
|
76
|
+
|
77
|
+
- name: Run tests
|
78
|
+
run: |
|
79
|
+
bundle exec rake
|
80
|
+
cat .rspec_status
|
81
|
+
|
82
|
+
# test release workflow
|
83
|
+
pack-ruby:
|
84
|
+
runs-on: ubuntu-latest
|
85
|
+
strategy:
|
86
|
+
fail-fast: false
|
87
|
+
steps:
|
88
|
+
- name: Checkout
|
89
|
+
uses: actions/checkout@v3
|
90
|
+
with:
|
91
|
+
submodules: recursive
|
92
|
+
|
93
|
+
- name: Setup Ruby
|
94
|
+
uses: ruby/setup-ruby@v1
|
95
|
+
with:
|
96
|
+
ruby-version: '3.0'
|
97
|
+
# bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
|
98
|
+
# more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
|
99
|
+
|
100
|
+
- name: Bundle
|
101
|
+
run: bundle install --jobs 4 --retry 3
|
102
|
+
|
103
|
+
- name: Build gem without native extension
|
104
|
+
run: gem build expressir.gemspec
|
105
|
+
|
106
|
+
- name: Package gem without native extension
|
107
|
+
uses: actions/upload-artifact@v2
|
108
|
+
with:
|
109
|
+
name: pkg-ruby
|
110
|
+
path: expressir-*.gem
|
111
|
+
|
112
|
+
pack:
|
113
|
+
runs-on: ubuntu-latest
|
114
|
+
strategy:
|
115
|
+
fail-fast: false
|
116
|
+
matrix:
|
117
|
+
host: [ linux, windows, darwin ]
|
118
|
+
steps:
|
119
|
+
- name: Checkout
|
120
|
+
uses: actions/checkout@v3
|
121
|
+
with:
|
122
|
+
submodules: recursive
|
123
|
+
|
124
|
+
- name: Setup Ruby
|
125
|
+
uses: ruby/setup-ruby@v1
|
126
|
+
with:
|
127
|
+
ruby-version: '3.0'
|
128
|
+
# bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
|
129
|
+
# more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
|
130
|
+
|
131
|
+
- name: Bundle
|
132
|
+
run: bundle install --jobs 4 --retry 3
|
133
|
+
|
134
|
+
- name: Enable swap
|
135
|
+
run: |
|
136
|
+
sudo fallocate -l 15g /compile.swap
|
137
|
+
sudo chmod 600 /compile.swap
|
138
|
+
sudo mkswap /compile.swap
|
139
|
+
sudo swapon /compile.swap
|
140
|
+
sudo swapon --all --verbose
|
141
|
+
|
142
|
+
- name: Build gem with native extension
|
143
|
+
run: bundle exec rake gem:${{ matrix.host }}
|
144
|
+
|
145
|
+
- name: Package gem with native extension
|
146
|
+
uses: actions/upload-artifact@v2
|
147
|
+
with:
|
148
|
+
name: pkg-${{ matrix.host }}
|
149
|
+
path: pkg/*.gem
|
150
|
+
|
151
|
+
verify-ruby:
|
152
|
+
name: verify ruby gem on ruby-${{ matrix.ruby }} ${{ matrix.os }}
|
153
|
+
needs: pack-ruby
|
154
|
+
runs-on: ${{ matrix.os }}
|
155
|
+
strategy:
|
156
|
+
fail-fast: false
|
157
|
+
matrix:
|
158
|
+
ruby: [ '3.1', '3.0', '2.7' ]
|
159
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
160
|
+
steps:
|
161
|
+
- name: Install Ruby
|
162
|
+
uses: ruby/setup-ruby@v1
|
163
|
+
with:
|
164
|
+
ruby-version: ${{ matrix.ruby }}
|
165
|
+
bundler-cache: true
|
166
|
+
|
167
|
+
- name: Checkout
|
168
|
+
uses: actions/checkout@v3
|
169
|
+
with:
|
170
|
+
submodules: recursive
|
171
|
+
|
172
|
+
- name: Bundle
|
173
|
+
run: bundle install --jobs 4 --retry 3
|
174
|
+
|
175
|
+
- name: Download packaged gem
|
176
|
+
uses: actions/download-artifact@v2
|
177
|
+
with:
|
178
|
+
name: pkg-ruby
|
179
|
+
path: pkg
|
180
|
+
|
181
|
+
- name: Install gem
|
182
|
+
run: gem install -l pkg/expressir-*.gem
|
183
|
+
|
184
|
+
- name: Verify
|
185
|
+
run: |
|
186
|
+
cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
|
187
|
+
ruby bin/rspec
|
188
|
+
cat .rspec_status || echo ".rspec_status was not found"
|
189
|
+
|
190
|
+
verify-darwin:
|
191
|
+
name: verify MacOS binary gem on ruby-${{ matrix.ruby }}
|
192
|
+
needs: pack
|
193
|
+
runs-on: macos-latest
|
194
|
+
strategy:
|
195
|
+
fail-fast: false
|
196
|
+
matrix:
|
197
|
+
ruby: [ '3.1', '3.0', '2.7' ]
|
198
|
+
steps:
|
199
|
+
- name: Install Ruby
|
200
|
+
uses: ruby/setup-ruby@v1
|
201
|
+
with:
|
202
|
+
ruby-version: ${{ matrix.ruby }}
|
203
|
+
bundler-cache: true
|
204
|
+
|
205
|
+
- name: Checkout
|
206
|
+
uses: actions/checkout@v3
|
207
|
+
|
208
|
+
- name: Bundle
|
209
|
+
run: bundle install --jobs 4 --retry 3
|
210
|
+
|
211
|
+
- name: Download packaged gem
|
212
|
+
uses: actions/download-artifact@v2
|
213
|
+
with:
|
214
|
+
name: pkg-darwin
|
215
|
+
path: pkg
|
216
|
+
|
217
|
+
- name: Install binary gem
|
218
|
+
run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM.sub(/darwin\d{2}$/, 'darwin')").gem
|
219
|
+
# MacOS with have something like x86_64-darwin19, others just x86_64-linux
|
220
|
+
|
221
|
+
- name: Verify
|
222
|
+
run: |
|
223
|
+
cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
|
224
|
+
ruby bin/rspec
|
225
|
+
cat .rspec_status || echo ".rspec_status was not found"
|
226
|
+
|
227
|
+
verify-linux:
|
228
|
+
name: verify Linux binary gem on ruby-${{ matrix.ruby }}
|
229
|
+
needs: pack
|
230
|
+
runs-on: ubuntu-latest
|
231
|
+
strategy:
|
232
|
+
fail-fast: false
|
233
|
+
matrix:
|
234
|
+
ruby: [ '3.1', '3.0', '2.7' ]
|
235
|
+
steps:
|
236
|
+
- name: Install Ruby
|
237
|
+
uses: ruby/setup-ruby@v1
|
238
|
+
with:
|
239
|
+
ruby-version: ${{ matrix.ruby }}
|
240
|
+
bundler-cache: true
|
241
|
+
|
242
|
+
- name: Checkout
|
243
|
+
uses: actions/checkout@v3
|
244
|
+
|
245
|
+
- name: Bundle
|
246
|
+
run: bundle install --jobs 4 --retry 3
|
247
|
+
|
248
|
+
- name: Download packaged gem
|
249
|
+
uses: actions/download-artifact@v2
|
250
|
+
with:
|
251
|
+
name: pkg-linux
|
252
|
+
path: pkg
|
253
|
+
|
254
|
+
- name: Install binary gem
|
255
|
+
run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM").gem
|
256
|
+
|
257
|
+
- name: Verify
|
258
|
+
run: |
|
259
|
+
cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
|
260
|
+
ruby bin/rspec
|
261
|
+
cat .rspec_status || echo ".rspec_status was not found"
|
262
|
+
|
263
|
+
verify-windows:
|
264
|
+
name: verify Windows binary gem on ruby-${{ matrix.ruby }}
|
265
|
+
needs: pack
|
266
|
+
continue-on-error: true
|
267
|
+
runs-on: windows-latest
|
268
|
+
strategy:
|
269
|
+
fail-fast: false
|
270
|
+
# Ruby 3.1 fails
|
271
|
+
# https://github.com/lutaml/expressir/issues/103
|
272
|
+
matrix:
|
273
|
+
ruby: [ '3.1', '3.0', '2.7' ]
|
274
|
+
steps:
|
275
|
+
- name: Install Ruby
|
276
|
+
uses: ruby/setup-ruby@v1
|
277
|
+
with:
|
278
|
+
ruby-version: ${{ matrix.ruby }}
|
279
|
+
bundler-cache: true
|
280
|
+
|
281
|
+
- name: Checkout
|
282
|
+
uses: actions/checkout@v3
|
283
|
+
|
284
|
+
- name: Bundle
|
285
|
+
run: bundle install --jobs 4 --retry 3
|
286
|
+
|
287
|
+
- name: Download packaged gem
|
288
|
+
uses: actions/download-artifact@v2
|
289
|
+
with:
|
290
|
+
name: pkg-windows
|
291
|
+
path: pkg
|
292
|
+
|
293
|
+
- name: Install binary gem
|
294
|
+
run: gem install -l pkg/expressir-*-$(ruby -e "puts RUBY_PLATFORM").gem
|
295
|
+
|
296
|
+
- name: Verify
|
297
|
+
run: |
|
298
|
+
cd $(ruby -e "puts RbConfig::TOPDIR + '\/lib\/ruby\/gems\/' + RbConfig::CONFIG['ruby_version'] + '\/gems\/expressir*'")
|
299
|
+
ruby bin/rspec
|
300
|
+
cat .rspec_status || echo ".rspec_status was not found"
|
@@ -0,0 +1,120 @@
|
|
1
|
+
name: release
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
inputs:
|
6
|
+
next_version:
|
7
|
+
description: |
|
8
|
+
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
9
|
+
required: true
|
10
|
+
default: 'patch'
|
11
|
+
push:
|
12
|
+
tags: [ v* ]
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
bump:
|
16
|
+
runs-on: ubuntu-18.04
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
with:
|
20
|
+
submodules: recursive
|
21
|
+
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: '3.0'
|
25
|
+
|
26
|
+
- if: ${{ github.event_name == 'workflow_dispatch' }} # unfortunatelly cannot keep this condition on job level
|
27
|
+
run: |
|
28
|
+
git config user.name github-actions
|
29
|
+
git config user.email github-actions@github.com
|
30
|
+
gem install gem-release
|
31
|
+
gem bump --version ${{ github.event.inputs.next_version }} --tag --push
|
32
|
+
|
33
|
+
pack:
|
34
|
+
runs-on: ubuntu-18.04
|
35
|
+
needs: bump
|
36
|
+
strategy:
|
37
|
+
fail-fast: false
|
38
|
+
matrix:
|
39
|
+
host: [ linux, windows, darwin ]
|
40
|
+
steps:
|
41
|
+
- uses: actions/checkout@v2
|
42
|
+
with:
|
43
|
+
submodules: recursive
|
44
|
+
ref: main # https://github.com/actions/checkout/issues/439#issuecomment-830862188
|
45
|
+
|
46
|
+
- uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: '3.0'
|
49
|
+
# bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
|
50
|
+
# more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
|
51
|
+
|
52
|
+
- run: bundle install --jobs 4 --retry 3
|
53
|
+
|
54
|
+
# build gem WITHOUT pre-built native extension
|
55
|
+
- run: gem build expressir.gemspec
|
56
|
+
|
57
|
+
- if: matrix.host == 'linux'
|
58
|
+
uses: actions/upload-artifact@v2
|
59
|
+
with:
|
60
|
+
name: pkg-ruby
|
61
|
+
path: expressir-*.gem
|
62
|
+
|
63
|
+
- name: Enable swap
|
64
|
+
run: |
|
65
|
+
sudo fallocate -l 15g /compile.swap
|
66
|
+
sudo chmod 600 /compile.swap
|
67
|
+
sudo mkswap /compile.swap
|
68
|
+
sudo swapon /compile.swap
|
69
|
+
sudo swapon --all --verbose
|
70
|
+
|
71
|
+
# build gem WITH pre-built native extension
|
72
|
+
- run: bundle exec rake gem:${{ matrix.host }}
|
73
|
+
|
74
|
+
- uses: actions/upload-artifact@v2
|
75
|
+
with:
|
76
|
+
name: pkg-${{ matrix.host }}
|
77
|
+
path: pkg/*.gem
|
78
|
+
|
79
|
+
publish:
|
80
|
+
runs-on: ubuntu-18.04
|
81
|
+
needs: pack
|
82
|
+
steps:
|
83
|
+
- uses: actions/download-artifact@v2
|
84
|
+
with:
|
85
|
+
name: pkg-ruby
|
86
|
+
path: pkg
|
87
|
+
|
88
|
+
- uses: actions/download-artifact@v2
|
89
|
+
with:
|
90
|
+
name: pkg-linux
|
91
|
+
path: pkg
|
92
|
+
|
93
|
+
- uses: actions/download-artifact@v2
|
94
|
+
with:
|
95
|
+
name: pkg-windows
|
96
|
+
path: pkg
|
97
|
+
|
98
|
+
- uses: actions/download-artifact@v2
|
99
|
+
with:
|
100
|
+
name: pkg-darwin
|
101
|
+
path: pkg
|
102
|
+
|
103
|
+
- uses: ruby/setup-ruby@v1
|
104
|
+
with:
|
105
|
+
ruby-version: '3.0'
|
106
|
+
|
107
|
+
- run: ls -l pkg/
|
108
|
+
|
109
|
+
- name: Publish to rubygems.org
|
110
|
+
env:
|
111
|
+
RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
|
112
|
+
run: |
|
113
|
+
mkdir -p ~/.gem
|
114
|
+
cat > ~/.gem/credentials << EOF
|
115
|
+
---
|
116
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
117
|
+
EOF
|
118
|
+
chmod 0600 ~/.gem/credentials
|
119
|
+
gem signin
|
120
|
+
for gem in pkg/*.gem; do gem push $gem -V; done
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
/Gemfile.lock
|
10
|
+
/.idea
|
11
|
+
/.vscode
|
12
|
+
/lib/expressir/express/express_parser.bundle
|
13
|
+
/lib/expressir/express/express_parser.so
|
14
|
+
/lib/expressir/express/*/express_parser.bundle
|
15
|
+
/lib/expressir/express/*/express_parser.so
|
16
|
+
/spec/syntax/*-pretty.exp
|
17
|
+
/ext/express-parser/rice-embed
|
18
|
+
|
19
|
+
# rspec failure tracking
|
20
|
+
.rspec_status
|
21
|
+
|
22
|
+
# rubocop guide
|
23
|
+
.rubocop-https---*
|
data/.gitmodules
ADDED
data/.hound.yml
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.6
|
6
|
+
SuggestExtensions: false
|
7
|
+
Exclude:
|
8
|
+
- 'vendor/**/*'
|
9
|
+
- 'expressir.gemspec'
|
10
|
+
- 'tmp/**/*'
|
11
|
+
- 'pkg/**/*'
|
12
|
+
- 'exe/format-test'
|
13
|
+
- 'lib/expressir/express/**/*'
|
14
|
+
- 'lib/expressir/model/**/*'
|
15
|
+
|
16
|
+
Layout/LineLength:
|
17
|
+
Max: 160
|
data/.yardopts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# macro must be defined first, see https://stackoverflow.com/a/10344776/1823988
|
2
|
+
lib/expressir/model/model_element.rb
|
3
|
+
lib/expressir/model/data_type.rb
|
4
|
+
lib/expressir/model/declaration.rb
|
5
|
+
lib/expressir/model/expression.rb
|
6
|
+
lib/expressir/model/literal.rb
|
7
|
+
lib/expressir/model/reference.rb
|
8
|
+
lib/expressir/model/statement.rb
|
9
|
+
lib/expressir/model/supertype_expression.rb
|
10
|
+
|
11
|
+
lib/**/*.rb
|
data/Gemfile
ADDED
data/README.adoc
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
= Expressir: EXPRESS in Ruby
|
2
|
+
|
3
|
+
image:https://img.shields.io/gem/v/expressir.svg["Gem Version", link="https://rubygems.org/gems/expressir"]
|
4
|
+
// image:https://codeclimate.com/github/lutaml/expressir/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/lutaml/expressir"]
|
5
|
+
image:https://github.com/lutaml/expressir/workflows/rake/badge.svg["Build Status", link="https://github.com/lutaml/expressir/actions?workflow=rake"]
|
6
|
+
|
7
|
+
== Purpose
|
8
|
+
|
9
|
+
Expressir ("`EXPRESS in Ruby`") is a Ruby parser for EXPRESS and
|
10
|
+
a set of Ruby tools for accessing ISO EXPRESS data models.
|
11
|
+
|
12
|
+
== Architecture
|
13
|
+
|
14
|
+
Expressir consists of 3 parts:
|
15
|
+
|
16
|
+
. Parsers. A parser allows Expressir to read EXPRESS files, including:
|
17
|
+
|
18
|
+
** EXPRESS data modelling language (ISO 10303-11:2007)
|
19
|
+
** EXPRESS data modelling language in XML (STEPmod)
|
20
|
+
** EXPRESS XML (ISO 10303-28:2007)
|
21
|
+
"`Industrial automation systems and integration — Product data representation and exchange — Part 28: Implementation methods: XML representations of EXPRESS schemas and data, using XML schemas`")
|
22
|
+
|
23
|
+
. Data model. The data model (`lib/expressir/express`) is the Ruby data model that fully represents an EXPRESS data model.
|
24
|
+
|
25
|
+
. Converters. A converter transforms the EXPRESS Ruby data model into an interoperable export format, including:
|
26
|
+
** EXPRESS data modelling language (ISO 10303-11:2007)
|
27
|
+
** W3C OWL
|
28
|
+
** OMG SysML (XMI 2.1, XMI 2.5)
|
29
|
+
** OMG UML 2 (XMI 2.1)
|
30
|
+
** OMG UML 2 for Eclipse (XMI 2.1)
|
31
|
+
|
32
|
+
|
33
|
+
== Usage
|
34
|
+
|
35
|
+
This gem ships with a CLI tool. To check what's available you can simply run
|
36
|
+
the script directly from `exe/expressir`, by default it will display some usage
|
37
|
+
instructions.
|
38
|
+
|
39
|
+
[source, sh]
|
40
|
+
----
|
41
|
+
./exe/expressir
|
42
|
+
|
43
|
+
Commands:
|
44
|
+
expressir help [COMMAND] # Describe available commands or one specific command
|
45
|
+
expressir version # The Expressir Version
|
46
|
+
----
|
47
|
+
|
48
|
+
== Development
|
49
|
+
|
50
|
+
We are following Sandi Metz's Rules for this gem, you can read
|
51
|
+
the http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers[description of the rules here] All new code should follow these rules.
|
52
|
+
If you make changes in a pre-existing file that violates these rules you should
|
53
|
+
fix the violations as part of your contribution.
|
54
|
+
|
55
|
+
=== Setup
|
56
|
+
|
57
|
+
Clone the repository.
|
58
|
+
|
59
|
+
[source, sh]
|
60
|
+
----
|
61
|
+
git clone https://github.com/metanorma/expressir
|
62
|
+
----
|
63
|
+
|
64
|
+
Setup your environment.
|
65
|
+
|
66
|
+
[source, sh]
|
67
|
+
----
|
68
|
+
bin/setup
|
69
|
+
----
|
70
|
+
|
71
|
+
Run the test suite
|
72
|
+
|
73
|
+
[source, sh]
|
74
|
+
----
|
75
|
+
bin/rspec
|
76
|
+
----
|
77
|
+
|
78
|
+
== Installation
|
79
|
+
|
80
|
+
Add this line to your application's `Gemfile`:
|
81
|
+
|
82
|
+
[source, sh]
|
83
|
+
----
|
84
|
+
gem "expressir"
|
85
|
+
----
|
86
|
+
|
87
|
+
And then execute:
|
88
|
+
|
89
|
+
[source, sh]
|
90
|
+
----
|
91
|
+
$ bundle install
|
92
|
+
----
|
93
|
+
|
94
|
+
Or install it yourself as:
|
95
|
+
|
96
|
+
[source, sh]
|
97
|
+
----
|
98
|
+
$ gem install expressir
|
99
|
+
----
|
100
|
+
|
101
|
+
|
102
|
+
== Contributing
|
103
|
+
|
104
|
+
First, thank you for contributing! We love pull requests from everyone. By
|
105
|
+
participating in this project, you hereby grant
|
106
|
+
https://www.ribose.com[Ribose Inc.] the right to grant or transfer an unlimited
|
107
|
+
number of non exclusive licenses or sub-licenses to third parties, under the
|
108
|
+
copyright covering the contribution to use the contribution by all means.
|
109
|
+
|
110
|
+
Here are a few technical guidelines to follow:
|
111
|
+
|
112
|
+
* Open an https://github.com/lutaml/expressir/issues[issues] to discuss a new
|
113
|
+
feature.
|
114
|
+
* Write tests to support your new feature.
|
115
|
+
* Make sure the entire test suite passes locally and on CI.
|
116
|
+
* Open a Pull Request.
|
117
|
+
* https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature[Squash your commits] after receiving feedback.
|
118
|
+
* Party!
|
119
|
+
|
120
|
+
|
121
|
+
== License
|
122
|
+
|
123
|
+
Expressir is distributed under the BSD 2-clause license.
|
124
|
+
|
125
|
+
Expressir is built on code originally from the NIST Reeper project.
|
126
|
+
|
127
|
+
The https://www.nist.gov/services-resources/software/reeper[NIST Reeper license]
|
128
|
+
is reproduced below:
|
129
|
+
|
130
|
+
[quote]
|
131
|
+
____
|
132
|
+
This software was funded by NIST and developed by EuroSTEP.
|
133
|
+
Pursuant to title 17 Section 105 of the United States Code this
|
134
|
+
software is not subject to copyright protection and is in the public
|
135
|
+
domain.
|
136
|
+
|
137
|
+
We would appreciate acknowledgment if the software is used. Links to
|
138
|
+
non-Federal Government Web sites do not imply NIST endorsement of any
|
139
|
+
particular product, service, organization, company, information
|
140
|
+
provider, or content.
|
141
|
+
____
|
142
|
+
|
143
|
+
|
144
|
+
== Credits
|
145
|
+
|
146
|
+
Expressir is created using the structure and examples provided by
|
147
|
+
the NIST Reeper software on https://sourceforge.net/p/reeper/[Sourceforge].
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require "rake/extensiontask"
|
4
|
+
require "rubocop/rake_task"
|
5
|
+
require "yard"
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
8
|
+
|
9
|
+
task default: :spec
|
10
|
+
|
11
|
+
GEMSPEC = Gem::Specification.load("expressir.gemspec")
|
12
|
+
|
13
|
+
RuboCop::RakeTask.new
|
14
|
+
|
15
|
+
Gem::PackageTask.new(GEMSPEC).define
|
16
|
+
|
17
|
+
YARD::Rake::YardocTask.new
|
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "reeper"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|