dato 0.1.23 → 0.1.24

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
  SHA1:
3
- metadata.gz: 8ff1f4742d6e3f284948b501f34a347a39bef4ae
4
- data.tar.gz: 1e9811ddb704b095ea317ea3f39a80b7d853f326
3
+ metadata.gz: c7fa90b8b14dd53eab80f12f81f7ef08e860aac4
4
+ data.tar.gz: 191d5bff4920323a620bc8b2c86e2bb9880f9c67
5
5
  SHA512:
6
- metadata.gz: d0af054db594ca97fc0b0290782c0bd712ec7a68950b5a33cf0f5947bafc2a1bbd1dc275832e2890d4b816ffbdf8eb82b707f243359cd33f52b493e5479cf6ae
7
- data.tar.gz: ba9565ca8874e459523097aace6d9b40ed3201d382e916b54a5c8673e3d561caba1486142eeb2a6cfe6b71156c9158288ff971756453ebb6b1e5658c9ab80056
6
+ metadata.gz: 2f2c7569516aef85064d2bb0e31f4749bb198b224251913aa0e1790898ca10a745429f9a488cea5ea9fee5b0a1664a65d4a251aa0a9bb6479b35a5323f085380
7
+ data.tar.gz: 8b85427500a50cc8b54b094786a3a3293cf41d438604539913275149ace2cfec4fd049e3e1f8dfc404137900284369d08ab8988bbd2b0489d7919912605452b0
data/dato.gemspec CHANGED
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_runtime_dependency 'imgix', ['>= 0.3.1']
44
44
  spec.add_runtime_dependency 'video_embed'
45
45
  spec.add_runtime_dependency 'toml'
46
+ spec.add_runtime_dependency 'cacert'
46
47
  end
@@ -10,6 +10,8 @@ require 'dato/account/repo/account'
10
10
  require 'dato/account/repo/site'
11
11
  require 'dato/api_error'
12
12
 
13
+ require 'cacert'
14
+
13
15
  module Dato
14
16
  module Account
15
17
  class Client
@@ -42,7 +44,12 @@ module Dato
42
44
 
43
45
  def request(*args)
44
46
  connection.send(*args).body.with_indifferent_access
45
- rescue Faraday::ConnectionFailed => e
47
+ rescue Faraday::SSLError => e
48
+ raise e if ENV['SSL_CERT_FILE'] == Cacert.pem
49
+
50
+ Cacert.set_in_env
51
+ request(*args)
52
+ rescue Faraday::ConnectionFailed, Faraday::TimeoutError => e
46
53
  raise e
47
54
  rescue Faraday::ClientError => e
48
55
  raise ApiError, e
@@ -4,7 +4,7 @@ module Dato
4
4
  module FieldType
5
5
  class DateTime
6
6
  def self.parse(value, _repo)
7
- ::Time.parse(value)
7
+ ::Time.parse(value).utc
8
8
  end
9
9
  end
10
10
  end
@@ -72,7 +72,7 @@ module Dato
72
72
  end
73
73
 
74
74
  def updated_at
75
- Time.parse(entity.updated_at)
75
+ Time.parse(entity.updated_at).utc
76
76
  end
77
77
 
78
78
  def to_s
@@ -18,6 +18,8 @@ require 'dato/upload/file'
18
18
  require 'dato/upload/image'
19
19
  require 'dato/api_error'
20
20
 
21
+ require 'cacert'
22
+
21
23
  module Dato
22
24
  module Site
23
25
  class Client
@@ -65,6 +67,13 @@ module Dato
65
67
 
66
68
  def request(*args)
67
69
  connection.send(*args).body.with_indifferent_access
70
+ rescue Faraday::SSLError => e
71
+ raise e if ENV['SSL_CERT_FILE'] == Cacert.pem
72
+
73
+ Cacert.set_in_env
74
+ request(*args)
75
+ rescue Faraday::ConnectionFailed, Faraday::TimeoutError => e
76
+ raise e
68
77
  rescue Faraday::ClientError => e
69
78
  raise ApiError, e
70
79
  end
data/lib/dato/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dato
3
- VERSION = '0.1.23'
3
+ VERSION = '0.1.24'
4
4
  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.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-11 00:00:00.000000000 Z
11
+ date: 2016-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -290,6 +290,20 @@ dependencies:
290
290
  - - ">="
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: cacert
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
293
307
  description: Ruby client for DatoCMS API
294
308
  email:
295
309
  - s.verna@cantierecreativo.net
@@ -396,4 +410,3 @@ signing_key:
396
410
  specification_version: 4
397
411
  summary: Ruby client for DatoCMS API
398
412
  test_files: []
399
- has_rdoc: