emf2svg 0.1.1 → 1.1.1

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: 2f40393f8fd1ee8fac3c0bac60dd57cdffa37e7c29fe4c84654a1c09fd3eddc6
4
- data.tar.gz: 1177ab6679786bfaa7ee08dec8c38ac52cf7c9367c83a2c8197569950266c7df
3
+ metadata.gz: d2b1f0ca81775a0ea7d4b38e78d8dfbde2c80554f3fd89910e58bef0ec9416a2
4
+ data.tar.gz: d19bbcfdf6d8f4500b18f82da5c833737272b2a2c74289d60a42cfa61ef28fe6
5
5
  SHA512:
6
- metadata.gz: a969bc6a4061541d00b0385951622f0d640d96f2d03a5a9081e9b583b4b60e4527e331ea88c287a9049ace569e85f9473bfaca9d029a5ed0122091ef43778f5c
7
- data.tar.gz: 688381d0362f87e799bbe26a18d673a3eda30f2eaa4e7c2e39d3e925f90304726d97b32d5d8e195c6fd1493c0dddc5643e08e1a0973d710eb3e1dbe2512690f3
6
+ metadata.gz: 7100719c74a62034e698ca8067e610d7f30d70ec346665fd8516bc7c02a0e0e74edf76daa41c95f607841feb2767be8278e0533cc1c7847dd3846b9688ff174a
7
+ data.tar.gz: 315ced97d3b83d0255b8058b199d3ae2fe9e8d7ac55f50bb5336185d7dce4679275455c80a32e7a24acd007217ba6eb774eb4d11b916dd279609ed2fe5b4a4be
@@ -4,6 +4,7 @@ on:
4
4
  push:
5
5
  branches: [ main, master ]
6
6
  pull_request:
7
+ workflow_dispatch:
7
8
 
8
9
  jobs:
9
10
  test:
@@ -11,58 +12,114 @@ jobs:
11
12
  strategy:
12
13
  fail-fast: false
13
14
  matrix:
14
- os: [ ubuntu-latest, windows-latest, macos-latest ]
15
+ os: [ ubuntu-18.04, ubuntu-latest, windows-latest, macos-latest ]
16
+ ruby-version: [ '2.7' ]
17
+ include:
18
+ - os: windows-latest
19
+ ruby-version: '3.1'
15
20
  steps:
16
21
  - uses: actions/checkout@v2
17
22
 
18
23
  - uses: ruby/setup-ruby@v1
19
24
  with:
20
- ruby-version: 2.6.6
25
+ ruby-version: ${{ matrix.ruby-version }}
21
26
  bundler-cache: true
22
27
 
23
28
  - run: bundle exec rake
24
29
 
25
- build-gem:
26
- runs-on: ubuntu-18.04
30
+ build:
31
+ runs-on: ${{ matrix.os }}
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ include:
36
+ - os: ubuntu-18.04
37
+ platform: any
38
+ ruby-version: '2.7'
39
+ - os: ubuntu-18.04
40
+ platform: x86_64-linux
41
+ ruby-version: '2.7'
42
+ - os: windows-latest
43
+ platform: x64-mingw32
44
+ ruby-version: '2.7'
45
+ - os: windows-latest
46
+ platform: x64-mingw-ucrt
47
+ ruby-version: '3.1'
48
+ - os: macos-latest
49
+ platform: x86_64-darwin
50
+ ruby-version: '2.7'
27
51
  steps:
28
52
  - uses: actions/checkout@v2
29
53
 
30
54
  - uses: ruby/setup-ruby@v1
31
55
  with:
32
- ruby-version: '2.6'
56
+ ruby-version: ${{ matrix.ruby-version }}
57
+ bundler-cache: true
33
58
 
34
- - run: bundle config set path 'vendor/bundle'
35
-
36
- - run: bundle install --jobs 4 --retry 3
37
-
38
- - run: bundle exec rake build
59
+ - run: bundle exec rake gem:native:${{ matrix.platform }}
39
60
 
40
61
  - uses: actions/upload-artifact@v2
41
62
  with:
42
63
  name: pkg
