lutaml 0.1.0 → 0.2.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: e7f00bf561618a5ec3d7b20029bad9a13d7ab890a2e68e913f240400a4883721
4
- data.tar.gz: bbd6aadab7e336af89b560596b5f4f9424c8888b1c9a6e4149ceced4ea4b247f
3
+ metadata.gz: dd52cb5d4a4e29687299339e3cd9af05720f81348d5a307ae1d07bf2514bd022
4
+ data.tar.gz: 373158747e92e76c14efd7bbfc6d42a9ecebe164ebb5d14f035840a85666ce5d
5
5
  SHA512:
6
- metadata.gz: 996c1f4909adcbc85713ca109bea104371d4c2f87a9c37171f93b8a01d0ea2e29091f0b4838fd06b6a2ec07eacb3bc735c4c991fdf5ee0804a676794db42532c
7
- data.tar.gz: cd43ed7577632c89afcad888c46c38392f4fb827fc248225ba5d6d2d997ab97a5afc672ceca8543caff29ad34d700b42f1e27ebf9fa4eed98aca854c1bf39b66
6
+ metadata.gz: ad0a113798e024375f25c0f580c09b8e17f1b8d8ea60ab1edc67dbfb5250ae9cb6151b44a4f6cd090159d177d08c40361c7b536a1832053f01a5784d580f91da
7
+ data.tar.gz: 6f0e0043a0c0a240763c95d0041ff6ccb462fb81773ecc1f4c5d4dc376942fdebe39f6c9fc5c30df96e8a95a061147cfa2b139dda968aabd6161abeb216f7a66
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ Gemfile.lock
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,4 +1,5 @@
1
1
  require "lutaml/version"
2
+ require "lutaml/lutaml_path/document_wrapper"
2
3
 
3
4
  module Lutaml
4
5
  class Error < StandardError; end
@@ -0,0 +1,26 @@
1
+ require "jmespath"
2
+
3
+ module Lutaml
4
+ module LutamlPath
5
+ class DocumentWrapper
6
+ attr_reader :serialized_document
7
+
8
+ def initialize(document)
9
+ @serialized_document = serialize_document(document)
10
+ end
11
+
12
+ # Method for traversing document` structure
13
+ # example for lutaml: wrapper.find('//#main-doc/main-class/nested-class')
14
+ # Need to return descendant of Lutaml::LutamlPath::EntryWrapper
15
+ def find(path)
16
+ JMESPath.search(path, serialized_document)
17
+ end
18
+
19
+ protected
20
+
21
+ def serialize_document(_path)
22
+ raise ArgumentError, "implement #serialize_document!"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- require_relative 'lib/lutaml/version'
1
+ require_relative "lib/lutaml/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "lutaml"
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
19
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
21
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
22
  end
23
23
  spec.bindir = "exe"
@@ -28,10 +28,12 @@ Gem::Specification.new do |spec|
28
28
  # spec.add_runtime_dependency "activesupport", "~> 5.0"
29
29
  # spec.add_runtime_dependency "lutaml-uml"
30
30
  # spec.add_runtime_dependency "lutaml-sysml"
31
+ spec.add_development_dependency "jmespath", "~> 1.4"
31
32
  spec.add_development_dependency "nokogiri", "~> 1.10"
32
33
 
33
34
  spec.add_development_dependency "bundler", "~> 2.0"
34
35
  spec.add_development_dependency "pry", "~> 0.12.2"
35
36
  spec.add_development_dependency "rake", "~> 10.0"
36
37
  spec.add_development_dependency "rspec", "~> 3.0"
38
+ spec.add_development_dependency "rubocop", "~> 0.54.0"
37
39
  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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-20 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jmespath
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.4'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: nokogiri
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +108,20 @@ dependencies:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
110
  version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.54.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.54.0
97
125
  description: 'LutaML: data models in textual form'
98
126
  email:
99
127
  - open.source@ribose.com'
@@ -111,6 +139,7 @@ files:
111
139
  - bin/console
112
140
  - bin/setup
113
141
  - lib/lutaml.rb
142
+ - lib/lutaml/lutaml_path/document_wrapper.rb
114
143
  - lib/lutaml/version.rb
115
144
  - lutaml.gemspec
116
145
  homepage: https://github.com/lutaml/lutaml
@@ -120,7 +149,7 @@ metadata:
120
149
  homepage_uri: https://github.com/lutaml/lutaml
121
150
  source_code_uri: https://github.com/lutaml/lutaml
122
151
  changelog_uri: https://github.com/lutaml/lutaml/releases
123
- post_install_message:
152
+ post_install_message:
124
153
  rdoc_options: []
125
154
  require_paths:
126
155
  - lib
@@ -135,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
164
  - !ruby/object:Gem::Version
136
165
  version: '0'
137
166
  requirements: []
138
- rubygems_version: 3.0.3
139
- signing_key:
167
+ rubygems_version: 3.0.6
168
+ signing_key:
140
169
  specification_version: 4
141
170
  summary: 'LutaML: data models in textual form'
142
171
  test_files: []