lutaml 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 778331709b63955afae5ec2639758cd7d2ce68716f924552810eca11164bc2fc
4
- data.tar.gz: bfcc945badadc762e377ece6d56fecb6138bcdb268837514c841fb93dc38c7d0
3
+ metadata.gz: 1927c6eca5571747313bd1f8f523fb7b7a469f3bb56c354e4fbdf3947c11ee8e
4
+ data.tar.gz: 52d43df8507b54408f5435033a385cf6f0d4ce6f2703a9ba308143dc24d0cb07
5
5
  SHA512:
6
- metadata.gz: 67658e85d724a926f0487cb5441b9581800406d857c43fd3cb51fbb747e6607e188e9556a79f44a720577ae2bd8f5b93d3b5a0eebeeb89fcbfd67a66063282e3
7
- data.tar.gz: 3cc650c16223c5384eb84c743c6b1f2c739adac4819ec0a8afc87be3b012938447e5cd609fbfaa6327f1fec3c4b378b1af36f065501da8a33d993b7b6e633e68
6
+ metadata.gz: 22a613b2fc780af4aeaeb2b6977153f58b633335f241ff2c93fde544fbcb201d9ca8e46a866dc91b08607deac37c4bc1d1cd00c1f8f2dfc03ecbed1b7630791a
7
+ data.tar.gz: 700a0d0a1174c74632dc68c2b4f2c6265982e304cd1a30f1348323cb9646e9ae86d43ffb416cd9ff3b9c5b6ab0a438b4d524493f334cec32720f4025a1d3c362
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem "expressir"
4
+
3
5
  # Specify your gem's dependencies in lutaml.gemspec
4
6
  gemspec
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 parse_type == "exp"
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 parse_type == "exp"
55
+ if ["exp", EXPRESS_CACHE_PARSE_TYPE].include?(parse_type)
51
56
  return Lutaml::Express::LutamlPath::DocumentWrapper.new(document)
52
57
  end
53
58
 
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.4.1".freeze
2
+ VERSION = "0.5.0".freeze
3
3
  end
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.1
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-08 00:00:00.000000000 Z
11
+ date: 2021-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-express