lutaml 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -3
- data/lib/lutaml.rb +0 -1
- data/lib/lutaml/express/lutaml_path/document_wrapper.rb +37 -0
- data/lib/lutaml/parser.rb +6 -0
- data/lib/lutaml/uml/lutaml_path/document_wrapper.rb +15 -0
- data/lib/lutaml/version.rb +1 -1
- data/lutaml.gemspec +2 -2
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bffadc6b3f176ed29fe3d8c001afc02c2f29cb848874af353235d17f7c8657a
|
4
|
+
data.tar.gz: b424788eca466bb15faa49ea4802c2a32b7d6d6986833e523a47ed821d9b7307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6dcff09dc1a2d4560ddea2c2d0f58255769e1ab9c55e75f1641f942c608fb04c1716efc3006bbd015a02a8d2fb383da3c8e1c59068009ea635eb813bf68647c
|
7
|
+
data.tar.gz: ead2205b1cc1887b8ec73e0dad6cc5a72cae141f21f725b32433af3b2a12061e2c9b701c94323e978cf4e8727485f500733ad2d5c4c1b305a800c3bcfa96f65c
|
data/Gemfile
CHANGED
data/lib/lutaml.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require "lutaml/lutaml_path/document_wrapper"
|
2
|
+
|
3
|
+
module Lutaml
|
4
|
+
module Express
|
5
|
+
module LutamlPath
|
6
|
+
class DocumentWrapper < ::Lutaml::LutamlPath::DocumentWrapper
|
7
|
+
SCHEMA_ATTRIBUTES = %w[
|
8
|
+
id
|
9
|
+
constants
|
10
|
+
declarations
|
11
|
+
entities
|
12
|
+
functions
|
13
|
+
interfaces
|
14
|
+
procedures
|
15
|
+
rules
|
16
|
+
subtype_constraints
|
17
|
+
types
|
18
|
+
version
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def serialize_document(repository)
|
24
|
+
repository.schemas.each_with_object({}) do |schema, res|
|
25
|
+
res["schemas"] ||= []
|
26
|
+
serialized_schema = SCHEMA_ATTRIBUTES.each_with_object({}) do |name, nested_res|
|
27
|
+
attr_value = schema.send(name)
|
28
|
+
nested_res[name] = serialize_value(attr_value)
|
29
|
+
end
|
30
|
+
res[schema.id] = serialized_schema
|
31
|
+
res["schemas"].push(serialized_schema)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/lutaml/parser.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require "lutaml/express"
|
2
|
+
require "lutaml/uml"
|
3
|
+
require "lutaml/uml/lutaml_path/document_wrapper"
|
4
|
+
require "lutaml/express/lutaml_path/document_wrapper"
|
2
5
|
|
3
6
|
module Lutaml
|
4
7
|
module Parser
|
@@ -9,6 +12,9 @@ module Lutaml
|
|
9
12
|
when "exp"
|
10
13
|
Lutaml::Express::LutamlPath::DocumentWrapper
|
11
14
|
.new(Lutaml::Express::Parsers::Exp.parse(file))
|
15
|
+
when "lutaml"
|
16
|
+
Lutaml::Uml::LutamlPath::DocumentWrapper
|
17
|
+
.new(Lutaml::Uml::Parsers::Dsl.parse(file))
|
12
18
|
else
|
13
19
|
raise ArgumentError, "Unsupported file format"
|
14
20
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "lutaml/lutaml_path/document_wrapper"
|
2
|
+
|
3
|
+
module Lutaml
|
4
|
+
module Uml
|
5
|
+
module LutamlPath
|
6
|
+
class DocumentWrapper < ::Lutaml::LutamlPath::DocumentWrapper
|
7
|
+
protected
|
8
|
+
|
9
|
+
def serialize_document(document)
|
10
|
+
serialize_to_hash(document)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/lutaml/version.rb
CHANGED
data/lutaml.gemspec
CHANGED
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_runtime_dependency "thor", "~> 1.0"
|
28
28
|
# spec.add_runtime_dependency "activesupport", "~> 5.0"
|
29
|
-
|
29
|
+
spec.add_runtime_dependency "lutaml-uml", "~> 0.2.5"
|
30
30
|
# spec.add_runtime_dependency "lutaml-sysml"
|
31
|
-
spec.add_runtime_dependency "lutaml-express", "~> 0.1.
|
31
|
+
spec.add_runtime_dependency "lutaml-express", "~> 0.1.3"
|
32
32
|
spec.add_development_dependency "jmespath", "~> 1.4"
|
33
33
|
spec.add_development_dependency "nokogiri", "~> 1.10"
|
34
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lutaml-uml
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.5
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.2.5
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: lutaml-express
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
47
|
+
version: 0.1.3
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.
|
54
|
+
version: 0.1.3
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jmespath
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,8 +184,10 @@ files:
|
|
170
184
|
- bin/console
|
171
185
|
- bin/setup
|
172
186
|
- lib/lutaml.rb
|
187
|
+
- lib/lutaml/express/lutaml_path/document_wrapper.rb
|
173
188
|
- lib/lutaml/lutaml_path/document_wrapper.rb
|
174
189
|
- lib/lutaml/parser.rb
|
190
|
+
- lib/lutaml/uml/lutaml_path/document_wrapper.rb
|
175
191
|
- lib/lutaml/version.rb
|
176
192
|
- lutaml.gemspec
|
177
193
|
homepage: https://github.com/lutaml/lutaml
|