remove_bg 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 196ca5a9cc7812f846ceda439413ae3461329e25526efcae58974846009ace33
4
- data.tar.gz: c088230d6970e4eb5ef63b0cee75aa11e2fef7a8dea2e9a74d1a2a3c037fb6f9
3
+ metadata.gz: d12ba6f4e783a9c01381d2168e3025ca4b0305028f05d6c4b9c994bd38cfb0dd
4
+ data.tar.gz: 78075b9fc5d5979d47c00a3b2433f76fe874e770d0ddf4a36439832e45796964
5
5
  SHA512:
6
- metadata.gz: eac79d04f1595222962e443015abedc4847258449d3c5da45e67704549bf9fcc87e7d8c0a5e0c674ac22032529cfc63e7860ad7f89c975a229c3991ba14e94c0
7
- data.tar.gz: bc95552c7bf671db4c86204e50780ed23a84b358bf251657b676cbd4fd2e2659cc6929514dff4c93a68066c1f59d1749ae9f24aed10d2c3135c7722c5d29b144
6
+ metadata.gz: 57c2361599c34097e411ed4993d20616b82588917106360a6ef4475d2d02f809893f9642220e002056035c369543f05f722b119d3f810a96b27274e05197c3b5
7
+ data.tar.gz: a9a3c9cf280dd0b8481933d61cefabac4c3ee7a71133dc69a104ead6828c4f3781703f685b74bae61840c14c2dc63fc22d88d06674b0cedf972667f31e5ddf3d
data/.circleci/config.yml CHANGED
@@ -3,10 +3,9 @@ version: 2.1
3
3
 
4
4
  # Used Orbs (https://circleci.com/docs/2.0/using-orbs/)
5
5
  orbs:
6
- ruby: circleci/ruby@2.5
7
- node: circleci/node@7.1
8
- sonarcloud: sonarsource/sonarcloud@3.0
9
- asdf: rynkowsg/asdf@0.2
6
+ ruby: circleci/ruby@2.6
7
+ node: circleci/node@7.2
8
+ sonarcloud: sonarsource/sonarcloud@4.0
10
9
  codecov: codecov/codecov@5.4
11
10
  github: circleci/github-cli@2.7
12
11
 
@@ -18,7 +17,7 @@ parameters:
18
17
  default: main
19
18
  default-ruby:
20
19
  type: string
21
- default: 3.4.7
20
+ default: 3.4.8
22
21
 
23
22
  # Define common YAML anchors
24
23
  x-common-auth: &common-auth
@@ -53,7 +52,11 @@ jobs:
53
52
  sudo apt-get -y --no-install-recommends install \
54
53
  imagemagick libvips42 libffi-dev libreadline-dev \
55
54
  libyaml-dev openssl libtool
56
- - asdf/install
55
+ - run:
56
+ name: Install asdf v0.15.0
57
+ command: |
58
+ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
59
+ echo '. "$HOME/.asdf/asdf.sh"' >> "$BASH_ENV"
57
60
  - run:
58
61
  name: Set default Ruby to << pipeline.parameters.default-ruby >>
59
62
  command: echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions
@@ -66,6 +69,7 @@ jobs:
66
69
  - run:
67
70
  name: Install Ruby << pipeline.parameters.default-ruby >>
68
71
  command: |
72
+ . "$HOME/.asdf/asdf.sh"
69
73
  asdf plugin add ruby
70
74
  ASDF_RUBY_BUILD_VERSION=master asdf install ruby << pipeline.parameters.default-ruby >>
71
75
  gem install --user-install executable-hooks
@@ -119,7 +123,11 @@ jobs:
119
123
  sudo apt-get -y --no-install-recommends install \
120
124
  imagemagick libvips42 libffi-dev libreadline-dev \
121
125
  libyaml-dev openssl libtool
122
- - asdf/install
126
+ - run:
127
+ name: Install asdf v0.15.0
128
+ command: |
129
+ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
130
+ echo '. "$HOME/.asdf/asdf.sh"' >> "$BASH_ENV"
123
131
  - when:
124
132
  condition:
125
133
  equal: ["macos", "<< parameters.os >>"]
@@ -127,7 +135,12 @@ jobs:
127
135
  - run:
128
136
  name: Install ImageMagick, libvips and libffi
129
137
  command: |
130
- brew install openssl@3 imagemagick vips asdf libffi
138
+ brew install openssl@3 imagemagick vips libffi
139
+ - run:
140
+ name: Install asdf v0.15.0
141
+ command: |
142
+ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
143
+ echo '. "$HOME/.asdf/asdf.sh"' >> "$BASH_ENV"
131
144
  - run:
