remove_bg 1.5.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +329 -59
  3. data/.depfu.yml +21 -0
  4. data/.editorconfig +19 -0
  5. data/.gitignore +8 -8
  6. data/.grenrc.json +20 -0
  7. data/.rspec +5 -0
  8. data/.rubocop.yml +43 -0
  9. data/.tool-versions +1 -0
  10. data/Appraisals +49 -10
  11. data/CHANGELOG.md +19 -2
  12. data/Gemfile +2 -5
  13. data/Gemfile.lock +132 -78
  14. data/LICENSE.md +25 -0
  15. data/README.md +31 -12
  16. data/Rakefile +4 -0
  17. data/SECURITY.md +36 -0
  18. data/gemfiles/faraday_2_0.gemfile +7 -0
  19. data/gemfiles/faraday_2_1.gemfile +7 -0
  20. data/gemfiles/faraday_2_2.gemfile +7 -0
  21. data/gemfiles/faraday_2_3.gemfile +7 -0
  22. data/gemfiles/faraday_2_4.gemfile +7 -0
  23. data/gemfiles/faraday_2_5.gemfile +7 -0
  24. data/gemfiles/faraday_2_6.gemfile +7 -0
  25. data/gemfiles/faraday_2_7.gemfile +7 -0
  26. data/gemfiles/faraday_2_8.gemfile +7 -0
  27. data/gemfiles/faraday_2_9.gemfile +7 -0
  28. data/gemfiles/faraday_2_x.gemfile +7 -0
  29. data/lib/remove_bg/account_info.rb +2 -0
  30. data/lib/remove_bg/api.rb +2 -0
  31. data/lib/remove_bg/api_client.rb +12 -12
  32. data/lib/remove_bg/base_request_options.rb +2 -0
  33. data/lib/remove_bg/composite_result.rb +19 -10
  34. data/lib/remove_bg/configuration.rb +2 -0
  35. data/lib/remove_bg/error.rb +3 -1
  36. data/lib/remove_bg/http_connection.rb +7 -4
  37. data/lib/remove_bg/image_composer.rb +13 -12
  38. data/lib/remove_bg/rate_limit_info.rb +9 -6
  39. data/lib/remove_bg/request_options.rb +3 -3
  40. data/lib/remove_bg/result.rb +13 -3
  41. data/lib/remove_bg/result_metadata.rb +2 -0
  42. data/lib/remove_bg/upload.rb +5 -8
  43. data/lib/remove_bg/url_validator.rb +4 -4
  44. data/lib/remove_bg/version.rb +3 -1
  45. data/lib/remove_bg.rb +2 -0
  46. data/remove_bg.gemspec +43 -20
  47. data/resources/removebgByCanva.svg +47 -0
  48. data/sonar-project.properties +22 -0
  49. data/tasks/version.rake +34 -0
  50. metadata +207 -82
  51. data/.env.test +0 -2
  52. data/LICENSE +0 -21
  53. data/gemfiles/faraday_0_15.gemfile +0 -11
  54. data/gemfiles/faraday_0_16.gemfile +0 -11
  55. data/gemfiles/faraday_0_17.gemfile +0 -11
  56. data/gemfiles/faraday_1_x.gemfile +0 -11
metadata CHANGED
@@ -1,55 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remove_bg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
- - Oliver Peate
7
+ - Canva Austria GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.15'
20
- - - "<"
21
18
  - !ruby/object:Gem::Version
22
19
  version: '2'
20
+ - - "<="
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '0.15'
30
- - - "<"
31
28
  - !ruby/object:Gem::Version
32
29
  version: '2'
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
33
  - !ruby/object:Gem::Dependency
34
- name: image_processing
34
+ name: faraday-multipart
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.9'
40
- - - "<"
39
+ version: '1.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
41
45
  - !ruby/object:Gem::Version
42
- version: '2'
46
+ version: '1.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: faraday-retry
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.2'
43
54
  type: :runtime
44
55
  prerelease: false
45
56
  version_requirements: !ruby/object:Gem::Requirement
46
57
  requirements:
47
- - - ">="
58
+ - - "~>"
48
59
  - !ruby/object:Gem::Version
49
- version: '1.9'
50
- - - "<"
60
+ version: '2.2'
61
+ - !ruby/object:Gem::Dependency
62
+ name: image_processing
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
51
66
  - !ruby/object:Gem::Version
52
- version: '2'
67
+ version: '1.12'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1.12'
53
75
  - !ruby/object:Gem::Dependency
54
76
  name: rubyzip
55
77
  requirement: !ruby/object:Gem::Requirement
@@ -70,6 +92,20 @@ dependencies:
70
92
  - - "<"
71
93
  - !ruby/object:Gem::Version
72
94
  version: '3'
95
+ - !ruby/object:Gem::Dependency
96
+ name: appraisal
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '2.5'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '2.5'
73
109
  - !ruby/object:Gem::Dependency
74
110
  name: bundler
75
111
  requirement: !ruby/object:Gem::Requirement
@@ -85,197 +121,280 @@ dependencies:
85
121
  - !ruby/object:Gem::Version
86
122
  version: '2.0'
87
123
  - !ruby/object:Gem::Dependency
88
- name: codecov
124
+ name: pry
89
125
  requirement: !ruby/object:Gem::Requirement
90
126
  requirements:
91
- - - ">="
127
+ - - "~>"
92
128
  - !ruby/object:Gem::Version
93
- version: '0'
129
+ version: '0.14'
94
130
  type: :development
95
131
  prerelease: false
96
132
  version_requirements: !ruby/object:Gem::Requirement
97
133
  requirements:
98
- - - ">="
134
+ - - "~>"
99
135
  - !ruby/object:Gem::Version
100
- version: '0'
136
+ version: '0.14'
101
137
  - !ruby/object:Gem::Dependency
102
- name: dotenv
138
+ name: rake
103
139
  requirement: !ruby/object:Gem::Requirement
104
140
  requirements:
105
- - - ">="
141
+ - - "~>"
106
142
  - !ruby/object:Gem::Version
107
- version: '0'
143
+ version: '13.2'
108
144
  type: :development
109
145
  prerelease: false
110
146
  version_requirements: !ruby/object:Gem::Requirement
111
147
  requirements:
112
- - - ">="
148
+ - - "~>"
113
149
  - !ruby/object:Gem::Version
114
- version: '0'
150
+ version: '13.2'
115
151
  - !ruby/object:Gem::Dependency
116
- name: pry
152
+ name: rspec
117
153
  requirement: !ruby/object:Gem::Requirement
118
154
  requirements:
119
- - - ">="
155
+ - - "~>"
120
156
  - !ruby/object:Gem::Version
121
- version: '0'
157
+ version: '3.13'
122
158
  type: :development
123
159
  prerelease: false
124
160
  version_requirements: !ruby/object:Gem::Requirement
125
161
  requirements:
126
- - - ">="
162
+ - - "~>"
127
163
  - !ruby/object:Gem::Version
128
- version: '0'
164
+ version: '3.13'
129
165
  - !ruby/object:Gem::Dependency
130
- name: rake
166
+ name: rspec_junit_formatter
131
167
  requirement: !ruby/object:Gem::Requirement
132
168
  requirements:
133
- - - ">="
169
+ - - "~>"
134
170
  - !ruby/object:Gem::Version
135
- version: '0'
171
+ version: '0.6'
136
172
  type: :development
137
173
  prerelease: false
138
174
  version_requirements: !ruby/object:Gem::Requirement
139
175
  requirements:
140
- - - ">="
176
+ - - "~>"
141
177
  - !ruby/object:Gem::Version
142
- version: '0'
178
+ version: '0.6'
143
179
  - !ruby/object:Gem::Dependency
