conglomerate 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/conglomerate/datum.rb +1 -0
- data/lib/conglomerate/datum_builder.rb +1 -0
- data/lib/conglomerate/version.rb +1 -1
- data/spec/datum_spec.rb +6 -0
- data/spec/particle_builder_spec.rb +14 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21eda82883baa92aa51c7c06efb36c93db21d7bc
|
4
|
+
data.tar.gz: 8a87dcb2ae4cab923a71d36d358f4db41f5659cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a832f6a31cdcd9f317dcf03884618f84c69ef04eedd8d7af165ff9162449ae38b41ca27a4a02588617a9ab7b20ccee7d2c90d9255e98c51ad9d05ea3955e42a0
|
7
|
+
data.tar.gz: 34b7ccdee95768b1b11714b0d510ff204e8e96c3aad12781ced3aa69592e8167ea8b5c0168b9d1b4cbd05dd5d2c35f71934a8c5ba7c69d9b6022b13d5da6546b
|
data/README.md
CHANGED
@@ -127,10 +127,10 @@ end
|
|
127
127
|
}
|
128
128
|
```
|
129
129
|
|
130
|
-
##
|
131
|
-
|
132
|
-
- Use more defaults to simplify the creation of serializers.
|
130
|
+
## Collection+JSON Extensions
|
133
131
|
|
132
|
+
[Command Templates](https://gist.github.com/semmons99/6280650)
|
133
|
+
[Data Properties](https://gist.github.com/semmons99/0e02ece6e079cfac27c0)
|
134
134
|
## Contributing
|
135
135
|
|
136
136
|
1. Fork it ( http://github.com/teamsnap/conglomerate/fork )
|
data/lib/conglomerate/datum.rb
CHANGED
data/lib/conglomerate/version.rb
CHANGED
data/spec/datum_spec.rb
CHANGED
@@ -19,5 +19,11 @@ describe Conglomerate::Datum do
|
|
19
19
|
expect(datum).to respond_to(:"prompt=")
|
20
20
|
expect { datum.prompt = 3 }.to raise_error
|
21
21
|
end
|
22
|
+
|
23
|
+
specify "type" do
|
24
|
+
datum = Conglomerate::Datum.new(:name => "name")
|
25
|
+
expect(datum).to respond_to(:"type=")
|
26
|
+
expect { datum.type = 3 }.to raise_error
|
27
|
+
end
|
22
28
|
end
|
23
29
|
end
|
@@ -16,9 +16,9 @@ class ConglomerateTestParticleSerializer
|
|
16
16
|
datum :roster_id
|
17
17
|
datum :team_ids
|
18
18
|
|
19
|
-
datum :event_date_time
|
20
|
-
datum :event_date
|
21
|
-
datum :event_time
|
19
|
+
datum :event_date_time, :type => "datetime"
|
20
|
+
datum :event_date, :type => "date"
|
21
|
+
datum :event_time, :type => "time"
|
22
22
|
datum :alternately_named_event_time, :value => Proc.new{ item.event_time }
|
23
23
|
|
24
24
|
datum :is_available
|
@@ -36,7 +36,7 @@ class ConglomerateTestParticleSerializer
|
|
36
36
|
|
37
37
|
template do
|
38
38
|
datum :repeats, :prompt => "true|false"
|
39
|
-
datum :description, :prompt => "awesome"
|
39
|
+
datum :description, :prompt => "awesome", :type => "string"
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -216,9 +216,9 @@ describe Conglomerate do
|
|
216
216
|
{"name" => "event_id", "value" => 2},
|
217
217
|
{"name" => "roster_id", "value" => nil},
|
218
218
|
{"name" => "team_ids", "value" => [1,2]},
|
219
|
-
{"name" => "event_date_time", "value" => "1981-11-28T10:00:00Z"},
|
220
|
-
{"name" => "event_date", "value" => "1981-11-28"},
|
221
|
-
{"name" => "event_time", "value" => "1981-11-28T10:00:00Z"},
|
219
|
+
{"name" => "event_date_time", "value" => "1981-11-28T10:00:00Z", "type" => "datetime"},
|
220
|
+
{"name" => "event_date", "value" => "1981-11-28", "type" => "date"},
|
221
|
+
{"name" => "event_time", "value" => "1981-11-28T10:00:00Z", "type" => "time"},
|
222
222
|
{"name" => "alternately_named_event_time", "value" => "1981-11-28T10:00:00Z"},
|
223
223
|
{"name" => "is_available", "value" => false}
|
224
224
|
],
|
@@ -255,9 +255,9 @@ describe Conglomerate do
|
|
255
255
|
{"name" => "event_id", "value" => 2},
|
256
256
|
{"name" => "roster_id", "value" => nil},
|
257
257
|
{"name" => "team_ids", "value" => [1,2]},
|
258
|
-
{"name" => "event_date_time", "value" => "1981-11-28T10:00:00Z"},
|
259
|
-
{"name" => "event_date", "value" => "1981-11-28"},
|
260
|
-
{"name" => "event_time", "value" => "1981-11-28T10:00:00Z"},
|
258
|
+
{"name" => "event_date_time", "value" => "1981-11-28T10:00:00Z", "type" => "datetime"},
|
259
|
+
{"name" => "event_date", "value" => "1981-11-28", "type" => "date"},
|
260
|
+
{"name" => "event_time", "value" => "1981-11-28T10:00:00Z", "type" => "time"},
|
261
261
|
{"name" => "alternately_named_event_time", "value" => "1981-11-28T10:00:00Z"},
|
262
262
|
{"name" => "is_available", "value" => false}
|
263
263
|
],
|
@@ -275,9 +275,9 @@ describe Conglomerate do
|
|
275
275
|
{"name" => "event_id", "value" => 3},
|
276
276
|
{"name" => "roster_id", "value" => nil},
|
277
277
|
{"name" => "team_ids", "value" => [3,4]},
|
278
|
-
{"name" => "event_date_time", "value" => "1982-01-22T10:00:00Z"},
|
279
|
-
{"name" => "event_date", "value" => "1981-01-22"},
|
280
|
-
{"name" => "event_time", "value" => "1981-01-22T10:00:00Z"},
|
278
|
+
{"name" => "event_date_time", "value" => "1982-01-22T10:00:00Z", "type" => "datetime"},
|
279
|
+
{"name" => "event_date", "value" => "1981-01-22", "type" => "date"},
|
280
|
+
{"name" => "event_time", "value" => "1981-01-22T10:00:00Z", "type" => "time"},
|
281
281
|
{"name" => "alternately_named_event_time", "value" => "1981-01-22T10:00:00Z"},
|
282
282
|
{"name" => "is_available", "value" => true}
|
283
283
|
],
|
@@ -300,7 +300,7 @@ describe Conglomerate do
|
|
300
300
|
it "includes a valid template if attributes have them" do
|
301
301
|
expect(test_collection["template"]["data"]).to match_array(
|
302
302
|
[
|
303
|
-
{"name" => "description", "value" => nil, "prompt" => "awesome"},
|
303
|
+
{"name" => "description", "value" => nil, "prompt" => "awesome", "type" => "string"},
|
304
304
|
{"name" => "repeats", "value" => nil, "prompt" => "true|false"}
|
305
305
|
]
|
306
306
|
)
|