remove_bg 2.0.0 → 2.0.2

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: ef5b34e46cd2739b86ea655145faa5984a5a3ceae1767e9a6ea4a8d5ad950182
4
- data.tar.gz: 95146d0326251ec59a60843a4cecc2b0b8ebbdbfdb047b33b3b1684db62b2506
3
+ metadata.gz: 2bb2411051bb93f1db4dcc9c2056da7811b906d8dfff48f8664c8d701663326b
4
+ data.tar.gz: 27f0ac17923c4bd50ebf3e97528a8446ac87c1436cb0083f0189b1aa96eb9036
5
5
  SHA512:
6
- metadata.gz: 6ece195e014cc84b8fc6843d31f6a311499fd267da4e6e8c70c5b1d5b8c08521fa665d7347b5f4a6c55a74daa2dfbbc1cf99c59c6bdf5bd6d8001839371b7d9a
7
- data.tar.gz: 68cdac8ec969b29b842955e24a14b160b3e5b33b766e1835dce9ddb49e05f0b61beedd7471a2dd395166823b9709fee580185bdb0a451c810b32b2b0626e2102
6
+ metadata.gz: d8d82cfaca4e9d6d1fb45cf6ef98b3444b3c4cf8ea43526b1537a051c7183567e6ea8a62ad958a68d1431217ad0802db5fcad3bc1dfd500a0ac5719f41fed86d
7
+ data.tar.gz: 46a70ac78ad95e8edd026510decc6dd2575e8bfad4c172431b73059617e70168cc9d445a69d894b08ed1810e736e74dd73505b93685fa2637e6c919f7ba07e5a
data/.circleci/config.yml CHANGED
@@ -4,10 +4,10 @@ version: 2.1
4
4
  # Used Orbs (https://circleci.com/docs/2.0/using-orbs/)
5
5
  orbs:
6
6
  ruby: circleci/ruby@2.1
7
+ node: circleci/node@5.2
7
8
  sonarcloud: sonarsource/sonarcloud@2.0
8
9
  asdf: rynkowsg/asdf@0.1
9
10
  codecov: codecov/codecov@4.1
10
- gcr: circleci/gcp-gcr@0.16
11
11
  github: circleci/github-cli@2.3
12
12
 
13
13
  # Pipeline parameters
@@ -18,7 +18,7 @@ parameters:
18
18
  default: main
19
19
  default-ruby:
20
20
  type: string
21
- default: "3.3.3"
21
+ default: "3.3.4"
22
22
 
23
23
  # Define common YAML anchors
24
24
  x-common-auth: &common-auth
@@ -43,7 +43,7 @@ jobs:
43
43
  docker:
44
44
  - image: cimg/base:stable
45
45
  <<: *common-auth
46
- resource_class: small
46
+ resource_class: medium
47
47
  steps:
48
48
  # Check out code
49
49
  - checkout
@@ -78,7 +78,6 @@ jobs:
78
78
  # The OS to run the jobs on
79
79
  ruby-version:
80
80
  type: string
81
- default: "3.3.3"
82
81
  executor: << parameters.os >>
83
82
  environment:
84
83
  RUBY_VERSION: << parameters.ruby-version >>
@@ -92,8 +91,9 @@ jobs:
92
91
  name: Install ImageMagick, libvips and libffi
93
92
  command: |
94
93
  sudo apt-get update
95
- sudo apt-get -y --no-install-recommends install openssl imagemagick \
96
- libvips42 libffi-dev libreadline-dev libtool libyaml-dev
94
+ sudo apt-get -y --no-install-recommends install \
95
+ imagemagick libvips42 libffi-dev libreadline-dev \
96
+ libyaml-dev openssl libtool
97
97
  - asdf/install
98
98
  - when:
99
99
  condition:
@@ -136,8 +136,12 @@ jobs:
136
136
  - when:
137
137
  condition:
138
138
  and:
139
- - equal: ["docker", "<< parameters.os >>"]
140
- - equal: ["<< pipeline.parameters.default-ruby >>", "<< parameters.ruby-version >>"]
139
+ - equal:
140
+ - "docker"
141
+ - "<< parameters.os >>"
142
+ - equal:
143
+ - "<< pipeline.parameters.default-ruby >>"
144
+ - "<< parameters.ruby-version >>"
141
145
  steps:
