dato 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -0
- data/README.md +2 -6
- data/dato.gemspec +1 -1
- data/lib/dato/version.rb +1 -1
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e329219fdc49be66749f4f2b31747b18f347b35732d5c72b33fc6b824811f51d
|
4
|
+
data.tar.gz: 702e5c6547e278cc8175bdfee6ecf5c36075f8f6ceaabf467e93c3bb89eab5af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7c8e2e8b43806eb37f1e9da47ce2fcd375f1c09bdcd32fafc3c92b312b0ab4f13d3f6c37cc74bf525d0b368461cd8e7d7d178763339044bba976d47a21675a
|
7
|
+
data.tar.gz: '0078f5dce062b0336ff1169d149cf6978d65c07101e5ac007a855abc03a7c179fc5dab7661f3c0d206104b5f47bae0dbb39a2bcc563d0da47e25d3c75282960f'
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# v0.6.1
|
2
|
+
|
3
|
+
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.
|
4
|
+
|
5
|
+
We also added a new `deserialize_response` option to every call, that you can use if you want to retrieve the exact payload the DatoCMS returns:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
require "dato"
|
9
|
+
client = Dato::Site::Client.new("YOUR-API-KEY")
|
10
|
+
|
11
|
+
# `deserialize_response` is true by default:
|
12
|
+
access_token = client.access_tokens.create(name: "New token", role: "34")
|
13
|
+
|
14
|
+
# {
|
15
|
+
# "id" => "312",
|
16
|
+
# "hardcoded_type" => nil,
|
17
|
+
# "name" => "New token",
|
18
|
+
# "token" => "XXXX",
|
19
|
+
# "role" => "34"
|
20
|
+
# }
|
21
|
+
|
22
|
+
# if `deserialize_response` is false, this will be the result
|
23
|
+
access_token = client.access_tokens.create({ name: "New token", role: "34" }, deserialize_response: false)
|
24
|
+
|
25
|
+
# {
|
26
|
+
# "data": {
|
27
|
+
# "type": "access_token",
|
28
|
+
# "id": "312",
|
29
|
+
# "attributes": {
|
30
|
+
# "name": "New token",
|
31
|
+
# "token": "XXXX",
|
32
|
+
# "hardcoded_type": nil
|
33
|
+
# },
|
34
|
+
# "relationships": {
|
35
|
+
# "role": {
|
36
|
+
# "data": {
|
37
|
+
# "type": "role",
|
38
|
+
# "id": "34"
|
39
|
+
# }
|
40
|
+
# }
|
41
|
+
# }
|
42
|
+
# }
|
43
|
+
# }
|
44
|
+
```
|
45
|
+
|
46
|
+
In our doc pages we also added some examples for the super-handy `all_pages` option which was already present since v0.3.29:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
# if you want to fetch all the pages with just one call:
|
50
|
+
client.items.all({ "filter[type]" => "44" }, all_pages: true)
|
51
|
+
```
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ CLI tool for DatoCMS (https://www.datocms.com).
|
|
6
6
|
|
7
7
|
## How to integrate DatoCMS with Jekyll
|
8
8
|
|
9
|
-
Please head over the [Jekyll section of our documentation](https://
|
9
|
+
Please head over the [Jekyll section of our documentation](https://www.datocms.com/docs/jekyll/) to learn everything you need to get started.
|
10
10
|
|
11
11
|
## How to integrate DatoCMS with Middleman
|
12
12
|
|
@@ -14,7 +14,7 @@ For Middleman we have created a nice Middleman extension called [middleman-dato]
|
|
14
14
|
|
15
15
|
## API Client
|
16
16
|
|
17
|
-
This gem also exposes an API client, useful ie. to import existing content in your DatoCMS administrative area. Read our [documentation](https://
|
17
|
+
This gem also exposes an API client, useful ie. to import existing content in your DatoCMS administrative area. Read our [documentation](https://www.datocms.com/content-management-api/) for detailed info.
|
18
18
|
|
19
19
|
## Development
|
20
20
|
|
@@ -22,10 +22,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
22
22
|
|
23
23
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
24
24
|
|
25
|
-
### Updating the client when the API changes
|
26
|
-
|
27
|
-
The DatoCMS API provides an always up-to-date [JSON Hyperschema](http://json-schema.org/latest/json-schema-hypermedia.html): the code of this gem is generated automatically starting from the schema running `rake regenerate`.
|
28
|
-
|
29
25
|
## Contributing
|
30
26
|
|
31
27
|
Bug reports and pull requests are welcome on GitHub at https://github.com/datocms/ruby-datocms-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/dato.gemspec
CHANGED
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'rake', '~> 10.0'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
26
26
|
spec.add_development_dependency 'rubyzip'
|
27
|
-
spec.add_development_dependency 'json_schema'
|
28
27
|
spec.add_development_dependency 'simplecov'
|
29
28
|
spec.add_development_dependency 'vcr'
|
30
29
|
spec.add_development_dependency 'webmock'
|
@@ -45,4 +44,5 @@ Gem::Specification.new do |spec|
|
|
45
44
|
spec.add_runtime_dependency 'dotenv'
|
46
45
|
spec.add_runtime_dependency 'pusher-client'
|
47
46
|
spec.add_runtime_dependency 'listen'
|
47
|
+
spec.add_runtime_dependency 'json_schema'
|
48
48
|
end
|
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: json_schema
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: simplecov
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -346,6 +332,20 @@ dependencies:
|
|
346
332
|
- - ">="
|
347
333
|
- !ruby/object:Gem::Version
|
348
334
|
version: '0'
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: json_schema
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - ">="
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: '0'
|
342
|
+
type: :runtime
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - ">="
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '0'
|
349
349
|
description: Ruby client for DatoCMS API
|
350
350
|
email:
|
351
351
|
- s.verna@cantierecreativo.net
|
@@ -359,6 +359,7 @@ files:
|
|
359
359
|
- ".rubocop.yml"
|
360
360
|
- ".ruby-version"
|
361
361
|
- ".travis.yml"
|
362
|
+
- CHANGELOG.md
|
362
363
|
- CODE_OF_CONDUCT.md
|
363
364
|
- Gemfile
|
364
365
|
- LICENSE.txt
|