dato 0.6.2 → 0.6.3.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dato/api_client.rb +2 -3
- data/lib/dato/local/loader.rb +13 -2
- data/lib/dato/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15067b99fcc4a58291b9a0f0e4d7526be9a05bfbc701c610a053d7d264e56068
|
4
|
+
data.tar.gz: a9edb33c2f22c72372fcf1816faf21e33fffa4e56da2532716664de2cf66cc54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbdb13300444f185c228a38716fe192dd9a151b3a483ca77227ea2358c0e629af011d8b30e198046e0daba57ce72619059cc9416bc70211f375a80d2ea77eee2
|
7
|
+
data.tar.gz: 6f4e56b6518a23f792b1a2edd9759f7d26edcb21e180051f0e0050980ef0eebc52023ea35536cc57678c0bfebfd0d2cfb528dc1419f7f59c58303e6262b4b783
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# v0.6.2
|
2
|
+
|
3
|
+
Moved `json_schema` as runtime dependency
|
4
|
+
|
1
5
|
# v0.6.1
|
2
6
|
|
3
7
|
The big change is that the methods the client makes available are generated at runtime based on the [JSON Schema of our CMA](https://www.datocms.com/content-management-api/). This means any new API endpoint — or changes to existing ones — will instantly be reflected to the client, without the need to upgrade to the latest client version.
|
data/lib/dato/api_client.rb
CHANGED
@@ -30,10 +30,9 @@ module Dato
|
|
30
30
|
@extra_headers = options[:extra_headers] || {}
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
response = Net::HTTP.get(url)
|
33
|
+
response = Faraday.get("https://#{subdomain}.datocms.com/docs/#{subdomain}-hyperschema.json")
|
35
34
|
|
36
|
-
schema = JsonSchema.parse!(JSON.parse(response))
|
35
|
+
schema = JsonSchema.parse!(JSON.parse(response.body))
|
37
36
|
schema.expand_references!
|
38
37
|
|
39
38
|
schema.definitions.each do |type, schema|
|
data/lib/dato/local/loader.rb
CHANGED
@@ -18,7 +18,18 @@ module Dato
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def load
|
21
|
-
|
21
|
+
threads = [
|
22
|
+
Thread.new { Thread.current[:output] = site },
|
23
|
+
Thread.new { Thread.current[:output] = all_items },
|
24
|
+
Thread.new { Thread.current[:output] = all_uploads }
|
25
|
+
]
|
26
|
+
|
27
|
+
results = threads.map do |t|
|
28
|
+
t.join
|
29
|
+
t[:output]
|
30
|
+
end
|
31
|
+
|
32
|
+
@entities_repo = EntitiesRepo.new(*results)
|
22
33
|
@items_repo = ItemsRepo.new(@entities_repo)
|
23
34
|
end
|
24
35
|
|
@@ -39,7 +50,7 @@ module Dato
|
|
39
50
|
|
40
51
|
def all_uploads
|
41
52
|
client.uploads.all(
|
42
|
-
{},
|
53
|
+
{ "filter[type]" => "used" },
|
43
54
|
deserialize_response: false,
|
44
55
|
all_pages: true
|
45
56
|
)
|
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.6.
|
4
|
+
version: 0.6.3.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -455,9 +455,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
455
455
|
version: '0'
|
456
456
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
457
457
|
requirements:
|
458
|
-
- - "
|
458
|
+
- - ">"
|
459
459
|
- !ruby/object:Gem::Version
|
460
|
-
version:
|
460
|
+
version: 1.3.1
|
461
461
|
requirements: []
|
462
462
|
rubyforge_project:
|
463
463
|
rubygems_version: 2.7.6
|