43
64
  path: pkg/*.gem
44
65
 
45
- test-gem:
46
- needs: build-gem
66
+ - name: Install gem
67
+ run: gem install -b pkg/emf2svg-*.gem
68
+
69
+ - name: Test conversion
70
+ run: |
71
+ ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
72
+
73
+ test-build:
74
+ needs: build
47
75
  runs-on: ${{ matrix.os }}
48
76
  strategy:
49
77
  fail-fast: false
50
78
  matrix:
51
- os: [ ubuntu-18.04, ubuntu-latest, windows-latest, macos-latest ]
79
+ include:
80
+ - os: ubuntu-latest
81
+ platform: any
82
+ ruby-version: '2.7'
83
+ - os: windows-latest
84
+ platform: any
85
+ ruby-version: '2.7'
86
+ - os: macos-latest
87
+ platform: any
88
+ ruby-version: '2.7'
89
+ - os: ubuntu-18.04
90
+ platform: x86_64-linux
91
+ ruby-version: '2.7'
92
+ - os: ubuntu-latest
93
+ platform: x86_64-linux
94
+ ruby-version: '2.7'
95
+ - os: windows-latest
96
+ platform: x64-mingw32
97
+ ruby-version: '2.7'
98
+ - os: windows-latest
99
+ platform: x64-mingw-ucrt
100
+ ruby-version: '3.1'
101
+ - os: macos-latest
102
+ platform: x86_64-darwin
103
+ ruby-version: '2.7'
52
104
  steps:
53
105
  - uses: actions/checkout@v2
54
106
 
107
+ - uses: ruby/setup-ruby@v1
108
+ with:
109
+ ruby-version: ${{ matrix.ruby-version }}
110
+
55
111
  - uses: actions/download-artifact@v2
56
112
  with:
57
113
  name: pkg
58
114
  path: pkg
59
115
 
60
- - uses: ruby/setup-ruby@v1
61
- with:
62
- ruby-version: '2.6'
116
+ - name: Install native gem
117
+ if: matrix.platform == 'any'
118
+ run: gem install -b pkg/emf2svg-$(ruby -I lib -r emf2svg/version -e "puts Emf2svg::VERSION").gem
63
119
 
64
- - name: Install gem
65
- run: gem install --no-document pkg/emf2svg-*.gem
120
+ - name: Install binary gem
121
+ if: matrix.platform != 'any'
122
+ run: gem install -b pkg/emf2svg-*-${{ matrix.platform }}.gem
66
123
 
67
124
  - name: Test conversion
68
125
  run: |
@@ -6,31 +6,76 @@ on:
6
6
  - 'v*'
7
7
 
8
8
  jobs:
9
- release:
10
- runs-on: ubuntu-18.04
9
+ build:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ include:
15
+ - os: ubuntu-18.04
16
+ platform: any
17
+ ruby-version: '2.7'
18
+ - os: ubuntu-18.04
19
+ platform: x86_64-linux
20
+ ruby-version: '2.7'
21
+ - os: windows-latest
22
+ platform: x64-mingw32
23
+ ruby-version: '2.7'
24
+ - os: windows-latest
25
+ platform: x64-mingw-ucrt
26
+ ruby-version: '3.1'
27
+ - os: macos-latest
28
+ platform: x86_64-darwin
29
+ ruby-version: '2.7'
11
30
  steps:
12
- - uses: actions/checkout@v1
31
+ - uses: actions/checkout@v2
13
32
 
14
33
  - uses: ruby/setup-ruby@v1
15
34
  with:
16
- ruby-version: '2.6'
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true
17
37
 
18
- - run: bundle config set path 'vendor/bundle'
38
+ - run: bundle exec rake gem:native:${{ matrix.platform }}
19
39
 
20
- - run: bundle install --jobs 4 --retry 3
40
+ - uses: actions/upload-artifact@v2
41
+ with:
42
+ name: pkg
43
+ path: pkg/*.gem
44
+
45
+ - name: Install gem
46
+ run: gem install -b pkg/emf2svg-*.gem
47
+
48
+ - name: Test conversion
49
+ run: |
50
+ ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
51
+
52
+ publish:
53
+ needs: build
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v2
21
57
 
22
- - run: bundle exec rake
58
+ - uses: ruby/setup-ruby@v1
59
+ with:
60
+ ruby-version: '2.7'
61
+ bundler-cache: true
62
+
63
+ - uses: actions/download-artifact@v2
64
+ with:
65
+ name: pkg
66
+ path: pkg
23
67
 
24
68
  - name: Publish to rubygems.org
25
69
  env:
26
70
  RUBYGEMS_API_KEY: ${{secrets.METANORMA_CI_RUBYGEMS_API_KEY}}
27
71
  run: |
28
- gem install gem-release
72
+ mkdir -p ~/.gem
29
73
  touch ~/.gem/credentials
30
74
  cat > ~/.gem/credentials << EOF
31
75
  ---
32
76
  :rubygems_api_key: ${RUBYGEMS_API_KEY}
33
77
  EOF
34
78
  chmod 0600 ~/.gem/credentials
35
- git status
36
- gem release
79
+ gem signin
80
+ ls -l pkg/
81
+ for gem in pkg/*.gem; do gem push -V $gem; done
data/.rubocop.yml CHANGED
@@ -2,4 +2,7 @@ inherit_from:
2
2
  - 'https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml'
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
5
+ TargetRubyVersion: 2.7
6
+
7
+ Gemspec/RequireMFA:
8
+ Enabled: false
data/Rakefile CHANGED
@@ -15,3 +15,52 @@ task :compile do
15
15
  require_relative "ext/extconf"
16
16
  end
17
17
  task spec: :compile
18
+
19
+ desc "Build install-compilation gem"
20
+ task "gem:native:any" do
21
+ sh "rake platform:any gem"
22
+ end
23
+
24
+ require "rubygems/package_task"
25
+
26
+ desc "Define the gem task to build on any platform (compile on install)"
27
+ task "platform:any" do
28
+ spec = Gem::Specification::load("emf2svg.gemspec").dup
29
+ task = Gem::PackageTask.new(spec)
30
+ task.define
31
+ end
32
+
33
+ platforms = [
34
+ "x64-mingw32",
35
+ "x64-mingw-ucrt",
36
+ "x86_64-linux",
37
+ "x86_64-darwin",
38
+ ]
39
+
40
+ platforms.each do |platform|
41
+ desc "Build pre-compiled gem for the #{platform} platform"
42
+ task "gem:native:#{platform}" do
43
+ sh "rake compile platform:#{platform} gem"
44
+ end
45
+
46
+ desc "Define the gem task to build on the #{platform} platform (binary gem)"
47
+ task "platform:#{platform}" do
48
+ spec = Gem::Specification::load("emf2svg.gemspec").dup
49
+ spec.platform = Gem::Platform.new(platform)
50
+ spec.files += Dir.glob("lib/emf2svg/*.{dll,so,dylib}")
51
+ spec.extensions = []
52
+ spec.dependencies.reject! { |d| d.name == "mini_portile2" }
53
+
54
+ task = Gem::PackageTask.new(spec)
55
+ task.define
56
+ end
57
+ end
58
+
59
+ require "rake/clean"
60
+
61
+ CLOBBER.include("pkg")
62
+ CLEAN.include("ports",
63
+ "tmp",
64
+ "lib/emf2svg/*.dll",
65
+ "lib/emf2svg/*.dylib",
66
+ "lib/emf2svg/*.so")
data/emf2svg.gemspec CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["open.source@ribose.com"]
10
10
 
11
11
  spec.summary = "Ruby interface to libemf2svg."
12
- # spec.description = "TODO: Write a longer description or delete this line."
13
12
  spec.homepage = "https://github.com/metanorma/emf2svg-ruby"
14
- spec.required_ruby_version = ">= 2.5.0"
13
+ spec.license = "BSD-2-Clause"
14
+ spec.required_ruby_version = ">= 2.7.0"
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/metanorma/emf2svg-ruby"
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.add_runtime_dependency "mini_portile2", "~> 2.6"
31
31
 
32
32
  spec.add_development_dependency "rubocop", "1.5.2"
33
- spec.add_development_dependency "rubocop-performance"
34
- spec.add_development_dependency "rubocop-rails"
33
+ spec.add_development_dependency "rubocop-performance", "~> 1.0"
34
+ spec.add_development_dependency "rubocop-rails", "~> 2.0"
35
35
 
36
36
  spec.extensions = ["ext/extconf.rb"]
37
37
  end
@@ -7,11 +7,11 @@ module Emf2svg
7
7
  ROOT = Pathname.new(File.expand_path("../..", __dir__))
8
8
 
9
9
  def initialize
10
- super("libemf2svg", "1.3.0")
10
+ super("libemf2svg", "1.3.1")
11
11
 
12
12
  @files << {
13
- url: "https://github.com/metanorma/libemf2svg/releases/download/1.3.0/libemf2svg.tar.gz",
14
- sha256: "aacbf001701e3f863e97c6c117146ee710636283851d866b715de653fb79343e", # rubocop:disable Layout/LineLength
13
+ url: "https://github.com/metanorma/libemf2svg/releases/download/1.3.1/libemf2svg.tar.gz",
14
+ sha256: "732c60c54d0692a8634221e6ffb0733ad0bb1d9a246a03ba2433c535441eb73e", # rubocop:disable Layout/LineLength
15
15
  }
16
16
 
17
17
  @target = ROOT.join(@target).to_s
@@ -39,7 +39,6 @@ module Emf2svg
39
39
 
40
40
  if MiniPortile.windows?
41
41
  opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
42
- opts << "-GVisual Studio 16 2019"
43
42
  end
44
43
 
45
44
  opts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emf2svg
4
- VERSION = "0.1.1"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emf2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-03 00:00:00.000000000 Z
11
+ date: 2022-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -56,30 +56,30 @@ dependencies:
56
56
  name: rubocop-performance
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '2.0'
83
83
  description:
84
84
  email:
85
85
  - open.source@ribose.com
@@ -109,7 +109,8 @@ files:
109
109
  - lib/emf2svg/recipe.rb
110
110
  - lib/emf2svg/version.rb
111
111
  homepage: https://github.com/metanorma/emf2svg-ruby
112
- licenses: []
112
+ licenses:
113
+ - BSD-2-Clause
113
114
  metadata:
114
115
  homepage_uri: https://github.com/metanorma/emf2svg-ruby
115
116
  source_code_uri: https://github.com/metanorma/emf2svg-ruby
@@ -122,14 +123,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
123
  requirements:
123
124
  - - ">="
124
125
  - !ruby/object:Gem::Version
125
- version: 2.5.0
126
+ version: 2.7.0
126
127
  required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  requirements:
128
129
  - - ">="
129
130
  - !ruby/object:Gem::Version
130
131
  version: '0'
131
132
  requirements: []
132
- rubygems_version: 3.0.3.1
133
+ rubygems_version: 3.1.6
133
134
  signing_key:
134
135
  specification_version: 4
135
136
  summary: Ruby interface to libemf2svg.