dato 0.7.2 → 0.7.3

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: 22be7e5b5bd13a7df1d3ebf63c52ce769b0333d0c8a90e0d8f5d3da7dda8712a
4
- data.tar.gz: 4fda2a299ace4004514ed7727d789271a5a4d23361c02eaad3f59d7b9132e7c2
3
+ metadata.gz: 2db7bdd32377323ced0898556ea20771ae90d3b3ece302ce020c21c99d685ef3
4
+ data.tar.gz: 669af6a048649fe3841002882fbb0bdfa3946ba21254f8c11c4cfcc5fb6c3fc5
5
5
  SHA512:
6
- metadata.gz: 5f6b5c6e85c74e541ea03b77da23c0284e6447386af8adc4e0918b699028666b0888c1df2f27d701013efec3c75ea8fbec9e8d7b97e0ab54b87945373086ce45
7
- data.tar.gz: 285b84bdbcd3e1932fbf65ab72cb9a5519a59eaacde9b7b7150572849efb68dec1f7f0e1fd64ca7f09010e238deefe8d3073e23e3177293d5da980994791442b
6
+ metadata.gz: a5097086d93b92922604d95597a175e7b15735c47e70b2b61564c4037ff2ff32e3ac1786572d1a847fc68e1762a9711f19f09e3f86736d800d56d7ce270a0beb
7
+ data.tar.gz: 18732a788ef213bb02099ea0e830e16be4c51afe3b481607a75ff1e1b4dca7aa3dcf97070a130800ab8769f6de8d37b398473b337b91c0e82f82738f85337919
@@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
35
35
  spec.add_runtime_dependency 'faraday', ['>= 0.9.0']
36
36
  spec.add_runtime_dependency 'faraday_middleware', ['>= 0.9.0']
37
37
  spec.add_runtime_dependency 'activesupport', ['>= 4.2.7']
38
- spec.add_runtime_dependency 'fastimage'
39
38
  spec.add_runtime_dependency 'addressable'
40
39
  spec.add_runtime_dependency 'thor'
41
40
  spec.add_runtime_dependency 'imgix', ['>= 0.3.1']
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'fastimage'
4
3
  require 'tempfile'
5
4
  require 'addressable'
6
5
  require 'net/http'
@@ -50,10 +49,7 @@ module Dato
50
49
  upload_request = client.upload_request.create(filename: filename)
51
50
  uri = URI.parse(upload_request[:url])
52
51
 
53
- request = Net::HTTP::Put.new(
54
- uri,
55
- 'x-amz-acl' => 'public-read'
56
- )
52
+ request = Net::HTTP::Put.new(uri)
57
53
  request.body = file.read
58
54
 
59
55
  http = Net::HTTP.new(uri.host, uri.port)
@@ -61,9 +57,7 @@ module Dato
61
57
 
62
58
  http.request(request)
63
59
 
64
- uploads = client.uploads.create(
65
- format_resource(upload_request)
66
- )
60
+ uploads = client.uploads.create(path: upload_request[:id])
67
61
 
68
62
  uploads['id']
69
63
  end
@@ -79,29 +73,6 @@ module Dato
79
73
  puts "Error during uploading #{url}"
80
74
  raise e
81
75
  end
82
-
83
- def format_resource(upload_request)
84
- extension = FastImage.type(file.path).to_s
85
- if extension.empty?
86
- extension = ::File.extname(::File.basename(file.path)).delete('.').downcase
87
- end
88
-
89
- raise FastImage::UnknownImageType if extension.empty?
90
-
91
- base_format = {
92
- path: upload_request[:id],
93
- size: ::File.size(file.path),
94
- format: extension
95
- }
96
- if IMAGE_FORMATS.include?(extension)
97
- width, height = FastImage.size(file.path)
98
- base_format = base_format.merge(
99
- width: width,
100
- height: height
101
- )
102
- end
103
- base_format
104
- end
105
76
  end
106
77
  end
107
78
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dato
4
- VERSION = '0.7.2'
4
+ VERSION = '0.7.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-17 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,20 +206,6 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: 4.2.7
209
- - !ruby/object:Gem::Dependency
210
- name: fastimage
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :runtime
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
209
  - !ruby/object:Gem::Dependency
224
210
  name: addressable
225
211
  requirement: !ruby/object:Gem::Requirement