cloudconvert 1.1.0 → 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: f05a16c577e0b30ddf30f9e73a087e1b79d40570f11b5a6013d98d9c372494c0
4
- data.tar.gz: 7252a59fffb66d0797a04014251a3825a976a3470c8ca0d1adcd10865950512f
3
+ metadata.gz: c673e3ee8e95029ba169554f076d54a63ccafeb2935708da8882babddba6f2dd
4
+ data.tar.gz: cae666dc7dda6a117cf0f81ba40086e35c135b63e478972aa082eabd631ae6c4
5
5
  SHA512:
6
- metadata.gz: bf3531174c00eb2b7ea64fac80e91a40a497ffdaed32f834fd9edb497b6fadf4514a6a6ada0e50fdd0e1d7e83f763d982408e4e883b9625bfcfcdda1bf2c3ead
7
- data.tar.gz: a9a5b932ebf1eee1ada6a1d779bdf73ee6e1572fcaccfb2430496746d2ed8c83b8798e7e38fd61dea16b3a356d9391f05379a8d5137965d7281f5aed23690f3d
6
+ metadata.gz: d571515f826da72d7334981057c0d4cf987d5c34abf05353ad5479a3e10a3554f3ff76ea040f6841bda769400b076be9a1aed07435197d516e26aa0a0b226508
7
+ data.tar.gz: fb6262513b578d91d6c65a1ba8bbe40e149b051ba684458fb025e81e07fcdcea127cbe361aca89d8d78a80e344d5b40b55b8a92cb1342e3f5b50603255545b0b
data/cloudconvert.gemspec CHANGED
@@ -20,8 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.add_dependency "activesupport", ">= 4.0"
21
21
  spec.add_dependency "down", "~> 5.0"
22
22
  spec.add_dependency "equalizer"
23
- spec.add_dependency "faraday", "~> 1.0"
24
- spec.add_dependency "faraday_middleware", "~> 1.0"
23
+ spec.add_dependency "faraday", ">= 2.0.1"
24
+ spec.add_dependency "faraday-multipart"
25
+ spec.add_dependency "faraday-follow_redirects"
25
26
  spec.add_dependency "forwardable"
26
27
  spec.add_dependency "json"
27
28
  spec.add_dependency "memoizable", "~> 0.4"
@@ -93,8 +93,8 @@ module CloudConvert
93
93
  f.adapter Faraday.default_adapter
94
94
  f.request :json
95
95
  f.request :multipart
96
- f.use CloudConvert::Middleware::ParseJson, content_type: /\bjson$/
97
- f.use FaradayMiddleware::FollowRedirects, callback: lambda { |response, redirect|
96
+ f.response :json, content_type: /\bjson$/, parser_options: { object_class: OpenStruct }
97
+ f.response :follow_redirects, callback: lambda { |response, redirect|
98
98
  redirect.request_headers.delete("Content-Length")
99
99
  redirect.request_headers.delete("Content-Type")
100
100
  }
@@ -1,5 +1,5 @@
1
1
  module CloudConvert
2
- class File < Faraday::FilePart
2
+ class File < Faraday::Multipart::FilePart
3
3
  def initialize(file, content_type = nil, *parts)
4
4
  content_type ||= "text/plain" if file.is_a? StringIO
5
5
  content_type ||= Marcel::Magic.by_magic(file) || Marcel::Magic.by_path(file)
@@ -1,3 +1,3 @@
1
1
  module CloudConvert
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -11,7 +11,7 @@ module CloudConvert::Webhook::Processor
11
11
 
12
12
  def create
13
13
  method = event.name.gsub(".", "_")
14
- raise NoMethodError.new("#{name}##{method} not implemented") unless respond_to?(method, true)
14
+ raise NoMethodError.new("#{self.class.name}##{method} not implemented") unless respond_to?(method, true)
15
15
  send(method, event)
16
16
  head(:ok)
17
17
  end
data/lib/cloudconvert.rb CHANGED
@@ -3,7 +3,8 @@ require "active_support/core_ext/hash/reverse_merge"
3
3
  require "down"
4
4
  require "equalizer"
5
5
  require "faraday"
6
- require "faraday_middleware"
6
+ require "faraday/follow_redirects"
7
+ require "faraday/multipart"
7
8
  require "forwardable"
8
9
  require "json"
9
10
  require "memoizable"
@@ -20,7 +21,6 @@ require "cloudconvert/error"
20
21
  require "cloudconvert/event"
21
22
  require "cloudconvert/file"
22
23
  require "cloudconvert/job"
23
- require "cloudconvert/middleware"
24
24
  require "cloudconvert/resource"
25
25
  require "cloudconvert/resources/jobs"
26
26
  require "cloudconvert/resources/tasks"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudconvert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josias Montag
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-30 00:00:00.000000000 Z
12
+ date: 2023-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -57,30 +57,44 @@ dependencies:
57
57
  name: faraday
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '1.0'
62
+ version: 2.0.1
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '1.0'
69
+ version: 2.0.1
70
70
  - !ruby/object:Gem::Dependency
71
- name: faraday_middleware
71
+ name: faraday-multipart
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: '1.0'
76
+ version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '1.0'
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: faraday-follow_redirects
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: forwardable
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -353,7 +367,6 @@ files:
353
367
  - lib/cloudconvert/event.rb
354
368
  - lib/cloudconvert/file.rb
355
369
  - lib/cloudconvert/job.rb
356
- - lib/cloudconvert/middleware.rb
357
370
  - lib/cloudconvert/resource.rb
358
371
  - lib/cloudconvert/resources/jobs.rb
359
372
  - lib/cloudconvert/resources/tasks.rb
@@ -1,9 +0,0 @@
1
- module CloudConvert
2
- module Middleware
3
- class ParseJson < FaradayMiddleware::ParseJson
4
- define_parser do |body, parser_options|
5
- JSON.parse(body, object_class: OpenStruct) unless body.blank?
6
- end
7
- end
8
- end
9
- end