dato 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato/account/client.rb +3 -7
- data/lib/dato/site/client.rb +3 -7
- data/lib/dato/upload/file.rb +3 -1
- data/lib/dato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6ffeb74c86a321901eeaf73084308fa26e0181
|
4
|
+
data.tar.gz: 6fd4ca5ad2a9f8fdb846970ac065603740c19436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1870915a900d2e7877acba29fbb74cf4a578bda4a21b2566959f1d5189431514b43dd61e2d5d601d5e42f95cc0caf76410660a908120cb23fcda6a9815a4f88b
|
7
|
+
data.tar.gz: ff7093aeeb4cbadb4bec71fae0066bedbeb6e5fa37fe11e1e867eefaff58d06354063c2a69e33d468c77e7a22e7cccc3132753e840f5e0b9dcfab0903e16f025
|
data/lib/dato/account/client.rb
CHANGED
@@ -22,14 +22,10 @@ module Dato
|
|
22
22
|
|
23
23
|
attr_reader :token, :base_url, :schema, :extra_headers
|
24
24
|
|
25
|
-
def initialize(
|
26
|
-
token,
|
27
|
-
base_url: 'https://account-api.datocms.com',
|
28
|
-
extra_headers: {}
|
29
|
-
)
|
30
|
-
@base_url = base_url
|
25
|
+
def initialize(token, options = {})
|
31
26
|
@token = token
|
32
|
-
@
|
27
|
+
@base_url = options[:base_url] || 'https://account-api.datocms.com'
|
28
|
+
@extra_headers = options[:extra_headers] || {}
|
33
29
|
end
|
34
30
|
|
35
31
|
REPOS.each do |method_name, repo_klass|
|
data/lib/dato/site/client.rb
CHANGED
@@ -35,14 +35,10 @@ module Dato
|
|
35
35
|
|
36
36
|
attr_reader :token, :base_url, :schema, :extra_headers
|
37
37
|
|
38
|
-
def initialize(
|
39
|
-
token,
|
40
|
-
base_url: 'https://site-api.datocms.com',
|
41
|
-
extra_headers: {}
|
42
|
-
)
|
43
|
-
@base_url = base_url
|
38
|
+
def initialize(token, options = {})
|
44
39
|
@token = token
|
45
|
-
@
|
40
|
+
@base_url = options[:base_url] || 'https://site-api.datocms.com'
|
41
|
+
@extra_headers = options[:extra_headers] || {}
|
46
42
|
end
|
47
43
|
|
48
44
|
def upload_file(path_or_url)
|
data/lib/dato/upload/file.rb
CHANGED
@@ -16,7 +16,9 @@ module Dato
|
|
16
16
|
|
17
17
|
def file
|
18
18
|
@file ||= if http_source?
|
19
|
-
|
19
|
+
uri = Addressable::URI.parse(source)
|
20
|
+
ext = ::File.extname(uri.path)
|
21
|
+
Tempfile.new(['file', ext]).tap do |file|
|
20
22
|
Downloadr::HTTP.new(source, file).download
|
21
23
|
end
|
22
24
|
else
|
data/lib/dato/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.31
|
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-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|