144
- name: rspec_junit_formatter
180
+ name: rspec-sonarqube-formatter
145
181
  requirement: !ruby/object:Gem::Requirement
146
182
  requirements:
147
- - - ">="
183
+ - - "~>"
148
184
  - !ruby/object:Gem::Version
149
- version: '0'
185
+ version: '1.5'
150
186
  type: :development
151
187
  prerelease: false
152
188
  version_requirements: !ruby/object:Gem::Requirement
153
189
  requirements:
154
- - - ">="
190
+ - - "~>"
155
191
  - !ruby/object:Gem::Version
156
- version: '0'
192
+ version: '1.5'
157
193
  - !ruby/object:Gem::Dependency
158
194
  name: rspec-with_params
159
195
  requirement: !ruby/object:Gem::Requirement
160
196
  requirements:
161
- - - ">="
197
+ - - "~>"
162
198
  - !ruby/object:Gem::Version
163
- version: '0'
199
+ version: '0.3'
164
200
  type: :development
165
201
  prerelease: false
166
202
  version_requirements: !ruby/object:Gem::Requirement
167
203
  requirements:
168
- - - ">="
204
+ - - "~>"
169
205
  - !ruby/object:Gem::Version
170
- version: '0'
206
+ version: '0.3'
171
207
  - !ruby/object:Gem::Dependency
172
- name: rspec
208
+ name: rubocop
209
+ requirement: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - "~>"
212
+ - !ruby/object:Gem::Version
213
+ version: '1.64'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - "~>"
219
+ - !ruby/object:Gem::Version
220
+ version: '1.64'
221
+ - !ruby/object:Gem::Dependency
222
+ name: rubocop-performance
223
+ requirement: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - "~>"
226
+ - !ruby/object:Gem::Version
227
+ version: '1.21'
228
+ type: :development
229
+ prerelease: false
230
+ version_requirements: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - "~>"
233
+ - !ruby/object:Gem::Version
234
+ version: '1.21'
235
+ - !ruby/object:Gem::Dependency
236
+ name: rubocop-rake
237
+ requirement: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - "~>"
240
+ - !ruby/object:Gem::Version
241
+ version: '0.6'
242
+ type: :development
243
+ prerelease: false
244
+ version_requirements: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - "~>"
247
+ - !ruby/object:Gem::Version
248
+ version: '0.6'
249
+ - !ruby/object:Gem::Dependency
250
+ name: rubocop-rspec
173
251
  requirement: !ruby/object:Gem::Requirement
174
252
  requirements:
175
253
  - - "~>"
176
254
  - !ruby/object:Gem::Version
177
- version: '3.8'
255
+ version: '3.0'
178
256
  type: :development
179
257
  prerelease: false
180
258
  version_requirements: !ruby/object:Gem::Requirement
181
259
  requirements:
182
260
  - - "~>"
183
261
  - !ruby/object:Gem::Version
184
- version: '3.8'
262
+ version: '3.0'
185
263
  - !ruby/object:Gem::Dependency
186
264
  name: simplecov
187
265
  requirement: !ruby/object:Gem::Requirement
188
266
  requirements:
189
- - - ">="
267
+ - - "~>"
190
268
  - !ruby/object:Gem::Version
191
- version: '0'
269
+ version: '0.22'
192
270
  type: :development
193
271
  prerelease: false
194
272
  version_requirements: !ruby/object:Gem::Requirement
195
273
  requirements:
196
- - - ">="
274
+ - - "~>"
197
275
  - !ruby/object:Gem::Version
198
- version: '0'
276
+ version: '0.22'
199
277
  - !ruby/object:Gem::Dependency
200
- name: vcr_better_binary
278
+ name: simplecov-cobertura
201
279
  requirement: !ruby/object:Gem::Requirement
202
280
  requirements:
203
- - - ">="
281
+ - - "~>"
204
282
  - !ruby/object:Gem::Version
