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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d0e7e24faa2c272101163702c11d4f28af77053
4
- data.tar.gz: ad534f262ee4e99463beb4c74b8e04c4c8de09a8
3
+ metadata.gz: 21eda82883baa92aa51c7c06efb36c93db21d7bc
4
+ data.tar.gz: 8a87dcb2ae4cab923a71d36d358f4db41f5659cd
5
5
  SHA512:
6
- metadata.gz: ba39a5727966b540190b98c57712aa09ea6898bd4f6263547bf0b28dbc142ce9f6c14e25dbc6ecef05ed722c6438f698d3ca7017b017cac51b4c2278f5676593
7
- data.tar.gz: af8fbe7b953078f89de45f7da8b903c7e244fda34804df3a4d7b4fd52bde202d88a5043fe2c5d0aa505a57bcf4b922682fa659ba210c78897a2eeb12b53aaec7
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
- ## Roadmap
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 )
@@ -5,5 +5,6 @@ module Conglomerate
5
5
  attribute :name, :type => String, :required => true
6
6
  attribute :value, :cull => false
7
7
  attribute :prompt, :type => String
8
+ attribute :type, :type => String
8
9
  end
9
10
  end
@@ -21,5 +21,6 @@ module Conglomerate
21
21
  value :name
22
22
  value :value
23
23
  value :prompt
24
+ value :type
24
25
  end
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module Conglomerate
2
- VERSION = "0.12.1"
2
+ VERSION = "0.13.0"
3
3
  end
@@ -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
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conglomerate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons