expressir 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +38 -0
  3. data/.github/workflows/ubuntu.yml +56 -0
  4. data/.github/workflows/windows.yml +40 -0
  5. data/.gitignore +12 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +508 -0
  8. data/Gemfile +4 -0
  9. data/README.adoc +147 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +12 -0
  12. data/bin/rspec +29 -0
  13. data/bin/setup +8 -0
  14. data/docs/development.md +90 -0
  15. data/exe/expressir +20 -0
  16. data/expressir.gemspec +35 -0
  17. data/lib/expressir.rb +21 -0
  18. data/lib/expressir/cli.rb +27 -0
  19. data/lib/expressir/cli/ui.rb +36 -0
  20. data/lib/expressir/config.rb +23 -0
  21. data/lib/expressir/express.rb +12 -0
  22. data/lib/expressir/express/aggregate_dimension.rb +38 -0
  23. data/lib/expressir/express/attribute.rb +15 -0
  24. data/lib/expressir/express/comment.rb +7 -0
  25. data/lib/expressir/express/defined_type.rb +36 -0
  26. data/lib/expressir/express/derived.rb +65 -0
  27. data/lib/expressir/express/derived_aggregate.rb +43 -0
  28. data/lib/expressir/express/entity.rb +137 -0
  29. data/lib/expressir/express/explicit.rb +70 -0
  30. data/lib/expressir/express/explicit_aggregate.rb +46 -0
  31. data/lib/expressir/express/explicit_or_derived.rb +16 -0
  32. data/lib/expressir/express/global_rule.rb +44 -0
  33. data/lib/expressir/express/interface_specification.rb +51 -0
  34. data/lib/expressir/express/interfaced_item.rb +38 -0
  35. data/lib/expressir/express/inverse.rb +46 -0
  36. data/lib/expressir/express/inverse_aggregate.rb +37 -0
  37. data/lib/expressir/express/model_element.rb +7 -0
  38. data/lib/expressir/express/named_type.rb +19 -0
  39. data/lib/expressir/express/remark.rb +8 -0
  40. data/lib/expressir/express/repository.rb +306 -0
  41. data/lib/expressir/express/schema_definition.rb +96 -0
  42. data/lib/expressir/express/subtype_constraint.rb +14 -0
  43. data/lib/expressir/express/type.rb +26 -0
  44. data/lib/expressir/express/type_aggregate.rb +42 -0
  45. data/lib/expressir/express/type_enum.rb +29 -0
  46. data/lib/expressir/express/type_parser.rb +45 -0
  47. data/lib/expressir/express/type_select.rb +82 -0
  48. data/lib/expressir/express/unique_rule.rb +35 -0
  49. data/lib/expressir/express/where_rule.rb +32 -0
  50. data/lib/expressir/express_parser.rb +30 -0
  51. data/lib/expressir/parser.rb +6 -0
  52. data/lib/expressir/parser/owl_parser.rb +8 -0
  53. data/lib/expressir/version.rb +3 -0
  54. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +9589 -0
  55. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +36619 -0
  56. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +13294 -0
  57. data/original/examples/employment/eclipse/.project +17 -0
  58. data/original/examples/employment/eclipse/Export/Employment.png +0 -0
  59. data/original/examples/employment/eclipse/Express/employment_schema.exp +33 -0
  60. data/original/examples/employment/eclipse/Express/employment_schema.xmi +77 -0
  61. data/original/examples/employment/eclipse/Express/employment_schema.xml +93 -0
  62. data/original/examples/employment/eclipse/Models/Employment.uml +4 -0
  63. data/original/examples/employment/eclipse/Models/Employment.umldi +240 -0
  64. data/original/examples/employment/eclipse/readme.txt +7 -0
  65. data/original/examples/employment/employment_schema.exp +33 -0
  66. data/original/examples/employment/employment_schema.rb +232 -0
  67. data/original/examples/employment/employment_schema.xml +93 -0
  68. data/original/examples/employment/employment_schema___module.rb +46 -0
  69. data/original/examples/employment/employment_schema___p28attr.rb +126 -0
  70. data/original/examples/employment/employment_schema___p28inst.rb +26 -0
  71. data/original/examples/employment/example_employment_data.xml +1 -0
  72. data/original/examples/employment/example_employment_data_copy.xml +1 -0
  73. data/original/examples/employment/example_employment_reader.rb +30 -0
  74. data/original/examples/employment/example_employment_writer.rb +51 -0
  75. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +3710 -0
  76. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +35880 -0
  77. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +15357 -0
  78. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +9468 -0
  79. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +8404 -0
  80. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +43147 -0
  81. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +18341 -0
  82. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +11632 -0
  83. data/original/exp2ruby.rb +525 -0
  84. data/original/expsm.rb +34 -0
  85. data/original/mapping_owl.rb +1018 -0
  86. data/original/mapping_sysml.rb +2281 -0
  87. data/original/mapping_uml2.rb +599 -0
  88. data/original/mapping_uml2_eclipse.rb +433 -0
  89. data/original/reeper.rb +134 -0
  90. data/spec/acceptance/express_to_owl_spec.rb +18 -0
  91. data/spec/acceptance/version_spec.rb +12 -0
  92. data/spec/expressir/express/repository_spec.rb +25 -0
  93. data/spec/expressr_spec.rb +5 -0
  94. data/spec/spec_helper.rb +17 -0
  95. data/spec/support/console_helper.rb +29 -0
  96. metadata +239 -0
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe "Expressir" do
4
+ describe "express-to-owl" do
5
+ pending "Still needs implementation"
6
+
7
+ it "convert express to owl system" do
8
+ command = %W(express-to-owl #{sample_file})
9
+ capture_stdout { Expressir::Cli.start(command) }
10
+ end
11
+ end
12
+
13
+ def sample_file
14
+ @sample_file ||= Expressir.root_path.join(
15
+ "original", "examples", "ap233", "ap233e1_arm_lf_stepmod-2010-11-12.xml"
16
+ )
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe "Expressir" do
4
+ describe "version" do
5
+ it "displays the current verison" do
6
+ command = %w(version)
7
+ output = capture_stdout { Expressir::Cli.start(command) }
8
+
9
+ expect(output).to include("Version #{Expressir::VERSION}")
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Expressir::Express::Repository do
4
+ describe ".from_file" do
5
+ it "build an instance from a file" do
6
+ name = "Ap233_systems_engineering_arm_LF"
7
+
8
+ repo = Expressir::Express::Repository.from_xml(sample_file)
9
+ schema = repo.schemas.first
10
+
11
+ expect(repo.name).to eq(name)
12
+ expect(repo.schemas.count).to eq(1)
13
+ expect(schema.name).to eq(name)
14
+ expect(schema.contents.count).to eq(795)
15
+ expect(schema.contents.first.schema).to eq(name)
16
+ expect(schema.contents.first.name).to eq("Abs_function")
17
+ end
18
+ end
19
+
20
+ def sample_file
21
+ @sample_file ||= Expressir.root_path.join(
22
+ "original", "examples", "ap233", "ap233e1_arm_lf_stepmod-2010-11-12.xml"
23
+ )
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.describe Expressir do
2
+ it "has a version number" do
3
+ expect(Expressir::VERSION).not_to be nil
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ require "bundler/setup"
2
+ require "expressir"
3
+
4
+ Dir["./spec/support/**/*.rb"].sort.each { |file| require file }
5
+
6
+ RSpec.configure do |config|
7
+ # Enable flags like --only-failures and --next-failure
8
+ config.example_status_persistence_file_path = ".rspec_status"
9
+ config.include Expressir::ConsoleHelper
10
+
11
+ # Disable RSpec exposing methods globally on `Module` and `main`
12
+ config.disable_monkey_patching!
13
+
14
+ config.expect_with :rspec do |c|
15
+ c.syntax = :expect
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ module Expressir
2
+ module ConsoleHelper
3
+ def capture_stdout(&_block)
4
+ original_stdout = $stdout
5
+ $stdout = fake = StringIO.new
6
+
7
+ begin
8
+ yield
9
+ ensure
10
+ $stdout = original_stdout
11
+ end
12
+
13
+ fake.string
14
+ end
15
+
16
+ def capture_stderr(&_block)
17
+ original_stderr = $stderr
18
+ $stderr = fake = StringIO.new
19
+
20
+ begin
21
+ yield
22
+ ensure
23
+ $stderr = original_stderr
24
+ end
25
+
26
+ fake.string
27
+ end
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,239 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: expressir
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-08-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.12.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.12.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ description: ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models.
112
+ email:
113
+ - open.source@ribose.com'
114
+ executables:
115
+ - expressir
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".github/workflows/macos.yml"
120
+ - ".github/workflows/ubuntu.yml"
121
+ - ".github/workflows/windows.yml"
122
+ - ".gitignore"
123
+ - ".rspec"
124
+ - ".rubocop.yml"
125
+ - Gemfile
126
+ - README.adoc
127
+ - Rakefile
128
+ - bin/console
129
+ - bin/rspec
130
+ - bin/setup
131
+ - docs/development.md
132
+ - exe/expressir
133
+ - expressir.gemspec
134
+ - lib/expressir.rb
135
+ - lib/expressir/cli.rb
136
+ - lib/expressir/cli/ui.rb
137
+ - lib/expressir/config.rb
138
+ - lib/expressir/express.rb
139
+ - lib/expressir/express/aggregate_dimension.rb
140
+ - lib/expressir/express/attribute.rb
141
+ - lib/expressir/express/comment.rb
142
+ - lib/expressir/express/defined_type.rb
143
+ - lib/expressir/express/derived.rb
144
+ - lib/expressir/express/derived_aggregate.rb
145
+ - lib/expressir/express/entity.rb
146
+ - lib/expressir/express/explicit.rb
147
+ - lib/expressir/express/explicit_aggregate.rb
148
+ - lib/expressir/express/explicit_or_derived.rb
149
+ - lib/expressir/express/global_rule.rb
150
+ - lib/expressir/express/interface_specification.rb
151
+ - lib/expressir/express/interfaced_item.rb
152
+ - lib/expressir/express/inverse.rb
153
+ - lib/expressir/express/inverse_aggregate.rb
154
+ - lib/expressir/express/model_element.rb
155
+ - lib/expressir/express/named_type.rb
156
+ - lib/expressir/express/remark.rb
157
+ - lib/expressir/express/repository.rb
158
+ - lib/expressir/express/schema_definition.rb
159
+ - lib/expressir/express/subtype_constraint.rb
160
+ - lib/expressir/express/type.rb
161
+ - lib/expressir/express/type_aggregate.rb
162
+ - lib/expressir/express/type_enum.rb
163
+ - lib/expressir/express/type_parser.rb
164
+ - lib/expressir/express/type_select.rb
165
+ - lib/expressir/express/unique_rule.rb
166
+ - lib/expressir/express/where_rule.rb
167
+ - lib/expressir/express_parser.rb
168
+ - lib/expressir/parser.rb
169
+ - lib/expressir/parser/owl_parser.rb
170
+ - lib/expressir/version.rb
171
+ - original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp
172
+ - original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl
173
+ - original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml
174
+ - original/examples/employment/eclipse/.project
175
+ - original/examples/employment/eclipse/Export/Employment.png
176
+ - original/examples/employment/eclipse/Express/employment_schema.exp
177
+ - original/examples/employment/eclipse/Express/employment_schema.xmi
178
+ - original/examples/employment/eclipse/Express/employment_schema.xml
179
+ - original/examples/employment/eclipse/Models/Employment.uml
180
+ - original/examples/employment/eclipse/Models/Employment.umldi
181
+ - original/examples/employment/eclipse/readme.txt
182
+ - original/examples/employment/employment_schema.exp
183
+ - original/examples/employment/employment_schema.rb
184
+ - original/examples/employment/employment_schema.xml
185
+ - original/examples/employment/employment_schema___module.rb
186
+ - original/examples/employment/employment_schema___p28attr.rb
187
+ - original/examples/employment/employment_schema___p28inst.rb
188
+ - original/examples/employment/example_employment_data.xml
189
+ - original/examples/employment/example_employment_data_copy.xml
190
+ - original/examples/employment/example_employment_reader.rb
191
+ - original/examples/employment/example_employment_writer.rb
192
+ - original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp
193
+ - original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl
194
+ - original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi
195
+ - original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml
196
+ - original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp
197
+ - original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl
198
+ - original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi
199
+ - original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml
200
+ - original/exp2ruby.rb
201
+ - original/expsm.rb
202
+ - original/mapping_owl.rb
203
+ - original/mapping_sysml.rb
204
+ - original/mapping_uml2.rb
205
+ - original/mapping_uml2_eclipse.rb
206
+ - original/reeper.rb
207
+ - spec/acceptance/express_to_owl_spec.rb
208
+ - spec/acceptance/version_spec.rb
209
+ - spec/expressir/express/repository_spec.rb
210
+ - spec/expressr_spec.rb
211
+ - spec/spec_helper.rb
212
+ - spec/support/console_helper.rb
213
+ homepage: https://github.com/lutaml/expressir
214
+ licenses:
215
+ - MIT
216
+ metadata:
217
+ homepage_uri: https://github.com/lutaml/expressir
218
+ source_code_uri: https://github.com/lutaml/expressir
219
+ changelog_uri: https://github.com/lutaml/expressir/releases
220
+ post_install_message:
221
+ rdoc_options: []
222
+ require_paths:
223
+ - lib
224
+ required_ruby_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ required_rubygems_version: !ruby/object:Gem::Requirement
230
+ requirements:
231
+ - - ">="
232
+ - !ruby/object:Gem::Version
233
+ version: '0'
234
+ requirements: []
235
+ rubygems_version: 3.0.3
236
+ signing_key:
237
+ specification_version: 4
238
+ summary: ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models.
239
+ test_files: []