lutaml 0.4.1 → 0.5.0
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 +4 -4
- data/Gemfile +2 -0
- data/README.adoc +3 -1
- data/lib/lutaml/lutaml_path/document_wrapper.rb +2 -1
- data/lib/lutaml/parser.rb +7 -2
- data/lib/lutaml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1927c6eca5571747313bd1f8f523fb7b7a469f3bb56c354e4fbdf3947c11ee8e
|
4
|
+
data.tar.gz: 52d43df8507b54408f5435033a385cf6f0d4ce6f2703a9ba308143dc24d0cb07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22a613b2fc780af4aeaeb2b6977153f58b633335f241ff2c93fde544fbcb201d9ca8e46a866dc91b08607deac37c4bc1d1cd00c1f8f2dfc03ecbed1b7630791a
|
7
|
+
data.tar.gz: 700a0d0a1174c74632dc68c2b4f2c6265982e304cd1a30f1348323cb9646e9ae86d43ffb416cd9ff3b9c5b6ab0a438b4d524493f334cec32720f4025a1d3c362
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
@@ -37,7 +37,9 @@ In order to parse files supported by lutaml extensions, use Lutaml::Parser.parse
|
|
37
37
|
[source,ruby]
|
38
38
|
----
|
39
39
|
# example.exp is an EXPRESS repository file
|
40
|
-
Lutaml::Parser.parse(File.new("example.exp")) # will produce Lutaml::LutamlPath::DocumentWrapper object with serialized express repository
|
40
|
+
Lutaml::Parser.parse([File.new("example.exp")]) # will produce Lutaml::LutamlPath::DocumentWrapper object with serialized express repository
|
41
|
+
# example.yaml is an EXPRESS cache file
|
42
|
+
Lutaml::Parser.parse([File.new("example.yaml")], ::Lutaml::Parser::EXPRESS_CACHE_PARSE_TYPE)
|
41
43
|
----
|
42
44
|
|
43
45
|
== With cli tool
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module Lutaml
|
2
2
|
module LutamlPath
|
3
3
|
class DocumentWrapper
|
4
|
-
attr_reader :serialized_document
|
4
|
+
attr_reader :serialized_document, :original_document
|
5
5
|
|
6
6
|
def initialize(document)
|
7
|
+
@original_document = document
|
7
8
|
@serialized_document = serialize_document(document)
|
8
9
|
end
|
9
10
|
|
data/lib/lutaml/parser.rb
CHANGED
@@ -2,9 +2,12 @@ require "lutaml/express"
|
|
2
2
|
require "lutaml/uml"
|
3
3
|
require "lutaml/uml/lutaml_path/document_wrapper"
|
4
4
|
require "lutaml/express/lutaml_path/document_wrapper"
|
5
|
+
require "expressir/express_exp/cache"
|
5
6
|
|
6
7
|
module Lutaml
|
7
8
|
class Parser
|
9
|
+
EXPRESS_CACHE_PARSE_TYPE = "exp.cache".freeze
|
10
|
+
|
8
11
|
attr_reader :parse_type, :file_list
|
9
12
|
|
10
13
|
class << self
|
@@ -26,7 +29,7 @@ module Lutaml
|
|
26
29
|
|
27
30
|
def parse
|
28
31
|
documents = parse_into_document
|
29
|
-
return [document_wrapper(documents)] if
|
32
|
+
return [document_wrapper(documents)] if ["exp", EXPRESS_CACHE_PARSE_TYPE].include?(parse_type)
|
30
33
|
|
31
34
|
documents.map { |doc| document_wrapper(doc) }
|
32
35
|
end
|
@@ -35,6 +38,8 @@ module Lutaml
|
|
35
38
|
case parse_type
|
36
39
|
when "exp"
|
37
40
|
Expressir::ExpressExp::Parser.from_files(file_list.map(&:path))
|
41
|
+
when EXPRESS_CACHE_PARSE_TYPE
|
42
|
+
Expressir::ExpressExp::Cache.from_file(file_list.first.path)
|
38
43
|
when "lutaml"
|
39
44
|
file_list.map { |file| Lutaml::Uml::Parsers::Dsl.parse(file) }
|
40
45
|
when "yml"
|
@@ -47,7 +52,7 @@ module Lutaml
|
|
47
52
|
private
|
48
53
|
|
49
54
|
def document_wrapper(document)
|
50
|
-
if
|
55
|
+
if ["exp", EXPRESS_CACHE_PARSE_TYPE].include?(parse_type)
|
51
56
|
return Lutaml::Express::LutamlPath::DocumentWrapper.new(document)
|
52
57
|
end
|
53
58
|
|
data/lib/lutaml/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-express
|