lutaml 0.3.0 → 0.3.1

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: 7354339d27eea082d413223752e3937abef47f1ecc9fde7a72608b1a665577c0
4
- data.tar.gz: 79c2ba8775508bcf5936a533c63ee7fa525295e6424fb25049806bfc2c3cdd92
3
+ metadata.gz: 1bffadc6b3f176ed29fe3d8c001afc02c2f29cb848874af353235d17f7c8657a
4
+ data.tar.gz: b424788eca466bb15faa49ea4802c2a32b7d6d6986833e523a47ed821d9b7307
5
5
  SHA512:
6
- metadata.gz: 655622623e88e8ce43318a7df0d2538b66e3cd3bcb13f3b2d8b6f596df095b500dd5fe3896d54efc758a47d086dbf250b4f70ae46c1157cc2ee5342f4e61d20c
7
- data.tar.gz: edb8143e8237d40c814f4490c121fb234142b2109eef0200955bd495a06543982b9b3618f55ab1187c47fa50c32620979389dd0e45e9c5bf19abc03c6fa1ceb1
6
+ metadata.gz: e6dcff09dc1a2d4560ddea2c2d0f58255769e1ab9c55e75f1641f942c608fb04c1716efc3006bbd015a02a8d2fb383da3c8e1c59068009ea635eb813bf68647c
7
+ data.tar.gz: ead2205b1cc1887b8ec73e0dad6cc5a72cae141f21f725b32433af3b2a12061e2c9b701c94323e978cf4e8727485f500733ad2d5c4c1b305a800c3bcfa96f65c
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in lutaml.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
@@ -1,6 +1,5 @@
1
1
  require "lutaml/version"
2
2
  require "lutaml/parser"
3
- require "lutaml/lutaml_path/document_wrapper"
4
3
 
5
4
  module Lutaml
6
5
  end
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
@@ -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
- # spec.add_runtime_dependency "lutaml-uml"
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.0"
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.0
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-10-26 00:00:00.000000000 Z
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.0
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.0
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