142
146
  - persist_to_workspace:
143
147
  root: .
@@ -181,19 +185,34 @@ jobs:
181
185
  docker:
182
186
  - image: cimg/base:stable
183
187
  <<: *common-auth
184
- resource_class: small
188
+ resource_class: medium+
185
189
  environment:
186
190
  GIT_MAIN_BRANCH: << pipeline.parameters.main-branch >>
187
191
  CHANGELOG_FILENAME: CHANGELOG.md
188
192
  steps:
189
- - setup_remote_docker
193
+ - github/install
194
+ - node/install:
195
+ node-version: latest
196
+ - run:
197
+ name: Install ImageMagick, libvips and libffi
198
+ command: |
199
+ sudo apt-get update
200
+ sudo apt-get -y --no-install-recommends install \
201
+ imagemagick libvips42 libffi-dev libreadline-dev \
202
+ libyaml-dev openssl libtool
203
+ - asdf/install
204
+ # Install requested Ruby version
205
+ - run:
206
+ name: Install Ruby << pipeline.parameters.default-ruby >>
207
+ command: |
208
+ asdf plugin-add ruby
209
+ asdf install ruby << pipeline.parameters.default-ruby >>
210
+ asdf global ruby << pipeline.parameters.default-ruby >>
211
+ gem install --user-install executable-hooks
190
212
  - checkout
191
- - attach_workspace:
192
- at: .
193
- - github/install:
194
- version: 2.47.0
195
- - ruby/install:
196
- version: "<< pipeline.parameters.default-ruby >>"
213
+ - run:
214
+ name: Check out main branch
215
+ command: git checkout --force "${GIT_MAIN_BRANCH}"
197
216
  # Install dependencies using bundler
198
217
  - ruby/install-deps:
199
218
  pre-install-steps:
@@ -211,47 +230,58 @@ jobs:
211
230
  NEXT_PATCH_TAG=$(echo "${CIRCLE_TAG:-0.0.0}" | awk 'BEGIN{FS=OFS="."} {$3+=1} 1')
212
231
  BETA_TAG="${NEXT_PATCH_TAG}.pre"
213
232
  bundle exec rake version["${BETA_TAG}"]
214
- - gcr/gcr-auth
215
- - run:
216
- name: Edit Release
217
- command: |
218
- # Update release
219
- docker run --rm -it --name=gren -v $(pwd)/.grenrc.json:/.grenrc.json \
220
- eu.gcr.io/removebg-226919/github-release-notes:latest \
221
- release --tags "${CIRCLE_TAG}" --override --token ${GITHUB_AUTH_TOKEN} --username ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
222
-
223
- # Get current release description
224
- gh release view ${CIRCLE_TAG} --repo ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} --json body --jq '.body' > release-body.txt
225
-
226
- # Append to release description
227
- echo "Updating release description"
228
- gh release edit ${CIRCLE_TAG} --repo ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} --notes-file release-body.txt --latest --title ${CIRCLE_TAG}
233
+ bundle install
229
234
  - run:
230
- name: Generate CHANGELOG.md
235
+ name: Edit Release and generate CHANGELOG.md
231
236
  command: |
232
237
  # Configure git
233
238
  git config --global credential.helper cache
234
239
  git config --global user.email "${GITHUB_USER_EMAIL}"
235
240
  git config --global user.name "${GITHUB_USER_NAME}"
236
241
 
237
- # Check out main branch
238
- git checkout --force "${GIT_MAIN_BRANCH}"
242
+ # Install GitHub Release Notes
243
+ npm install github-release-notes -g
239
244
 
240
- # Generate changelog
241
- docker run -it --name=gren -v $(pwd)/.grenrc.json:/.grenrc.json \
242
- eu.gcr.io/removebg-226919/github-release-notes:latest \
243
- changelog --override --token ${GITHUB_AUTH_TOKEN} --username ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
245
+ # Get current release description
246
+ gh release view ${CIRCLE_TAG} \
247
+ --repo ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \
248
+ --json body --jq '.body' > release-body.txt
244
249
 
