expressir 1.2.0-x86_64-linux → 1.2.4-x86_64-linux

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: d3ebe1937474a29eeeb05e0f89b76aefd3553eb98f5488b52b84219581dada81
4
- data.tar.gz: 28e673af96e786534d2fce50e83fb9559f9dc58403503067cfcfdcd0fc771fa1
3
+ metadata.gz: f36da625d56d39c449e6bc7f4d88e196ec188806cd1e29a36ea12f3ae656f119
4
+ data.tar.gz: b8a0f3367ec4bc552dd92ea3026b0879176a57a48dac16516643fab892a2c0ce
5
5
  SHA512:
6
- metadata.gz: 8c46618fb9c120c6b68deb9cba0b81fe285e7c78119f31219a7d0398d3c470a80d69868f983847d2087cddb433e4f93f9c208385301770793ee13fdcfcfaa1cc
7
- data.tar.gz: c89de7500f4afe7701ea416d1672ca1e52336c544d22117e90e65128b081a50a9c2f8f4e67d1e14a9d86d08fe12734203dc80fb894d3ad00ee581d4941a2b43d
6
+ metadata.gz: 8ebc31547c503980b41710fe0e6ffc5557e0697b277c61b914c8b52111e337d74e05a5b79857f674cae8bd08f48dde758dd9df207659ca685a9cfade560235ac
7
+ data.tar.gz: '0995fa5a25d434bdc535ed3ddfbd5e031b2ae02df3b26ca2609992dda1943e288180b8dcf05af139c113a72619ed8a7a9eb7a585c98fe7f59a692f566bb08068'
data/.cross_rubies CHANGED
@@ -1,30 +1,21 @@
1
+ 3.1.0:i686-w64-mingw32
2
+ 3.1.0:x86_64-w64-mingw32
3
+ 3.1.0:i686-linux-gnu
4
+ 3.1.0:x86_64-linux-gnu
5
+ 3.1.0:aarch64-linux-gnu
6
+ 3.1.0:x86_64-darwin
7
+ 3.1.0:arm64-darwin
1
8
  3.0.0:i686-w64-mingw32
2
9
  3.0.0:x86_64-w64-mingw32
3
10
  3.0.0:i686-linux-gnu
4
11
  3.0.0:x86_64-linux-gnu
12
+ 3.0.0:aarch64-linux-gnu
5
13
  3.0.0:x86_64-darwin
6
14
  3.0.0:arm64-darwin
7
15
  2.7.0:i686-w64-mingw32
8
16
  2.7.0:x86_64-w64-mingw32
9
17
  2.7.0:i686-linux-gnu
10
18
  2.7.0:x86_64-linux-gnu
19
+ 2.7.0:aarch64-linux-gnu
11
20
  2.7.0:x86_64-darwin
12
21
  2.7.0:arm64-darwin
13
- 2.6.0:i686-w64-mingw32
14
- 2.6.0:x86_64-w64-mingw32
15
- 2.6.0:i686-linux-gnu
16
- 2.6.0:x86_64-linux-gnu
17
- 2.6.0:x86_64-darwin
18
- 2.6.0:arm64-darwin
19
- 2.5.0:i686-w64-mingw32
20
- 2.5.0:x86_64-w64-mingw32
21
- 2.5.0:i686-linux-gnu
22
- 2.5.0:x86_64-linux-gnu
23
- 2.5.0:x86_64-darwin
24
- 2.5.0:arm64-darwin
25
- 2.4.0:i686-w64-mingw32
26
- 2.4.0:x86_64-w64-mingw32
27
- 2.4.0:i686-linux-gnu
28
- 2.4.0:x86_64-linux-gnu
29
- 2.4.0:x86_64-darwin
30
- 2.4.0:arm64-darwin
@@ -8,72 +8,84 @@ on:
8
8
  jobs:
9
9
  rake:
10
10
  name: test on ruby-${{ matrix.ruby }} ${{ matrix.os }}
11
- runs-on: ${{ matrix.os }}
11
+ runs-on: ${{ matrix.os }}
12
12
  continue-on-error: ${{ matrix.experimental }}
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby: [ '2.7', '2.6', '2.5' ]
16
+ ruby: [ '3.1', '3.0', '2.7' ]
17
17
  os: [ ubuntu-latest, windows-latest, macos-latest ]
18
18
  experimental: [ false ]
19
19
  include:
20
- - ruby: '3.0'
20
+ - ruby: 'head'
21
21
  os: 'ubuntu-latest'
