push_type_core 0.5.0.alpha.2 → 0.5.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/fields/push_type/asset_field.rb +5 -16
  3. data/app/fields/push_type/date_field.rb +2 -9
  4. data/app/fields/push_type/markdown_field.rb +4 -12
  5. data/app/fields/push_type/matrix_field.rb +11 -11
  6. data/app/fields/push_type/node_field.rb +22 -0
  7. data/app/fields/push_type/number_field.rb +3 -9
  8. data/app/fields/push_type/repeater_field.rb +7 -9
  9. data/app/fields/push_type/select_field.rb +7 -10
  10. data/app/fields/push_type/tag_list_field.rb +5 -11
  11. data/app/fields/push_type/taxonomy_field.rb +6 -47
  12. data/app/fields/push_type/text_field.rb +3 -3
  13. data/app/fields/push_type/time_field.rb +2 -9
  14. data/app/models/concerns/push_type/customizable.rb +8 -8
  15. data/db/migrate/20150531183944_add_field_store_default_values.rb +6 -0
  16. data/lib/generators/push_type/field/templates/field.rb +1 -1
  17. data/lib/push_type/field_type.rb +9 -53
  18. data/lib/push_type/fields/arrays.rb +23 -0
  19. data/lib/push_type/fields/base.rb +65 -0
  20. data/lib/push_type/fields/class_methods.rb +21 -0
  21. data/lib/push_type/fields/relations.rb +39 -0
  22. data/lib/push_type/fields/ui.rb +16 -0
  23. data/lib/push_type/version.rb +1 -1
  24. data/test/dummy/config/initializers/push_type.rb +1 -1
  25. data/test/dummy/config/secrets.yml +2 -2
  26. data/test/dummy/db/migrate/20150601132822_add_field_store_default_values.push_type.rb +7 -0
  27. data/test/dummy/db/schema.rb +7 -7
  28. data/test/dummy/log/test.log +2390 -2383
  29. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-Sjd8yE8radAZWLZz1Hn9eTc5vPZke6_-U1eg-KNjy8.cache +0 -0
  30. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RwmiAHIoiRN917L4TQ8saQaj1DsQgMpS97RYvkK2D5M.cache +0 -0
  31. data/test/dummy/tmp/generators/app/models/category.rb +6 -0
  32. data/test/dummy/tmp/generators/app/views/taxonomies/category.html.erb +3 -0
  33. data/test/lib/push_type/field_type_test.rb +0 -8
  34. data/test/models/concerns/push_type/customizable_test.rb +1 -1
  35. metadata +31 -21
  36. data/app/fields/push_type/array_field.rb +0 -15
  37. data/test/dummy/tmp/generators/app/presenters/page_presenter.rb +0 -12
  38. /data/test/dummy/db/migrate/{20150429164551_create_push_type_users.push_type.rb → 20150601132816_create_push_type_users.push_type.rb} +0 -0
  39. /data/test/dummy/db/migrate/{20150429164552_create_push_type_nodes.push_type.rb → 20150601132817_create_push_type_nodes.push_type.rb} +0 -0
  40. /data/test/dummy/db/migrate/{20150429164553_create_push_type_node_hierarchies.push_type.rb → 20150601132818_create_push_type_node_hierarchies.push_type.rb} +0 -0
  41. /data/test/dummy/db/migrate/{20150429164554_create_push_type_assets.push_type.rb → 20150601132819_create_push_type_assets.push_type.rb} +0 -0
  42. /data/test/dummy/db/migrate/{20150429164555_create_push_type_taxonomies.push_type.rb → 20150601132820_create_push_type_taxonomies.push_type.rb} +0 -0
  43. /data/test/dummy/db/migrate/{20150429164556_create_push_type_taxonomy_hierarchies.push_type.rb → 20150601132821_create_push_type_taxonomy_hierarchies.push_type.rb} +0 -0
  44. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{BL-JC9Mha5EbAlzAR0-4qZvqO8u_54SF5Z2ZaoDjlfw.cache → H_FtcM4uZms6K7jOADXRW2-Q5luNbbboPJ8haQyA17A.cache} +0 -0
  45. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{OC9Pezno0-bFKhuLASN_oxeMelP7hAYHfMDOdC916tY.cache → khjpnuHaHw24GnTbWlsRS6uIuTqIkrfvc2dY1aZWtpk.cache} +0 -0
