lutaml-express 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: cfc0bc6b2ffb2f237b0feecae3c16fc2989f7c90bdfec27f39b1c8eab2f9e532
4
- data.tar.gz: 55fade4b6c10f2521dd404bd0cc1934a73128c5d6c5d273c90022e9cf422413e
3
+ metadata.gz: 186bebe05de57a700b45e296dabab446a4029352488a03f6439266ce9aee2f1e
4
+ data.tar.gz: 2f5c29642b6abf6de7f79d76ca3e5b04d4b6319a058ec86dbf7fc15cf3c2ee43
5
5
  SHA512:
6
- metadata.gz: b7acf19de4cd29f7344c3d1638ca57b44d55c01c02fb651a7d4a965853a56a1c702dbc3e5c1ac6acf2264d9db3fe9ad19e420fd436564a56301802cda25e60f6
7
- data.tar.gz: 3c1db516c6f26b796428eeef5073bb7d934862a6afaacadd99ce933a8aacdd15e2d3f727a7be6f5742996b98888cd1bca15fd91865fad18f6a2926adae53dede
6
+ metadata.gz: 180628e30407629fff9e9f98039ac1864008d496ba1d1c50919692b21cc59169b41777c6a9c15fb9e196448cc658503ae03ea8d2a791471cd3029f010e3fbd5e
7
+ data.tar.gz: f098b29854f5a29213a1e6b47a9e7ad14c5c159a220040b079d9418c2c4d3d8400bb5274f4d607c95222ff4a2b72b34da72887c9966b337eb28da1fd4468c92e
@@ -0,0 +1,49 @@
1
+ name: rake
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, main ]
6
+ tags: [ v* ]
7
+ pull_request:
8
+
9
+ jobs:
10
+ rake:
11
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ continue-on-error: ${{ matrix.experimental }}
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
18
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
19
+ experimental: [ false ]
20
+ include:
21
+ - ruby: '3.0'
22
+ os: 'ubuntu-latest'
23
+ experimental: true
24
+ - ruby: '3.0'
25
+ os: 'windows-latest'
26
+ experimental: true
27
+ - ruby: '3.0'
28
+ os: 'macos-latest'
29
+ experimental: true
30
+ steps:
31
+ - uses: actions/checkout@master
32
+
33
+ - uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ bundler-cache: true
37
+
38
+ - run: bundle exec rake
39
+
40
+ tests-passed:
41
+ needs: rake
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: peter-evans/repository-dispatch@v1
45
+ with:
46
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
47
+ repository: ${{ github.repository }}
48
+ event-type: notify
49
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
@@ -0,0 +1,43 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ next_version:
7
+ description: |
8
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
9
+ required: true
10
+ default: 'patch'
11
+ push:
12
+ tags: [ v* ]
13
+
14
+ jobs:
15
+ release:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ bundler-cache: true
24
+
25
+ - run: gem install gem-release
26
+
27
+ - if: ${{ github.event_name == 'workflow_dispatch' }}
28
+ run: |
29
+ git config user.name github-actions
30
+ git config user.email github-actions@github.com
31
+ gem bump --version ${{ github.event.inputs.next_version }} --tag --push
32
+
33
+ - name: publish to rubygems.org
34
+ env:
35
+ RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
36
+ run: |
37
+ gem install gem-release
38
+ cat > ~/.gem/credentials << EOF
39
+ ---
40
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
41
+ EOF
42
+ chmod 0600 ~/.gem/credentials
43
+ gem release
data/Gemfile CHANGED
@@ -6,7 +6,5 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 12.0"
9
- gem "lutaml",
10
- git: "git@github.com:lutaml/lutaml.git",
11
- branch: "feature/objects-lookup-dsl"
9
+ gem "lutaml", "~> 0.3.0"
12
10
  gem "jmespath", "~> 1.4"
data/README.adoc CHANGED
@@ -1,3 +1,7 @@
1
+ image:https://img.shields.io/gem/v/lutaml-express.svg["Gem Version", link="https://rubygems.org/gems/lutaml-express"]
2
+ // image:https://codeclimate.com/github/lutaml/lutaml-express/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/lutaml/lutaml-express"]
3
+ image:https://github.com/lutaml/lutaml-express/workflows/rake/badge.svg["Build Status", link="https://github.com/lutaml/lutaml-express/actions?workflow=rake"]
4
+
1
5
  = lutaml-express
2
6
 
3
7
  == Functionality
@@ -48,4 +52,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
48
52
 
49
53
  == Code of Conduct
50
54
 
51
- Everyone interacting in the Lutaml::Uml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lutaml-express/blob/master/CODE_OF_CONDUCT.md).
55
+ Everyone interacting in the Lutaml::Uml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lutaml-express/blob/master/CODE_OF_CONDUCT.md).
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "lutaml/express/version"
4
4
  require "lutaml/express/parsers/exp"
5
- require 'lutaml/express/lutaml_path/document_wrapper'
6
5
 
7
6
  module Lutaml
8
7
  module Express
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'expressir'
4
- require 'expressir/express_exp/parser'
4
+ require 'expressir/express/parser'
5
5
 
6
6
  module Lutaml
7
7
  module Express
@@ -13,7 +13,7 @@ module Lutaml
13
13
  #
14
14
  # @return [Expressir::Model::Repository]
15
15
  def self.parse(io, options = {})
16
- Expressir::ExpressExp::Parser.from_exp(io.path)
16
+ Expressir::Express::Parser.from_file(io.path)
17
17
  end
18
18
  end
19
19
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Express
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -23,13 +23,12 @@ Gem::Specification.new do |spec|
23
23
  spec.bindir = "exe"
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_runtime_dependency "expressir", "~> 0.2.0"
26
+ spec.add_runtime_dependency "expressir", "~> 1.0.0"
27
27
 