132
145
  name: Install Ruby << parameters.ruby-version >>
133
146
  command: echo "ruby << parameters.ruby-version >>" > ~/.tool-versions
@@ -140,6 +153,7 @@ jobs:
140
153
  - run:
141
154
  name: Install Ruby << parameters.ruby-version >>
142
155
  command: |
156
+ . "$HOME/.asdf/asdf.sh"
143
157
  asdf plugin add ruby
144
158
  ASDF_RUBY_BUILD_VERSION=master asdf install ruby << parameters.ruby-version >>
145
159
  gem install --user-install executable-hooks
@@ -197,6 +211,11 @@ jobs:
197
211
  resource_class: small
198
212
  steps:
199
213
  - checkout
214
+ - run:
215
+ name: Fetch full git history for SonarCloud blame analysis
216
+ command: |
217
+ git fetch --unshallow origin || true
218
+ git fetch --no-filter --refetch
200
219
  - attach_workspace:
201
220
  at: .
202
221
  - run:
@@ -234,7 +253,11 @@ jobs:
234
253
  imagemagick libvips42 libffi-dev libreadline-dev \
235
254
  libyaml-dev openssl libtool libz-dev libjemalloc-dev \
236
255
  libgmp-dev build-essential ruby-dev libssl-dev zlib1g-dev
237
- - asdf/install
256
+ - run:
257
+ name: Install asdf v0.15.0
258
+ command: |
259
+ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.15.0
260
+ echo '. "$HOME/.asdf/asdf.sh"' >> "$BASH_ENV"
238
261
  - run:
239
262
  name: Set default Ruby to << pipeline.parameters.default-ruby >>
240
263
  command: echo "ruby << pipeline.parameters.default-ruby >>" > ~/.tool-versions
@@ -247,6 +270,7 @@ jobs:
247
270
  - run:
248
271
  name: Install Ruby << pipeline.parameters.default-ruby >>
249
272
  command: |
273
+ . "$HOME/.asdf/asdf.sh"
250
274
  asdf plugin add ruby
251
275
  ASDF_RUBY_BUILD_VERSION=master asdf install ruby << pipeline.parameters.default-ruby >>
252
276
  gem install --user-install executable-hooks
@@ -344,7 +368,7 @@ workflows:
344
368
  matrix:
345
369
  parameters:
346
370
  os: ["docker", "macos"]
347
- ruby-version: ["3.4.7", "3.3.9", "3.2.9", "3.1.7"]
371
+ ruby-version: ["3.4.8", "3.3.9", "3.2.9"]
348
372
  filters:
349
373
  tags:
350
374
  only: /^\d+\.\d+\.\d+$/
data/.depfu.yml CHANGED
@@ -14,7 +14,7 @@ bundler:
14
14
  - depfu
15
15
  security_labels:
16
16
  - 🚨 security
17
- auto_assign: otherguy
17
+ auto_assign: SxDx
18
18
  auto_review_team_assign: platform
19
19
  grouped_update_schedule: biweekly
20
20
  grouped_update_start_date: '2022-01-05' # First wednesday of the year
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ inherit_mode:
12
12
 
13
13
  AllCops:
14
14
  NewCops: enable
15
- TargetRubyVersion: 3.1
15
+ TargetRubyVersion: 3.2
16
16
  Exclude:
17
17
  - gemfiles/**/*