@@ -0,0 +1,6 @@
1
+ class Category < PushType::Taxonomy
2
+
3
+ # Set base slug
4
+ # base_slug :category
5
+
6
+ end
@@ -0,0 +1,3 @@
1
+ <h1><%= @taxonomy.title %></h1>
2
+ <p>This is a generated Category template.</p>
3
+ <p>Find me at: app/views/taxonomies/category.html.erb</p>
@@ -43,7 +43,6 @@ module PushType
43
43
  describe NumberField do
44
44
  let(:field) { PushType::NumberField.new :foo }
45
45
  it { field.form_helper.must_equal :number_field }
46
- it { field.from_json(val).must_equal 1 }
47
46
  it { field.to_json(val).must_equal 1 }
48
47
  end
49
48
 
@@ -69,13 +68,6 @@ module PushType
69
68
  end
70
69
  end
71
70
 
72
- describe ArrayField do
73
- let(:field) { PushType::ArrayField.new :foo }
74
- it { field.param.must_equal foo: [] }
75
- it { field.to_json(val).must_equal ['1'] }
76
- it { field.from_json(val).must_equal ['1'] }
77
- end
78
-
79
71
  describe TagListField do
80
72
  let(:field) { PushType::TagListField.new :foo }
81
73
  it { field.template.must_equal 'tag_list' }
@@ -36,7 +36,7 @@ module PushType
36
36
  TestPage.instance_variable_set '@fields', ActiveSupport::OrderedHash.new
37
37
  TestPage.field :foo
38
38
  TestPage.field :bar, :text
39
- TestPage.field :baz, :array
39
+ TestPage.field :baz, :tag_list
40
40
  end
41
41
  after { TestPage.instance_variable_set '@fields', ActiveSupport::OrderedHash.new }
42
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_type_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.alpha.2
4
+ version: 0.5.0.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Russell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -140,11 +140,11 @@ files:
140
140
  - app/controllers/front_end_controller.rb
141
141
  - app/controllers/nodes_front_end_controller.rb
142
142
  - app/controllers/taxonomies_front_end_controller.rb
143
- - app/fields/push_type/array_field.rb
144
143
  - app/fields/push_type/asset_field.rb
145
144
  - app/fields/push_type/date_field.rb
146
145
  - app/fields/push_type/markdown_field.rb
147
146
  - app/fields/push_type/matrix_field.rb
147
+ - app/fields/push_type/node_field.rb
148
148
  - app/fields/push_type/number_field.rb
149
149
  - app/fields/push_type/repeater_field.rb
150
150
  - app/fields/push_type/select_field.rb
@@ -176,6 +176,7 @@ files:
176
176
  - db/migrate/20141127151930_create_push_type_assets.rb
177
177
  - db/migrate/20150310115933_create_push_type_taxonomies.rb
178
178
  - db/migrate/20150310123230_create_push_type_taxonomy_hierarchies.rb
179
+ - db/migrate/20150531183944_add_field_store_default_values.rb
179
180
  - lib/generators/push_type/dummy/dummy_generator.rb
180
181
  - lib/generators/push_type/dummy/templates/application.rb
181
182
  - lib/generators/push_type/dummy/templates/boot.rb
@@ -200,6 +201,11 @@ files:
200
201
  - lib/push_type/core.rb
201
202
  - lib/push_type/core/engine.rb
202
203
  - lib/push_type/field_type.rb