28
28
  spec.add_development_dependency "byebug"
29
29
  spec.add_development_dependency "nokogiri", "~> 1.10"
30
30
  spec.add_development_dependency "rubocop", "~> 0.54.0"
31
31
  spec.add_development_dependency "bundler", "~> 2.0"
32
- spec.add_development_dependency "pry", "~> 0.12.2"
33
32
  spec.add_development_dependency "rake", "~> 10.0"
34
33
  spec.add_development_dependency "rspec", "~> 3.0"
35
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-express
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
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-24 00:00:00.000000000 Z
11
+ date: 2021-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 1.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
- - !ruby/object:Gem::Dependency
84
- name: pry
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.12.2
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.12.2
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rake
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -129,9 +115,8 @@ executables: []
129
115
  extensions: []
130
116
  extra_rdoc_files: []
131
117
  files:
132
- - ".github/workflows/macos.yml"
133
- - ".github/workflows/ubuntu.yml"
134
- - ".github/workflows/windows.yml"
118
+ - ".github/workflows/rake.yml"
119
+ - ".github/workflows/release.yml"
135
120
  - ".gitignore"
136
121
  - CODE_OF_CONDUCT.md
137
122
  - Gemfile
@@ -140,12 +125,10 @@ files:
140
125
  - bin/console
141
126
  - bin/setup
142
127
  - lib/lutaml/express.rb
143
- - lib/lutaml/express/lutaml_path/document_wrapper.rb
144
128
  - lib/lutaml/express/parsers/exp.rb
145
129
  - lib/lutaml/express/version.rb
146
130
  - lutaml-express.gemspec
147
131
  - spec/express/express_spec.rb
148
- - spec/express/lutaml_path/document_wrapper_spec.rb
149
132
  - spec/express/parsers/exp_spec.rb
150
133
  - spec/fixtures/test.exp
151
134
  - spec/spec_helper.rb
@@ -1,36 +0,0 @@
1
- name: macos
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- paths-ignore:
8
- - .github/workflows/ubuntu.yml
9
- - .github/workflows/windows.yml
10
-
11
- jobs:
12
- test-macos:
13
- name: Test on Ruby ${{ matrix.ruby }} macOS
14
- runs-on: macos-latest
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
20
- experimental: [false]
21
- include:
22
- - ruby: '2.7'
23
- experimental: true
24
- steps:
25
- - uses: actions/checkout@master
26
- - name: Use Ruby
27
- uses: actions/setup-ruby@v1
28
- with:
29
- ruby-version: ${{ matrix.ruby }}
30
- - name: Update gems
31
- run: |
32
- sudo gem install bundler --force
33
- bundle install --jobs 4 --retry 3
34
- - name: Run specs
35
- run: |
36
- bundle exec rake
@@ -1,38 +0,0 @@
1
- name: ubuntu
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- tags:
7
- - '*'
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/windows.yml
12
-
13
- jobs:
14
- test-linux:
15
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
16
- runs-on: ubuntu-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Update gems
33
- run: |
34
- gem install bundler
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,41 +0,0 @@
1
- name: windows
2
-
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- paths-ignore:
8
- - .github/workflows/macos.yml
9
- - .github/workflows/ubuntu.yml
10
-
11
- jobs:
12
- test-windows:
13
- name: Test on Ruby ${{ matrix.ruby }} Windows
14
- runs-on: windows-latest
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
20
- experimental: [false]
21
- # Does not supported yet:
22
- # Ruby (< 2.7.dev, >= 2.3), which is required by gem 'nokogiri (~> 1.10)', is not
23
- # available in the local ruby installation
24
- # include:
25
- # - ruby: '2.7'
26
- # experimental: true
27
- steps:
28
- - uses: actions/checkout@master
29
- - name: Use Ruby
30
- uses: actions/setup-ruby@v1
31
- with:
32
- ruby-version: ${{ matrix.ruby }}
33
- - name: Update gems
34
- shell: pwsh
35
- run: |
36
- gem install bundler
37
- bundle config --local path vendor/bundle
38
- bundle install --jobs 4 --retry 3
39
- - name: Run specs
40
- run: |
41
- bundle exec rake
@@ -1,37 +0,0 @@
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,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- RSpec.describe Lutaml::Express::LutamlPath::DocumentWrapper do
6
- describe ".parse" do
7
- subject(:lutaml_path) { described_class.new(repository) }
8
- subject(:serialized_document) do
9
- lutaml_path.serialized_document
10
- end
11
-
12
- context "when simple diagram without attributes" do
13
- let(:repository) do
14
- Lutaml::Express::Parsers::Exp.parse(File.new(fixtures_path("test.exp")))
15
- end
16
- let(:schema) { 'annotated_3d_model_data_quality_criteria_schema' }
17
- let(:entities_names) do
18
- %w[
19
- a3m_data_quality_criteria_representation
20
- a3m_data_quality_criterion
21
- a3m_data_quality_criterion_specific_applied_value
22
- a3m_data_quality_target_accuracy_association
23
- a3m_detailed_report_request
24
- a3m_summary_report_request_with_representative_value]
25
- end
26
-
27
- it "serializes repository attributes" do
28
- expect(serialized_document.keys).to(eq(['schemas', schema]))
29
- expect(serialized_document['schemas'].map {|n| n['id'] }).to(eq([schema]))
30
- end
31
-
32
- it "correctly finds elements by jmespath expression" do
33
- expect(serialized_document['schemas'].first['entities']
34
- .map {|n| n['id'] }).to(eq(entities_names))
35
- end
36
- end
37
- end
38
- end