18
18
  - vendor/bundle/**/*
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.4.7 3.3.9 3.2.9 3.1.7
1
+ ruby 3.4.8 3.3.9 3.2.9
@@ -2,5 +2,9 @@
2
2
  "sonarlint.connectedMode.project": {
3
3
  "connectionId": "remove-bg",
4
4
  "projectKey": "remove-bg_ruby"
5
- }
5
+ },
6
+ "debug.javascript.defaultRuntimeExecutable": {
7
+ "pwa-node": "/Users/ag/.local/share/mise/shims/node"
8
+ },
9
+ "python.defaultInterpreterPath": "/Users/ag/.local/share/mise/installs/python/3.12.2/bin/python"
6
10
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.2
4
+
5
+
6
+
7
+ ---
8
+
9
+
10
+ #### 🔀 Dependencies
11
+
12
+ - Update all Bundler dependencies (2025-11-05) [#75](https://github.com/remove-bg/ruby/pull/75)
13
+
14
+
3
15
  ## 2.2.1
4
16
 
5
17
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remove_bg (2.2.2)
4
+ remove_bg (2.3.0)
5
+ base64 (~> 0.2)
5
6
  faraday (>= 2, <= 3)
6
7
  faraday-multipart (~> 1.0)
7
8
  faraday-retry (~> 2.2)
@@ -11,15 +12,15 @@ PATH
11
12
  GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
14
- addressable (2.8.7)
15
- public_suffix (>= 2.0.2, < 7.0)
15
+ addressable (2.8.8)
16
+ public_suffix (>= 2.0.2, < 8.0)
16
17
  appraisal (2.5.0)
17
18
  bundler
18
19
  rake
19
20
  thor (>= 0.14.0)
20
21
  ast (2.4.3)
21
22
  base64 (0.3.0)
22
- bigdecimal (3.3.1)
23
+ bigdecimal (4.0.1)
23
24
  coderay (1.1.3)
24
25
  crack (1.0.1)
25
26
  bigdecimal
@@ -30,21 +31,22 @@ GEM
30
31
  faraday-net_http (>= 2.0, < 3.5)
31
32
  json
32
33
  logger
33
- faraday-multipart (1.1.1)
34
+ faraday-multipart (1.2.0)
34
35
  multipart-post (~> 2.0)
35
- faraday-net_http (3.4.1)
36
- net-http (>= 0.5.0)
37
- faraday-retry (2.3.2)
36
+ faraday-net_http (3.4.2)
37
+ net-http (~> 0.5)
38
+ faraday-retry (2.4.0)
38
39
  faraday (~> 2.0)
39
- ffi (1.17.2)
40
- ffi (1.17.2-arm64-darwin)
41
- ffi (1.17.2-x86_64-linux-gnu)
40
+ ffi (1.17.3)
41
+ ffi (1.17.3-arm64-darwin)
42
+ ffi (1.17.3-x86_64-linux-gnu)
42
43
  hashdiff (1.2.1)
43
- htmlentities (4.3.4)
44
+ htmlentities (4.4.2)
44
45
  image_processing (1.14.0)
45
46
  mini_magick (>= 4.9.5, < 6)
46
47
  ruby-vips (>= 2.0.17, < 3)
47
- json (2.15.2)
48
+ io-console (0.8.2)
49
+ json (2.18.0)
48
50
  language_server-protocol (3.17.0.5)
49
51
  lint_roller (1.1.0)
50
52
  logger (1.7.0)
@@ -52,21 +54,24 @@ GEM
52
54
  mini_magick (5.3.1)
53
55
  logger
54
56
  multipart-post (2.4.1)
55
- net-http (0.7.0)
56
- uri
57
+ net-http (0.9.1)
58
+ uri (>= 0.11.1)
57
59
  parallel (1.27.0)
58
60
  parser (3.3.10.0)
59
61
  ast (~> 2.4.1)
60
62
  racc
61
- prism (1.6.0)
62
- pry (0.15.2)
63
+ prism (1.8.0)
64
+ pry (0.16.0)
63
65
  coderay (~> 1.1)
64
66
  method_source (~> 1.0)
65
- public_suffix (6.0.2)
67
+ reline (>= 0.6.0)
68
+ public_suffix (7.0.2)
66
69
  racc (1.8.1)
67
70
  rainbow (3.1.1)
68
71
  rake (13.3.1)
69
72
  regexp_parser (2.11.3)
73
+ reline (0.6.3)
74
+ io-console (~> 0.5)
70
75
  rexml (3.4.4)
71
76
  rspec (3.13.2)
72
77
  rspec-core (~> 3.13.0)
@@ -88,7 +93,7 @@ GEM
88
93
  rspec (~> 3.0)
89
94
  rspec_junit_formatter (0.6.0)
90
95
  rspec-core (>= 2, < 4, != 2.12.0)
91
- rubocop (1.81.7)
96
+ rubocop (1.82.1)
92
97
  json (~> 2.3)
93
98
  language_server-protocol (~> 3.17.0.2)
94
99
  lint_roller (~> 1.1.0)
@@ -96,12 +101,12 @@ GEM
96
101
  parser (>= 3.3.0.2)
97
102
  rainbow (>= 2.2.2, < 4.0)
98
103
  regexp_parser (>= 2.9.3, < 3.0)
99
- rubocop-ast (>= 1.47.1, < 2.0)
104
+ rubocop-ast (>= 1.48.0, < 2.0)
100
105
  ruby-progressbar (~> 1.7)
101
106
  unicode-display_width (>= 2.4.0, < 4.0)
102
- rubocop-ast (1.47.1)
107
+ rubocop-ast (1.49.0)
103
108
  parser (>= 3.3.7.2)
104
- prism (~> 1.4)
109
+ prism (~> 1.7)
105
110
  rubocop-performance (1.26.1)
106
111
  lint_roller (~> 1.1)
107
112
  rubocop (>= 1.75.0, < 2.0)
@@ -109,11 +114,11 @@ GEM
109
114
  rubocop-rake (0.7.1)
110
115
  lint_roller (~> 1.1)
111
116
  rubocop (>= 1.72.1)
112
- rubocop-rspec (3.7.0)
117
+ rubocop-rspec (3.9.0)
113
118
  lint_roller (~> 1.1)
114
- rubocop (~> 1.72, >= 1.72.1)
119
+ rubocop (~> 1.81)
115
120
  ruby-progressbar (1.13.0)
116
- ruby-vips (2.2.5)
121
+ ruby-vips (2.3.0)
117
122
  ffi (~> 1.12)
118
123
  logger
119
124
  rubyzip (2.4.1)
@@ -126,20 +131,19 @@ GEM
126
131
  simplecov (~> 0.19)
127
132
  simplecov-html (0.13.2)
128
133
  simplecov_json_formatter (0.1.4)
129
- thor (1.4.0)
134
+ thor (1.5.0)
130
135
  unicode-display_width (3.2.0)
131
136
  unicode-emoji (~> 4.1)
132
- unicode-emoji (4.1.0)
137
+ unicode-emoji (4.2.0)
133
138
  uri (1.1.1)
134
- vcr (6.3.1)
135
- base64
139
+ vcr (6.4.0)
136
140
  vcr_better_binary (0.2.0)
137
141
  vcr (>= 5.0)
138
142
  webmock (3.26.1)
139
143
  addressable (>= 2.8.0)
140
144
  crack (>= 0.3.2)
141
145
  hashdiff (>= 0.4.0, < 2.0.0)
142
- yard (0.9.37)
146
+ yard (0.9.38)
143
147
 
144
148
  PLATFORMS
145
149
  arm64-darwin-22
data/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  ## Requirements
19
19
 
20
- This gem is compatible with Ruby 3.1+ and can be used with
20
+ This gem is compatible with Ruby 3.2+ and can be used with
21
21
  [Faraday](https://rubygems.org/gems/faraday/) version 2 and above
22
22
 
23
23
  An API key (free) from [remove.bg](https://www.remove.bg/api) is required.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "image_processing/mini_magick"
4
+ require "image_processing/vips"
3
5
  require_relative "error"
4
6
 
5
7
  module RemoveBg
@@ -43,16 +45,12 @@ module RemoveBg
43
45
  end
44
46
 
45
47
  def minimagick_compose(color_file:, alpha_file:)
46
- require "image_processing/mini_magick"
47
-
48
48
  ImageProcessing::MiniMagick
49
49
  .source(color_file)
50
50
  .composite(alpha_file, mode: "copy-opacity")
51
51
  end
52
52
 
53
53
  def vips_compose(color_file:, alpha_file:)
54
- require "image_processing/vips"
55
-
56
54
  ImageProcessing::Vips
57
55
  .source(color_file)
58
56
  .custom { |image| image.bandjoin(Vips::Image.new_from_file(alpha_file.path)) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RemoveBg
4
- VERSION = "2.2.2"
4
+ VERSION = "2.3.0"
5
5
  end
data/remove_bg.gemspec CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
  "rubygems_mfa_required" => "true",
25
25
  }
26
26
 
27
- # Require at least Ruby 3.1
28
- spec.required_ruby_version = ">= 3.1"
27
+ # Require at least Ruby 3.2
28
+ spec.required_ruby_version = ">= 3.2"
29
29
 
30
30
  # Specify which files should be added to the gem when it is released.
31
31
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ["lib"]
38
38
 
39
+ spec.add_dependency "base64", "~> 0.2" # Required for Ruby 3.4+ (removed from default gems)
39
40
  spec.add_dependency "faraday", ">= 2", "<= 3"
40
41
  spec.add_dependency "faraday-multipart", "~> 1.0"
41
42
  spec.add_dependency "faraday-retry", "~> 2.2"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remove_bg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canva Austria GmbH
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.2'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.2'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: faraday
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -438,7 +452,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
438
452
  requirements:
439
453
  - - ">="
440
454
  - !ruby/object:Gem::Version
441
- version: '3.1'
455
+ version: '3.2'
442
456
  required_rubygems_version: !ruby/object:Gem::Requirement
443
457
  requirements:
444
458
  - - ">="