dato 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/dato.gemspec +1 -0
- data/lib/dato/local/items_repo.rb +9 -9
- data/lib/dato/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda04ab33c8c0dcec4f924cb9a985ceb78d01454
|
4
|
+
data.tar.gz: 7545c95c99a528f173ce2c9101f20be150d95797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4d8309a94256b0de2458c8064d2119b819ffd1312ebf2bb14b074f3ff9d551806d1516cab636fd24b36fcba9099fa19e5cadad1e218e8ce3a9f5b853244e8fb
|
7
|
+
data.tar.gz: 87553d265f9d8d90288c75ae77feb9b18d8be80caba1e0a5dea9db0d17007a43f01a363617fadc8a3f10a1fe3ab52bffa7476ebe5ad8dda239e8564da051ed7d
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# DatoCMS Ruby Client
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/datocms/ruby-datocms-client.svg?branch=master)](https://travis-ci.org/datocms/ruby-datocms-client) [![Gem Version](https://badge.fury.io/rb/dato.svg)](https://badge.fury.io/rb/dato)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/datocms/ruby-datocms-client/badge.svg?branch=master)](https://coveralls.io/github/datocms/ruby-datocms-client?branch=master) [![Build Status](https://travis-ci.org/datocms/ruby-datocms-client.svg?branch=master)](https://travis-ci.org/datocms/ruby-datocms-client) [![Gem Version](https://badge.fury.io/rb/dato.svg)](https://badge.fury.io/rb/dato)
|
4
4
|
|
5
5
|
Ruby client for the DatoCMS API.
|
6
6
|
|
data/dato.gemspec
CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency 'webmock'
|
33
33
|
spec.add_development_dependency 'rubocop'
|
34
34
|
spec.add_development_dependency 'diff_dirs'
|
35
|
+
spec.add_development_dependency 'coveralls'
|
35
36
|
|
36
37
|
spec.add_runtime_dependency 'faraday', ['>= 0.9.0']
|
37
38
|
spec.add_runtime_dependency 'faraday_middleware', ['>= 0.9.0']
|
@@ -41,6 +41,14 @@ module Dato
|
|
41
41
|
entities_repo.find_entities_of_type('item_type')
|
42
42
|
end
|
43
43
|
|
44
|
+
def single_instance_item_types
|
45
|
+
item_types.select(&:singleton)
|
46
|
+
end
|
47
|
+
|
48
|
+
def collection_item_types
|
49
|
+
item_types - single_instance_item_types
|
50
|
+
end
|
51
|
+
|
44
52
|
def items_of_type(item_type)
|
45
53
|
method, singleton = item_type_methods[item_type]
|
46
54
|
|
@@ -61,7 +69,7 @@ module Dato
|
|
61
69
|
def build_item_type_methods!
|
62
70
|
@item_type_methods = {}
|
63
71
|
|
64
|
-
singleton_keys =
|
72
|
+
singleton_keys = single_instance_item_types.map(&:api_key)
|
65
73
|
collection_keys = collection_item_types.map(&:api_key)
|
66
74
|
.map(&:pluralize)
|
67
75
|
|
@@ -110,14 +118,6 @@ module Dato
|
|
110
118
|
entities_repo.find_entities_of_type('item')
|
111
119
|
end
|
112
120
|
|
113
|
-
def singleton_item_types
|
114
|
-
item_types.select(&:singleton)
|
115
|
-
end
|
116
|
-
|
117
|
-
def collection_item_types
|
118
|
-
item_types - singleton_item_types
|
119
|
-
end
|
120
|
-
|
121
121
|
def method_missing(method, *arguments, &block)
|
122
122
|
if collections_by_type.key?(method) && arguments.empty?
|
123
123
|
collections_by_type[method]
|
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.25
|
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
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: coveralls
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: faraday
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -410,3 +424,4 @@ signing_key:
|
|
410
424
|
specification_version: 4
|
411
425
|
summary: Ruby client for DatoCMS API
|
412
426
|
test_files: []
|
427
|
+
has_rdoc:
|