22
22
  experimental: true
23
- - ruby: '3.0'
23
+ - ruby: 'head'
24
24
  os: 'windows-latest'
25
25
  experimental: true
26
- - ruby: '3.0'
26
+ - ruby: 'head'
27
27
  os: 'macos-latest'
28
28
  experimental: true
29
29
 
30
30
  steps:
31
- - uses: actions/checkout@v2
31
+ - name: Checkout
32
+ uses: actions/checkout@v2
32
33
  with:
33
34
  submodules: recursive
34
35
 
35
- - if: matrix.os == 'macos-latest'
36
+ - name: Setup packages
37
+ if: startsWith(matrix.os, 'macos')
36
38
  run: brew install autoconf automake libtool
37
39
 
38
- - uses: ruby/setup-ruby@v1
40
+ - name: Install Ruby
41
+ uses: ruby/setup-ruby@v1
39
42
  with:
40
43
  ruby-version: ${{ matrix.ruby }}
41
44
  bundler-cache: true
42
45
 
43
- - uses: actions/cache@v2
46
+ - name: Process cache
47
+ uses: actions/cache@v2
48
+ id: cache
44
49
  with:
45
50
  path: lib/expressir/express/express_parser.*
46
51
  key: v4-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}
47
52
 
48
- - if: hashFiles('lib/expressir/express/express_parser.*') == ''
53
+ - name: Build native extension
54
+ if: steps.cache.outputs.cache-hit != 'true'
49
55
  run: bundle exec rake compile
50
56
 
51
- - run: bundle exec rake
57
+ - name: Run tests
58
+ run: bundle exec rake
52
59
 
53
60
  # test release workflow
54
61
  pack:
55
- runs-on: ubuntu-18.04
62
+ runs-on: ubuntu-latest
56
63
  strategy:
57
64
  fail-fast: false
58
65
  matrix:
59
66
  host: [ linux, windows, darwin ]
60
67
  steps:
61
- - uses: actions/checkout@v2
68
+ - name: Checkout
69
+ uses: actions/checkout@v2
62
70
  with:
63
71
  submodules: recursive
64
72
 
65
- - uses: ruby/setup-ruby@v1
73
+ - name: Setup Ruby
74
+ uses: ruby/setup-ruby@v1
66
75
  with:
67
- ruby-version: '2.6'
76
+ ruby-version: '3.0'
68
77
  # bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
69
78
  # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
70
79
 
71
- - run: bundle install --jobs 4 --retry 3
80
+ - name: Bundle
81
+ run: bundle install --jobs 4 --retry 3
72
82
 
73
- # build gem WITHOUT pre-built native extension
74
- - run: gem build expressir.gemspec
83
+ - name: Build gem without native extension
84
+ if: matrix.host == 'linux'
85
+ run: gem build expressir.gemspec
75
86
 
76
- - if: matrix.host == 'linux'
87
+ - name: Package gem without native extension
88
+ if: matrix.host == 'linux'
77
89
  uses: actions/upload-artifact@v2
78
90
  with:
79
91
  name: pkg-ruby
@@ -87,10 +99,11 @@ jobs:
87
99
  sudo swapon /compile.swap
88
100
  sudo swapon --all --verbose
89
101
 
90
- # build gem WITH pre-built native extension
91
- - run: bundle exec rake gem:${{ matrix.host }}
102
+ - name: Build gem with native extension
103
+ run: bundle exec rake gem:${{ matrix.host }}
92
104
 
93
- - uses: actions/upload-artifact@v2
105
+ - name: Package gem with native extension
106
+ uses: actions/upload-artifact@v2
94
107
  with:
95
108
  name: pkg-${{ matrix.host }}
