restify 0.1.0.1.b18 → 0.1.0.1.b19
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 +8 -8
- data/lib/restify/collection.rb +11 -1
- data/spec/restify_spec.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWE0N2M2YmUzZDZkZDk1NTJiYjM2MTlhYTIwN2ZhMTg3NDM3MzU3OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjQ0YzU1MDBmM2MyZTkyOGQyOTFiMWI5YTVhMTA4OTkzZTI3NjczNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjRhOWRmNDBhNzcxN2RkNzlkNGExZDM4YjdhNzI5YjYzOTg5MjgxOWZmYjE1
|
10
|
+
MjljZjExZGEyMTU5ZGZjYWYwNTc3ODA2Y2Y5OTQ2M2Q0NjhjMmVjMThhYzM3
|
11
|
+
NmFkOTlkMWRhMTgyZmU0ZmY1MTljMmZlNjM4MjM0YTI0NzM4NjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWViYWYyZGE2ZWZlOTQ0NmZiMDk0N2M4ZWQxOTQwN2E5ZWRmOTQ4OWYwOTU3
|
14
|
+
MTdiNDVmNTFjZDExMGZlNDQyMzk5ODUxNTJmYzdlZTc0ODgwNzljZTQwYTU1
|
15
|
+
YTEyZGVmMDY3MmQwODRjN2ZmMTExNzI3MTY2OWM1ZDdhNmFkYjA=
|
data/lib/restify/collection.rb
CHANGED
@@ -59,7 +59,17 @@ module Restify
|
|
59
59
|
|
60
60
|
class << self
|
61
61
|
def create(client, data, response)
|
62
|
-
data
|
62
|
+
data = data.map do |value|
|
63
|
+
case value
|
64
|
+
when Hash
|
65
|
+
Resource.create client, value, nil
|
66
|
+
when Array
|
67
|
+
create client, value, nil
|
68
|
+
else
|
69
|
+
value
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
63
73
|
relations = response ? response.relations(client) : nil
|
64
74
|
|
65
75
|
new client, relations, data
|
data/spec/restify_spec.rb
CHANGED
@@ -28,7 +28,8 @@ describe Restify do
|
|
28
28
|
[{
|
29
29
|
"name": "John Smith",
|
30
30
|
"url": "http://localhost/base/users/john.smith",
|
31
|
-
"blurb_url": "http://localhost/base/users/john.smith/blurb"
|
31
|
+
"blurb_url": "http://localhost/base/users/john.smith/blurb",
|
32
|
+
"languages": ["de", "en"]
|
32
33
|
},
|
33
34
|
{
|
34
35
|
"name": "Jane Smith",
|
@@ -61,7 +62,8 @@ describe Restify do
|
|
61
62
|
{
|
62
63
|
"name": "John Smith",
|
63
64
|
"url": "http://localhost/base/users/john.smith",
|
64
|
-
"blurb_url": "http://localhost/base/users/john.smith/blurb"
|
65
|
+
"blurb_url": "http://localhost/base/users/john.smith/blurb",
|
66
|
+
"languages": ["de", "en"]
|
65
67
|
}
|
66
68
|
EOF
|
67
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.1.
|
4
|
+
version: 0.1.0.1.b19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: obligation
|