204
+ - lib/push_type/fields/arrays.rb
205
+ - lib/push_type/fields/base.rb
206
+ - lib/push_type/fields/class_methods.rb
207
+ - lib/push_type/fields/relations.rb
208
+ - lib/push_type/fields/ui.rb
203
209
  - lib/push_type/menu_builder.rb
204
210
  - lib/push_type/menu_builder/dsl/menu.rb
205
211
  - lib/push_type/menu_builder/dsl/menu_item.rb
@@ -254,12 +260,13 @@ files:
254
260
  - test/dummy/config/locales/en.yml
255
261
  - test/dummy/config/routes.rb
256
262
  - test/dummy/config/secrets.yml
257
- - test/dummy/db/migrate/20150429164551_create_push_type_users.push_type.rb
258
- - test/dummy/db/migrate/20150429164552_create_push_type_nodes.push_type.rb
259
- - test/dummy/db/migrate/20150429164553_create_push_type_node_hierarchies.push_type.rb
260
- - test/dummy/db/migrate/20150429164554_create_push_type_assets.push_type.rb
261
- - test/dummy/db/migrate/20150429164555_create_push_type_taxonomies.push_type.rb
262
- - test/dummy/db/migrate/20150429164556_create_push_type_taxonomy_hierarchies.push_type.rb
263
+ - test/dummy/db/migrate/20150601132816_create_push_type_users.push_type.rb
264
+ - test/dummy/db/migrate/20150601132817_create_push_type_nodes.push_type.rb
265
+ - test/dummy/db/migrate/20150601132818_create_push_type_node_hierarchies.push_type.rb
266
+ - test/dummy/db/migrate/20150601132819_create_push_type_assets.push_type.rb
267
+ - test/dummy/db/migrate/20150601132820_create_push_type_taxonomies.push_type.rb
268
+ - test/dummy/db/migrate/20150601132821_create_push_type_taxonomy_hierarchies.push_type.rb
269
+ - test/dummy/db/migrate/20150601132822_add_field_store_default_values.push_type.rb
263
270
  - test/dummy/db/schema.rb
264
271
  - test/dummy/db/seeds.rb
265
272
  - test/dummy/log/test.log
@@ -270,13 +277,14 @@ files:
270
277
  - test/dummy/public/robots.txt
271
278
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/-Sjd8yE8radAZWLZz1Hn9eTc5vPZke6_-U1eg-KNjy8.cache
272
279
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/0_aw7up97T_NTvobuzf-o1Xpynz3Eqo7lyRTdE_M3kg.cache
273
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BL-JC9Mha5EbAlzAR0-4qZvqO8u_54SF5Z2ZaoDjlfw.cache
274
280
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/H3MYWnNh74SPmIVutQpgqiLFgQBaPIZ8rUXz8S1IXfQ.cache
281
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/H_FtcM4uZms6K7jOADXRW2-Q5luNbbboPJ8haQyA17A.cache
275
282
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/I6zXuKkTIFbRK1A1tWK7nMeIhOXwx4iMRyZCdQatqy8.cache
276
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/OC9Pezno0-bFKhuLASN_oxeMelP7hAYHfMDOdC916tY.cache
277
283
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/RwmiAHIoiRN917L4TQ8saQaj1DsQgMpS97RYvkK2D5M.cache
278
284
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/YfvOcAtfd0a4AoZRwhfEPbutzGvytNV3PLH99tHHVec.cache
279
- - test/dummy/tmp/generators/app/presenters/page_presenter.rb
285
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/khjpnuHaHw24GnTbWlsRS6uIuTqIkrfvc2dY1aZWtpk.cache
286
+ - test/dummy/tmp/generators/app/models/category.rb
287
+ - test/dummy/tmp/generators/app/views/taxonomies/category.html.erb
280
288
  - test/files/audio.m3u
281
289
  - test/files/document.pdf
282
290
  - test/files/image.png
@@ -367,12 +375,13 @@ test_files:
367
375
  - test/dummy/config/routes.rb
368
376
  - test/dummy/config/secrets.yml
369
377
  - test/dummy/config.ru
370
- - test/dummy/db/migrate/20150429164551_create_push_type_users.push_type.rb
371
- - test/dummy/db/migrate/20150429164552_create_push_type_nodes.push_type.rb
372
- - test/dummy/db/migrate/20150429164553_create_push_type_node_hierarchies.push_type.rb
373
- - test/dummy/db/migrate/20150429164554_create_push_type_assets.push_type.rb
374
- - test/dummy/db/migrate/20150429164555_create_push_type_taxonomies.push_type.rb
375
- - test/dummy/db/migrate/20150429164556_create_push_type_taxonomy_hierarchies.push_type.rb
378
+ - test/dummy/db/migrate/20150601132816_create_push_type_users.push_type.rb
379
+ - test/dummy/db/migrate/20150601132817_create_push_type_nodes.push_type.rb
380
+ - test/dummy/db/migrate/20150601132818_create_push_type_node_hierarchies.push_type.rb
381
+ - test/dummy/db/migrate/20150601132819_create_push_type_assets.push_type.rb
382
+ - test/dummy/db/migrate/20150601132820_create_push_type_taxonomies.push_type.rb
383
+ - test/dummy/db/migrate/20150601132821_create_push_type_taxonomy_hierarchies.push_type.rb
384
+ - test/dummy/db/migrate/20150601132822_add_field_store_default_values.push_type.rb
376
385
  - test/dummy/db/schema.rb
377
386
  - test/dummy/db/seeds.rb
378
387
  - test/dummy/log/test.log
@@ -385,13 +394,14 @@ test_files:
385
394
  - test/dummy/README.rdoc
386
395
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/-Sjd8yE8radAZWLZz1Hn9eTc5vPZke6_-U1eg-KNjy8.cache
387
396
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/0_aw7up97T_NTvobuzf-o1Xpynz3Eqo7lyRTdE_M3kg.cache
388
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BL-JC9Mha5EbAlzAR0-4qZvqO8u_54SF5Z2ZaoDjlfw.cache
389
397
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/H3MYWnNh74SPmIVutQpgqiLFgQBaPIZ8rUXz8S1IXfQ.cache
398
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/H_FtcM4uZms6K7jOADXRW2-Q5luNbbboPJ8haQyA17A.cache
390
399
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/I6zXuKkTIFbRK1A1tWK7nMeIhOXwx4iMRyZCdQatqy8.cache
391
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/OC9Pezno0-bFKhuLASN_oxeMelP7hAYHfMDOdC916tY.cache
400
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/khjpnuHaHw24GnTbWlsRS6uIuTqIkrfvc2dY1aZWtpk.cache
392
401
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/RwmiAHIoiRN917L4TQ8saQaj1DsQgMpS97RYvkK2D5M.cache
393
402
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/YfvOcAtfd0a4AoZRwhfEPbutzGvytNV3PLH99tHHVec.cache
394
- - test/dummy/tmp/generators/app/presenters/page_presenter.rb
403
+ - test/dummy/tmp/generators/app/models/category.rb
404
+ - test/dummy/tmp/generators/app/views/taxonomies/category.html.erb
395
405
  - test/files/audio.m3u
396
406
  - test/files/document.pdf
397
407
  - test/files/image.png
@@ -1,15 +0,0 @@
1
- module PushType
2
- class ArrayField < PushType::FieldType
3
- def param
4
- { name.to_sym => [] }
5
- end
6
-
7
- def to_json(val)
8
- Array(val)
9
- end
10
-
11
- def from_json(val)
12
- Array(val)
13
- end
14
- end
15
- end
@@ -1,12 +0,0 @@
1
- class PagePresenter < PushType::Presenter
2
-
3
- # This class delegates to the model, Page
4
- # Override any methods to add custom presentation logic
5
- # View helpers are accessible from the `h` method
6
-
7
- # Example:
8
- # def title
9
- # h.content_tag :strong, super()
10
- # end
11
-
12
- end