205
- version: '0'
283
+ version: '2.1'
206
284
  type: :development
207
285
  prerelease: false
208
286
  version_requirements: !ruby/object:Gem::Requirement
209
287
  requirements:
210
- - - ">="
288
+ - - "~>"
289
+ - !ruby/object:Gem::Version
290
+ version: '2.1'
291
+ - !ruby/object:Gem::Dependency
292
+ name: simplecov_json_formatter
293
+ requirement: !ruby/object:Gem::Requirement
294
+ requirements:
295
+ - - "~>"
296
+ - !ruby/object:Gem::Version
297
+ version: '0.1'
298
+ type: :development
299
+ prerelease: false
300
+ version_requirements: !ruby/object:Gem::Requirement
301
+ requirements:
302
+ - - "~>"
211
303
  - !ruby/object:Gem::Version
212
- version: '0'
304
+ version: '0.1'
213
305
  - !ruby/object:Gem::Dependency
214
306
  name: vcr
215
307
  requirement: !ruby/object:Gem::Requirement
216
308
  requirements:
217
- - - ">="
309
+ - - "~>"
218
310
  - !ruby/object:Gem::Version
219
- version: '0'
311
+ version: '6.2'
220
312
  type: :development
221
313
  prerelease: false
222
314
  version_requirements: !ruby/object:Gem::Requirement
223
315
  requirements:
224
- - - ">="
316
+ - - "~>"
225
317
  - !ruby/object:Gem::Version
226
- version: '0'
318
+ version: '6.2'
319
+ - !ruby/object:Gem::Dependency
320
+ name: vcr_better_binary
321
+ requirement: !ruby/object:Gem::Requirement
322
+ requirements:
323
+ - - "~>"
324
+ - !ruby/object:Gem::Version
325
+ version: '0.2'
326
+ type: :development
327
+ prerelease: false
328
+ version_requirements: !ruby/object:Gem::Requirement
329
+ requirements:
330
+ - - "~>"
331
+ - !ruby/object:Gem::Version
332
+ version: '0.2'
227
333
  - !ruby/object:Gem::Dependency
228
334
  name: webmock
229
335
  requirement: !ruby/object:Gem::Requirement
230
336
  requirements:
231
- - - ">="
337
+ - - "~>"
232
338
  - !ruby/object:Gem::Version
233
- version: '0'
339
+ version: '3.23'
234
340
  type: :development
235
341
  prerelease: false
236
342
  version_requirements: !ruby/object:Gem::Requirement
237
343
  requirements:
238
- - - ">="
344
+ - - "~>"
239
345
  - !ruby/object:Gem::Version
240
- version: '0'
346
+ version: '3.23'
241
347
  - !ruby/object:Gem::Dependency
242
348
  name: yard
243
349
  requirement: !ruby/object:Gem::Requirement
244
350
  requirements:
245
- - - ">="
351
+ - - "~>"
246
352
  - !ruby/object:Gem::Version
247
- version: '0'
353
+ version: '0.9'
248
354
  type: :development
249
355
  prerelease: false
250
356
  version_requirements: !ruby/object:Gem::Requirement
251
357
  requirements:
252
- - - ">="
358
+ - - "~>"
253
359
  - !ruby/object:Gem::Version
254
- version: '0'
255
- description:
360
+ version: '0.9'
361
+ description: Use remove.bg with our official Ruby library to quickly, easily and 100%
362
+ automatically remove the background from images.
256
363
  email:
257
- - team@remove.bg
364
+ - ops@kaleido.ai
258
365
  executables: []
259
366
  extensions: []
260
367
  extra_rdoc_files: []
261
368
  files:
262
369
  - ".circleci/config.yml"
263
- - ".env.test"
370
+ - ".depfu.yml"
371
+ - ".editorconfig"
264
372
  - ".gitignore"
373
+ - ".grenrc.json"
265
374
  - ".rspec"