245
- docker cp "gren:/${CHANGELOG_FILENAME}" "${CHANGELOG_FILENAME}"
246
- docker rm gren
250
+ # Create release notes
251
+ gren release \
252
+ --override \
253
+ --tags "${CIRCLE_TAG}" \
254
+ --token ${GITHUB_AUTH_TOKEN} \
255
+ --username ${CIRCLE_PROJECT_USERNAME} \
256
+ --repo ${CIRCLE_PROJECT_REPONAME}
257
+
258
+ # Get current release description
259
+ gh release view ${CIRCLE_TAG} \
260
+ --repo ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \
261
+ --json body --jq '.body' > release-append.txt
262
+
263
+ echo -e "$(cat release-body.txt)\n\n---\n\n$(cat release-append.txt)" > release.txt
264
+
265
+ # Append to release description
266
+ echo "Updating release description"
267
+ gh release edit ${CIRCLE_TAG} \
268
+ --repo ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \
269
+ --notes-file release.txt --latest --title ${CIRCLE_TAG}
270
+
271
+ # Generate CHANGELOG.md
272
+ gren changelog \
273
+ --override \
274
+ --token ${GITHUB_AUTH_TOKEN} \
275
+ --username ${CIRCLE_PROJECT_USERNAME} \
276
+ --repo ${CIRCLE_PROJECT_REPONAME}
247
277
 
248
278
  # Remove Windows line endings
249
279
  sed -i $'s/\r$//' "${CHANGELOG_FILENAME}"
250
280
 
251
281
  # Commit changelog and bumped version to git
252
- git add "${CHANGELOG_FILENAME}"
253
- git add lib/remove_bg/version.rb
254
- git add Gemfile.lock
282
+ git add "${CHANGELOG_FILENAME}" lib/remove_bg/version.rb Gemfile.lock
283
+ git diff --name-only --cached
284
+
255
285
  git commit -m "📝 Update ${CHANGELOG_FILENAME} for ${CIRCLE_TAG}" -m "[skip ci]"
256
286
  git push -q --set-upstream origin ${GIT_MAIN_BRANCH}
257
287
 
@@ -267,7 +297,7 @@ workflows:
267
297
  matrix:
268
298
  parameters:
269
299
  os: ["docker", "macos"]
270
- ruby-version: ["3.1.6", "3.2.3", "3.3.3"]
300
+ ruby-version: ["3.1.6", "3.2.3", "3.3.4"]
271
301
  filters:
272
302
  tags:
273
303
  only: /^\d+\.\d+\.\d+$/
@@ -298,6 +328,7 @@ workflows:
298
328
  - release:
299
329
  context:
300
330
  - DockerHub
331
+ - GitHub
301
332
  - rubygems.org
302
333
  - Google Cloud kaleido