96
109
  path: pkg/*.gem
@@ -21,7 +21,7 @@ jobs:
21
21
 
22
22
  - uses: ruby/setup-ruby@v1
23
23
  with:
24
- ruby-version: '2.6'
24
+ ruby-version: '3.0'
25
25
 
26
26
  - if: ${{ github.event_name == 'workflow_dispatch' }} # unfortunatelly cannot keep this condition on job level
27
27
  run: |
@@ -41,10 +41,11 @@ jobs:
41
41
  - uses: actions/checkout@v2
42
42
  with:
43
43
  submodules: recursive
44
+ ref: main # https://github.com/actions/checkout/issues/439#issuecomment-830862188
44
45
 
45
46
  - uses: ruby/setup-ruby@v1
46
47
  with:
47
- ruby-version: '2.6'
48
+ ruby-version: '3.0'
48
49
  # bundler-cache: true important to not use cache because it leads to "cannot find -lrice"
49
50
  # more info https://github.com/lutaml/expressir/runs/2097658383?check_suite_focus=true#step:7:2126
50
51
 
@@ -101,7 +102,7 @@ jobs:
101
102
 
102
103
  - uses: ruby/setup-ruby@v1
103
104
  with:
104
- ruby-version: '2.6'
105
+ ruby-version: '3.0'
105
106
 
106
107
  - run: ls -l pkg/
107
108
 
data/.gitignore CHANGED
@@ -15,3 +15,4 @@
15
15
  .rspec_status
16
16
 
17
17
  /ext/express-parser/rice-embed
18
+ /lib/expressir/express/express_parser.so
data/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "ext/express-parser/antlr4-upstream"]
2
2
  path = ext/express-parser/antlr4-upstream
3
- url = git://github.com/antlr/antlr4
3
+ url = https://github.com/antlr/antlr4
data/expressir.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Ribose Inc."]
9
9
  spec.email = ["open.source@ribose.com'"]
10
10
 
11
- spec.summary = "ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models."
12
- spec.description = "ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models."
11
+ spec.summary = "ISO EXPRESS parser and tools in Ruby."
12
+ spec.description = "Expressir (“EXPRESS in Ruby”) is a Ruby parser for EXPRESS and a set of Ruby tools for accessing ISO EXPRESS data models."
13
13
  spec.homepage = "https://github.com/lutaml/expressir"
14
14
  spec.license = "MIT"
15
15
 
@@ -33,23 +33,26 @@ module Expressir
33
33
  def self.from_file(file, skip_references: nil, include_source: nil)
34
34
  input = File.read(file)
35
35
 
36
- parser = ::ExpressParser::Parser.parse(input)
36
+ # An important note re memory management
37
+ # parse, syntax, visitor methods return complex tree structures created in netive (C++) extension
38
+ # visit method references nodes and leaves of this structures but it is totally untransparent for Ruby GarbageCllector
39
+ # so in this class we keep those C++ structure marked for GC so theu are not freed
40
+ @parser = ::ExpressParser::Parser.parse(input)
41
+ @parse_tree = @parser.syntax()
37
42
 
38
- parse_tree = parser.syntax()
43
+ @visitor = Visitor.new(@parser.tokens, include_source: include_source)
44
+ @repository = @visitor.visit(@parse_tree)
39
45
 
40
- visitor = Visitor.new(parser.tokens, include_source: include_source)
41
- repository = visitor.visit(parse_tree)
42
-
43
- repository.schemas.each do |schema|
46
+ @repository.schemas.each do |schema|
44
47
  schema.file = file.to_s
45
48
  end
46
49
 
47
50
  unless skip_references
48
- resolve_references_model_visitor = ResolveReferencesModelVisitor.new
49
- resolve_references_model_visitor.visit(repository)
51
+ @resolve_references_model_visitor = ResolveReferencesModelVisitor.new
52
+ @resolve_references_model_visitor.visit(@repository)
50
53
  end
51
54
 
52
- repository
55
+ @repository
53
56
  end
54
57
 
55
58
  # Parses Express files into an Express model
@@ -65,16 +68,16 @@ module Expressir
65
68
  repository.schemas
66
69
  end.flatten
67
70
 
68
- repository = Model::Repository.new(
71
+ @repository = Model::Repository.new(
69
72
  schemas: schemas
70
73
  )
71
74
 
72
- unless skip_references
73
- resolve_references_model_visitor = ResolveReferencesModelVisitor.new
74
- resolve_references_model_visitor.visit(repository)
75
+ unless @skip_references
76
+ @resolve_references_model_visitor = ResolveReferencesModelVisitor.new
77
+ @resolve_references_model_visitor.visit(@repository)
75
78
  end
76
79
 
77
- repository
80
+ @repository
78
81
  end
79
82
  end
80
83
  end
@@ -138,7 +138,9 @@ module Expressir
138
138
  end
139
139
 
140
140
  def attach_remarks(ctx, node)
141
- remark_tokens = get_tokens(ctx).select{|x| x.channel == REMARK_CHANNEL}
141
+ remark_tokens = get_tokens(ctx)
142
+ remark_tokens = remark_tokens.select{ |x| x.channel == REMARK_CHANNEL
143
+ }
142
144
 
143
145
  # skip already attached remarks
144
146
  remark_tokens = remark_tokens.select{|x| !@attached_remark_tokens.include?(x)}
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.2.4".freeze
3
3
  end
@@ -44,6 +44,8 @@ CrossRuby = Struct.new(:version, :host) do
44
44
  "x86-mingw32"
45
45
  when /\Ax86_64.*linux/
46
46
  "x86_64-linux"
47
+ when /\A(arm64|aarch64).*linux/
48
+ "aarch64-linux"
47
49
  when /\Ai[3-6]86.*linux/
48
50
  "x86-linux"
49
51
  when /\Ax86_64-darwin/
@@ -63,6 +65,8 @@ CrossRuby = Struct.new(:version, :host) do
63
65
  "i686-w64-mingw32-"
64
66
  when "x86_64-linux"
65
67
  "x86_64-redhat-linux-"
68
+ when "aarch64-linux"
69
+ "aarch64-redhat-linux-"
66
70
  when "x86-linux"
67
71
  "i686-redhat-linux-"
68
72
  when /x86_64.*darwin/
@@ -82,6 +86,8 @@ CrossRuby = Struct.new(:version, :host) do
82
86
  "pei-i386"
83
87
  when "x86_64-linux"
84
88
  "elf64-x86-64"
89
+ when "aarch64-linux"
90
+ "elf64-arm64"
85
91
  when "x86-linux"
86
92
  "elf32-i386"
87
93
  when "x86_64-darwin"
@@ -245,12 +251,14 @@ def gem_builder(plat)
245
251
  end
246
252
 
247
253
  namespace "gem" do
254
+ REDHAT_PREREQ = "sudo yum install -y git"
255
+ UBUNTU_PREREQ = "sudo apt-get update -y && sudo apt-get install -y automake autoconf libtool build-essential"
248
256
  CROSS_RUBIES.find_all { |cr| cr.windows? || cr.linux? || cr.darwin? }.map(&:platform).uniq.each do |plat|
249
257
  pre_req = case plat
250
258
  when /\linux/
251
- "sudo yum install -y git"
259
+ "if [[ $(awk -F= '/^NAME/{print $2}' /etc/os-release) == '\"Ubuntu\"' ]]; then #{UBUNTU_PREREQ}; else #{REDHAT_PREREQ}; fi"
252
260
  else
253
- "sudo apt-get update -y && sudo apt-get install -y automake autoconf libtool build-essential"
261
+ "#{UBUNTU_PREREQ}"
254
262
  end
255
263
  desc "build native gem for #{plat} platform"
256
264
  task plat do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.4
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-20 00:00:00.000000000 Z
11
+ date: 2022-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -178,7 +178,8 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 1.7.0
181
- description: ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models.
181
+ description: Expressir (“EXPRESS in Ruby”) is a Ruby parser for EXPRESS and a set
182
+ of Ruby tools for accessing ISO EXPRESS data models.
182
183
  email:
183
184
  - open.source@ribose.com'
184
185
  executables:
@@ -212,11 +213,9 @@ files:
212
213
  - lib/expressir/cli.rb
213
214
  - lib/expressir/cli/ui.rb
214
215
  - lib/expressir/config.rb
215
- - lib/expressir/express/2.4/express_parser.so
216
- - lib/expressir/express/2.5/express_parser.so
217
- - lib/expressir/express/2.6/express_parser.so
218
216
  - lib/expressir/express/2.7/express_parser.so
219
217
  - lib/expressir/express/3.0/express_parser.so
218
+ - lib/expressir/express/3.1/express_parser.so
220
219
  - lib/expressir/express/cache.rb
221
220
  - lib/expressir/express/formatter.rb
222
221
  - lib/expressir/express/hyperlink_formatter.rb
@@ -382,10 +381,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
382
381
  requirements:
383
382
  - - ">="
384
383
  - !ruby/object:Gem::Version
385
- version: '2.4'
384
+ version: '2.7'
386
385
  - - "<"
387
386
  - !ruby/object:Gem::Version
388
- version: 3.1.dev
387
+ version: 3.2.dev
389
388
  required_rubygems_version: !ruby/object:Gem::Requirement
390
389
  requirements:
391
390
  - - ">="
@@ -395,5 +394,5 @@ requirements: []
395
394
  rubygems_version: 3.3.4
396
395
  signing_key:
397
396
  specification_version: 4
398
- summary: ISO EXPRESS parser in Ruby, tools for accessing EXPRESS data models.
397
+ summary: ISO EXPRESS parser and tools in Ruby.
399
398
  test_files: []