375
+ - ".rubocop.yml"
376
+ - ".tool-versions"
266
377
  - Appraisals
267
378
  - CHANGELOG.md
268
379
  - Gemfile
269
380
  - Gemfile.lock
270
- - LICENSE
381
+ - LICENSE.md
271
382
  - README.md
272
383
  - Rakefile
384
+ - SECURITY.md
273
385
  - bin/console
274
386
  - bin/setup
275
- - gemfiles/faraday_0_15.gemfile
276
- - gemfiles/faraday_0_16.gemfile
277
- - gemfiles/faraday_0_17.gemfile
278
- - gemfiles/faraday_1_x.gemfile
387
+ - gemfiles/faraday_2_0.gemfile
388
+ - gemfiles/faraday_2_1.gemfile
389
+ - gemfiles/faraday_2_2.gemfile
390
+ - gemfiles/faraday_2_3.gemfile
391
+ - gemfiles/faraday_2_4.gemfile
392
+ - gemfiles/faraday_2_5.gemfile
393
+ - gemfiles/faraday_2_6.gemfile
394
+ - gemfiles/faraday_2_7.gemfile
395
+ - gemfiles/faraday_2_8.gemfile
396
+ - gemfiles/faraday_2_9.gemfile
397
+ - gemfiles/faraday_2_x.gemfile
279
398
  - lib/remove_bg.rb
280
399
  - lib/remove_bg/account_info.rb
281
400
  - lib/remove_bg/api.rb
@@ -295,12 +414,18 @@ files:
295
414
  - lib/remove_bg/version.rb
296
415
  - remove_bg.gemspec
297
416
  - resources/logo_black.png
417
+ - resources/removebgByCanva.svg
418
+ - sonar-project.properties
419
+ - tasks/version.rake
298
420
  homepage: https://www.remove.bg/
299
421
  licenses:
300
422
  - MIT
301
423
  metadata:
424
+ bug_tracker_uri: https://github.com/remove-bg/ruby/issues
302
425
  source_code_uri: https://github.com/remove-bg/ruby
303
- changelog_uri: https://github.com/remove-bg/ruby/blob/master/CHANGELOG.md
426
+ changelog_uri: https://github.com/remove-bg/ruby/blob/main/CHANGELOG.md
427
+ allowed_push_host: https://rubygems.org
428
+ rubygems_mfa_required: 'true'
304
429
  post_install_message:
305
430
  rdoc_options: []
306
431
  require_paths:
@@ -309,14 +434,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
434
  requirements:
310
435
  - - ">="
311
436
  - !ruby/object:Gem::Version
312
- version: '0'
437
+ version: '3.1'
313
438
  required_rubygems_version: !ruby/object:Gem::Requirement
314
439
  requirements:
315
440
  - - ">="
316
441
  - !ruby/object:Gem::Version
317
442
  version: '0'
318
443
  requirements: []
319
- rubygems_version: 3.1.2
444
+ rubygems_version: 3.5.11
320
445
  signing_key:
321
446
  specification_version: 4
322
447
  summary: Remove image background - 100% automatically
data/.env.test DELETED
@@ -1,2 +0,0 @@
1
- # When re-recording VCR fixtures, specify a real API key in .env.test.local:
2
- REMOVE_BG_API_KEY=test-api-key
data/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 remove.bg
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 0.15.0"
6
-
7
- group :development do
8
- gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", ref: "5868643"
9
- end
10
-
11
- gemspec path: "../"
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 0.16.0"
6
-
7
- group :development do
8
- gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", ref: "5868643"
9
- end
10
-
11
- gemspec path: "../"
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 0.17.0"
6
-
7
- group :development do
8
- gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", ref: "5868643"
9
- end
10
-
11
- gemspec path: "../"
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "faraday", "~> 1.0"
6
-
7
- group :development do
8
- gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", ref: "5868643"
9
- end
10
-
11
- gemspec path: "../"