303
334
  requires:
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.1.6 3.2.3 3.3.4
data/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.1
4
+
5
+
6
+
7
+ ---
8
+
9
+
10
+ #### 🚀 Enhancements:
11
+
12
+ - Remove deprecated File [#37](https://github.com/remove-bg/ruby/pull/37)
13
+ - Update Ruby to 3.3.4 [#36](https://github.com/remove-bg/ruby/pull/36)
14
+
15
+ #### 🐞 Bugfixes:
16
+
17
+ - Fix redefined constant warning [#35](https://github.com/remove-bg/ruby/pull/35)
18
+
19
+ #### 🔀 Dependencies
20
+
21
+ - Update all Bundler dependencies (2024-07-17) [#34](https://github.com/remove-bg/ruby/pull/34)
22
+
23
+
3
24
  ## 2.0.0
4
25
 
5
26
  - Deprecate `overwrite: true` in favour of `save!` and `save_zip!`
6
- - Remove support for Ruby 2.5, 2.6, 2.7 and 3.0 which are EOL
27
+ - Remove support for Ruby 2.5, 2.6, 2.7 and 3.0 [which are EOL](https://www.ruby-lang.org/en/downloads/branches/)
7
28
  - Deprecate Faraday < 2, add support for all Faraday 2.x versions
8
29
  - Increase default timeout to 20 seconds
9
30
 
31
+ ---
32
+
33
+
34
+ #### 🚀 Enhancements:
35
+
36
+ - Add support for Faraday 2.x [#31](https://github.com/remove-bg/ruby/pull/31)
37
+
38
+ #### 🚨 Security
39
+
40
+ - 🚨 [security] Update rexml 3.2.6 → 3.2.8 (patch) [#27](https://github.com/remove-bg/ruby/pull/27)
41
+
42
+
10
43
  ## 1.5.0
11
44
 
12
45
  - Auto-detect any available image processing libraries
@@ -19,7 +52,7 @@
19
52
  ## 1.4.0
20
53
 
21
54
  - Adds support for images up to 25 megapixels ([documentation](https://github.com/remove-bg/ruby#processing-images-over-10-megapixels))
22
- - Requires an image processing library to be configured (ImageMagick, GraphicsMagick or libvips)
55
+ - Requires an image processing library to be configured (ImageMagick, GraphicsMagick or libvips)
23
56
 
24
57
  ## 1.3.0
25
58
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remove_bg (2.0.0)
4
+ remove_bg (2.0.2)
5
5
  faraday (>= 2, <= 3)
6
6
  faraday-multipart (~> 1.0)
7
7
  faraday-retry (~> 2.2)
@@ -18,49 +18,52 @@ GEM
18
18
  rake
19
19
  thor (>= 0.14.0)
20
20
  ast (2.4.2)
21
+ base64 (0.2.0)
21
22
  bigdecimal (3.1.8)
22
23
  coderay (1.1.3)
23
24
  crack (1.0.0)
24
25
  bigdecimal
25
26
  rexml
26
27
  diff-lcs (1.5.1)
27
- docile (1.4.0)
28
- faraday (2.9.2)
28
+ docile (1.4.1)
29
+ faraday (2.10.1)
29
30
  faraday-net_http (>= 2.0, < 3.2)
31
+ logger
30
32
  faraday-multipart (1.0.4)
31
33
  multipart-post (~> 2)
32
- faraday-net_http (3.1.0)
34
+ faraday-net_http (3.1.1)
33
35
  net-http
34
36
  faraday-retry (2.2.1)
35
37
  faraday (~> 2.0)
36
38
  ffi (1.17.0)
37
39
  ffi (1.17.0-arm64-darwin)
38
40
  ffi (1.17.0-x86_64-linux-gnu)
39
- hashdiff (1.1.0)
41
+ hashdiff (1.1.1)
40
42
  htmlentities (4.3.4)
41
- image_processing (1.12.2)
43
+ image_processing (1.13.0)
42
44
  mini_magick (>= 4.9.5, < 5)
43
45
  ruby-vips (>= 2.0.17, < 3)
44
46
  json (2.7.2)
45
47
  language_server-protocol (3.17.0.3)
48
+ logger (1.6.0)
46
49
  method_source (1.1.0)
47
- mini_magick (4.13.1)
50
+ mini_magick (4.13.2)
48
51
  multipart-post (2.4.1)
49
52
  net-http (0.4.1)
50
53
  uri
51
- parallel (1.25.1)
52
- parser (3.3.3.0)
54
+ parallel (1.26.3)
55
+ parser (3.3.4.2)
53
56
  ast (~> 2.4.1)
54
57
  racc
55
58
  pry (0.14.2)
56
59
  coderay (~> 1.1)
57
60
  method_source (~> 1.0)
58
- public_suffix (6.0.0)
59
- racc (1.8.0)
61
+ public_suffix (6.0.1)
62
+ racc (1.8.1)
60
63
  rainbow (3.1.1)
61
64
  rake (13.2.1)
62
65
  regexp_parser (2.9.2)
63
- rexml (3.3.1)
66
+ rexml (3.3.6)
64
67
  strscan
65
68
  rspec (3.13.0)
66
69
  rspec-core (~> 3.13.0)
@@ -68,7 +71,7 @@ GEM
68
71
  rspec-mocks (~> 3.13.0)
69
72
  rspec-core (3.13.0)
70
73
  rspec-support (~> 3.13.0)
71
- rspec-expectations (3.13.1)
74
+ rspec-expectations (3.13.2)
72
75
  diff-lcs (>= 1.2.0, < 2.0)
73
76
  rspec-support (~> 3.13.0)
74
77
  rspec-mocks (3.13.1)
@@ -82,29 +85,30 @@ GEM
82
85
  rspec (~> 3.0)
83
86
  rspec_junit_formatter (0.6.0)
84
87
  rspec-core (>= 2, < 4, != 2.12.0)
85
- rubocop (1.64.1)
88
+ rubocop (1.65.1)
86
89
  json (~> 2.3)
87
90
  language_server-protocol (>= 3.17.0)
88
91
  parallel (~> 1.10)
89
92
  parser (>= 3.3.0.2)
90
93
  rainbow (>= 2.2.2, < 4.0)
91
- regexp_parser (>= 1.8, < 3.0)
94
+ regexp_parser (>= 2.4, < 3.0)
92
95
  rexml (>= 3.2.5, < 4.0)
93
96
  rubocop-ast (>= 1.31.1, < 2.0)
94
97
  ruby-progressbar (~> 1.7)
95
98
  unicode-display_width (>= 2.4.0, < 3.0)
96
- rubocop-ast (1.31.3)
99
+ rubocop-ast (1.32.1)
97
100
  parser (>= 3.3.1.0)
98
101
  rubocop-performance (1.21.1)
99
102
  rubocop (>= 1.48.1, < 2.0)
100
103
  rubocop-ast (>= 1.31.1, < 2.0)
101
104
  rubocop-rake (0.6.0)
102
105
  rubocop (~> 1.0)
103
- rubocop-rspec (3.0.2)
106
+ rubocop-rspec (3.0.4)
104
107
  rubocop (~> 1.61)
105
108
  ruby-progressbar (1.13.0)
106
- ruby-vips (2.2.1)
109
+ ruby-vips (2.2.2)
107
110
  ffi (~> 1.12)
111
+ logger
108
112
  rubyzip (2.3.2)
109
113
  simplecov (0.22.0)
110
114
  docile (~> 1.1)
@@ -119,7 +123,8 @@ GEM
119
123
  thor (1.3.1)
120
124
  unicode-display_width (2.5.0)
121
125
  uri (0.13.0)
122
- vcr (6.2.0)
126
+ vcr (6.3.1)
127
+ base64
123
128
  vcr_better_binary (0.2.0)
124
129
  vcr (>= 5.0)
125
130
  webmock (3.23.1)
data/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Codecov](https://img.shields.io/codecov/c/github/remove-bg/ruby?style=for-the-badge&logo=codecov&logoColor=aaa)](https://app.codecov.io/gh/remove-bg/ruby)
12
12
  [![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/remove-bg_ruby?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge&logo=sonarcloud&logoColor=aaa)](https://sonarcloud.io/summary/overall?id=remove-bg_ruby)
13
13
  [![Violations](https://img.shields.io/sonar/violations/remove-bg_ruby?server=https%3A%2F%2Fsonarcloud.io&format=short&style=for-the-badge&logo=sonarcloud&logoColor=aaa)](https://sonarcloud.io/summary/overall?id=remove-bg_ruby)
14
- ![Depfu](https://img.shields.io/depfu/dependencies/github/remove-bg%2Fruby?style=for-the-badge&logo=dependabot&logoColor=aaa)
14
+ [![Dependencies](https://img.shields.io/depfu/dependencies/github/remove-bg%2Fruby?style=for-the-badge&logo=dependabot&logoColor=aaa)](https://github.com/remove-bg/ruby/network/dependencies)
15
15
 
16
16
  </p>
17
17
 
@@ -10,7 +10,7 @@ module RemoveBg
10
10
  raise RemoveBg::FileMissingError.new(file_path) unless File.exist?(file_path)
11
11
 
12
12
  content_type = determine_content_type(file_path)
13
- FARADAY_FILE.new(file_path, content_type)
13
+ Faraday::Multipart::FilePart.new(file_path, content_type)
14
14
  end
15
15
 
16
16
  def self.determine_content_type(file_path)
@@ -23,10 +23,5 @@ module RemoveBg
23
23
  end
24
24
 
25
25
  private_class_method :determine_content_type
26
-
27
- FARADAY_FILE = File
28
- FARADAY_FILE = Faraday::Multipart::FilePart if defined?(Faraday::Multipart::FilePart)
29
-
30
- private_constant :FARADAY_FILE
31
26
  end
32
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RemoveBg
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remove_bg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canva Austria GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -373,6 +373,7 @@ files:
373
373
  - ".grenrc.json"
374
374
  - ".rspec"
375
375
  - ".rubocop.yml"
376
+ - ".tool-versions"
376
377
  - Appraisals
377
378
  - CHANGELOG.md
378
379
  - Gemfile