push_type_core 0.10.0.beta.3 → 0.10.0.beta.5

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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/push_type/application_controller_methods.rb +2 -0
  3. data/app/controllers/front_end_controller.rb +26 -12
  4. data/app/models/push_type/node.rb +11 -1
  5. data/lib/push_type/core/engine.rb +0 -11
  6. data/lib/push_type/rails/routes.rb +3 -3
  7. data/lib/push_type/version.rb +1 -1
  8. data/test/controllers/front_end_controller_test.rb +19 -0
  9. data/test/dummy/config/initializers/push_type.rb +1 -1
  10. data/test/dummy/config/secrets.yml +2 -2
  11. data/test/dummy/db/migrate/{20161116222801_create_push_type_users.push_type.rb → 20161117154442_create_push_type_users.push_type.rb} +0 -0
  12. data/test/dummy/db/migrate/{20161116222802_create_push_type_nodes.push_type.rb → 20161117154443_create_push_type_nodes.push_type.rb} +0 -0
  13. data/test/dummy/db/migrate/{20161116222803_create_push_type_node_hierarchies.push_type.rb → 20161117154444_create_push_type_node_hierarchies.push_type.rb} +0 -0
  14. data/test/dummy/db/migrate/{20161116222804_create_push_type_assets.push_type.rb → 20161117154445_create_push_type_assets.push_type.rb} +0 -0
  15. data/test/dummy/db/migrate/{20161116222805_add_field_store_default_values.push_type.rb → 20161117154446_add_field_store_default_values.push_type.rb} +0 -0
  16. data/test/dummy/db/migrate/{20161116222806_drop_legacy_push_type_taxonomies.push_type.rb → 20161117154447_drop_legacy_push_type_taxonomies.push_type.rb} +0 -0
  17. data/test/dummy/db/schema.rb +1 -1
  18. data/test/dummy/log/test.log +7667 -7437
  19. data/test/dummy/tmp/cache/assets/sprockets/v3.0/{tn/tnKqEfyTQNEMuWAhX3xym0TbSoUwIe8XlKbKLmN8oPA.cache → Eq/EqAqaJ_tfMAtqoArQz8TAEgvbpQnvyKDhWfkgsLgDDk.cache} +0 -0
  20. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VT/VT0xDh7gu1K3uYidKny01QY0vyaeQDbHoPICVlZmQQc.cache +0 -0
  21. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YC/YCmmKydZG1FxHcFZiHcaSZhbT44fV2vJglp5i1fOvAc.cache +0 -0
  22. data/test/dummy/tmp/cache/assets/sprockets/v3.0/{3D/3DiLOA9ufk-bm1-9-hOFWYmGKMgJWxv8xBbSS2pKDN4.cache → pl/plmO1IoJjY_rOEVF1tqlu49tmlR7S7ymF0T7YUqP6Uw.cache} +0 -0
  23. data/test/dummy/tmp/generators/app/models/home_page.rb +12 -0
  24. data/test/dummy/tmp/generators/app/views/nodes/home_page.html.erb +13 -0
  25. data/test/models/push_type/node_test.rb +11 -0
  26. metadata +22 -22
  27. data/test/dummy/tmp/generators/config/initializers/push_type.rb +0 -50
  28. data/test/dummy/tmp/generators/config/routes.rb +0 -15
@@ -0,0 +1,12 @@
1
+ class HomePage < PushType::Node
2
+
3
+ # By default a node can have children of any other node type.
4
+ # Optionally pass a list of acceptable node types or prevent
5
+ # any descendents by passing false.
6
+ has_child_nodes :all
7
+
8
+ # Model the content by adding custom fields to the node.
9
+ field :foo, :string
10
+ field :bar, :text
11
+
12
+ end
@@ -0,0 +1,13 @@
1
+ <h1><%= @node.title %></h1>
2
+ <p>This is a generated HomePage template.</p>
3
+ <p>Find me at: app/views/nodes/home_page.html.erb</p>
4
+
5
+ <div>
6
+ <div>Foo:</div>
7
+ <div><%= @node.foo %></div>
8
+ </div>
9
+ <div>
10
+ <div>Bar:</div>
11
+ <div><%= @node.bar %></div>
12
+ </div>
13
+
@@ -18,6 +18,17 @@ module PushType
18
18
  node.must_be :valid?
19
19
  end
20
20
 
21
+ describe '.find_by_base64_id' do
22
+ let(:node) { n = FactoryGirl.build(:node); n.save(validate: false); n }
23
+ let(:id) { node.base64_id }
24
+ it { PushType::Node.find_by_base64_id(id).must_equal node }
25
+ end
26
+
27
+ describe '#base64_id' do
28
+ let(:node) { n = FactoryGirl.build(:node); n.save(validate: false); n }
29
+ it { Base64.urlsafe_decode64(node.base64_id).must_equal node.id }
30
+ end
31
+
21
32
  describe '#permalink' do
22
33
  before do
23
34
  %w(one two three).each { |slug| @node = FactoryGirl.build(:node, slug: slug, parent: @node); @node.save(validate: false); @node }
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.10.0.beta.3
4
+ version: 0.10.0.beta.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Russell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-16 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -242,12 +242,12 @@ files:
242
242
  - test/dummy/config/routes.rb
243
243
  - test/dummy/config/secrets.yml
244
244
  - test/dummy/config/spring.rb
245
- - test/dummy/db/migrate/20161116222801_create_push_type_users.push_type.rb
246
- - test/dummy/db/migrate/20161116222802_create_push_type_nodes.push_type.rb
247
- - test/dummy/db/migrate/20161116222803_create_push_type_node_hierarchies.push_type.rb
248
- - test/dummy/db/migrate/20161116222804_create_push_type_assets.push_type.rb
249
- - test/dummy/db/migrate/20161116222805_add_field_store_default_values.push_type.rb
250
- - test/dummy/db/migrate/20161116222806_drop_legacy_push_type_taxonomies.push_type.rb
245
+ - test/dummy/db/migrate/20161117154442_create_push_type_users.push_type.rb
246
+ - test/dummy/db/migrate/20161117154443_create_push_type_nodes.push_type.rb
247
+ - test/dummy/db/migrate/20161117154444_create_push_type_node_hierarchies.push_type.rb
248
+ - test/dummy/db/migrate/20161117154445_create_push_type_assets.push_type.rb
249
+ - test/dummy/db/migrate/20161117154446_add_field_store_default_values.push_type.rb
250
+ - test/dummy/db/migrate/20161117154447_drop_legacy_push_type_taxonomies.push_type.rb
251
251
  - test/dummy/db/schema.rb
252
252
  - test/dummy/db/seeds.rb
253
253
  - test/dummy/log/test.log
@@ -258,10 +258,10 @@ files:
258
258
  - test/dummy/public/apple-touch-icon.png
259
259
  - test/dummy/public/favicon.ico
260
260
  - test/dummy/public/robots.txt
261
- - test/dummy/tmp/cache/assets/sprockets/v3.0/3D/3DiLOA9ufk-bm1-9-hOFWYmGKMgJWxv8xBbSS2pKDN4.cache
262
261
  - test/dummy/tmp/cache/assets/sprockets/v3.0/4V/4V4h35yOMMC6CxoIsHSNeCpxS4Ljmip4Hl2_ZZ0CDac.cache
263
262
  - test/dummy/tmp/cache/assets/sprockets/v3.0/9v/9vnNjAebssmz7XPUIgssBZbkNcX-l446wdMdLtHbbyQ.cache
264
263
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Bh/Bhp0_DYasdK0hX0mRKWCZpQTU5CN7XMmpm_kLGhQ-mY.cache
264
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/Eq/EqAqaJ_tfMAtqoArQz8TAEgvbpQnvyKDhWfkgsLgDDk.cache
265
265
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Hc/HcdeXL_NQCzwkHwn5IOfrZzULmR3Di7_rbRmKJcUxd0.cache
266
266
  - test/dummy/tmp/cache/assets/sprockets/v3.0/IU/IUrx_cz11W6a7Js_I-zzSgQEpw58K2zYnJsvznf71Pg.cache
267
267
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Ks/Ksgj75EJWHSroUlBiZ_Yxf1ckdbfDlTBBzqLb1g152Q.cache
@@ -276,10 +276,10 @@ files:
276
276
  - test/dummy/tmp/cache/assets/sprockets/v3.0/n-/n-AVacTIOztKN9mPiB3ZELfidOz1W5urnRN4AsSujqA.cache
277
277
  - test/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache
278
278
  - test/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache
279
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/pl/plmO1IoJjY_rOEVF1tqlu49tmlR7S7ymF0T7YUqP6Uw.cache
279
280
  - test/dummy/tmp/cache/assets/sprockets/v3.0/qN/qNOz7Rvtjul20-XTH3jifHnv-ypnSVomm2Q1nckbmqQ.cache
280
- - test/dummy/tmp/cache/assets/sprockets/v3.0/tn/tnKqEfyTQNEMuWAhX3xym0TbSoUwIe8XlKbKLmN8oPA.cache
281
- - test/dummy/tmp/generators/config/initializers/push_type.rb
282
- - test/dummy/tmp/generators/config/routes.rb
281
+ - test/dummy/tmp/generators/app/models/home_page.rb
282
+ - test/dummy/tmp/generators/app/views/nodes/home_page.html.erb
283
283
  - test/fields/push_type/asset_field_test.rb
284
284
  - test/fields/push_type/boolean_field_test.rb
285
285
  - test/fields/push_type/date_field_test.rb
@@ -399,12 +399,12 @@ test_files:
399
399
  - test/dummy/config/secrets.yml
400
400
  - test/dummy/config/spring.rb
401
401
  - test/dummy/config.ru
402
- - test/dummy/db/migrate/20161116222801_create_push_type_users.push_type.rb
403
- - test/dummy/db/migrate/20161116222802_create_push_type_nodes.push_type.rb
404
- - test/dummy/db/migrate/20161116222803_create_push_type_node_hierarchies.push_type.rb
405
- - test/dummy/db/migrate/20161116222804_create_push_type_assets.push_type.rb
406
- - test/dummy/db/migrate/20161116222805_add_field_store_default_values.push_type.rb
407
- - test/dummy/db/migrate/20161116222806_drop_legacy_push_type_taxonomies.push_type.rb
402
+ - test/dummy/db/migrate/20161117154442_create_push_type_users.push_type.rb
403
+ - test/dummy/db/migrate/20161117154443_create_push_type_nodes.push_type.rb
404
+ - test/dummy/db/migrate/20161117154444_create_push_type_node_hierarchies.push_type.rb
405
+ - test/dummy/db/migrate/20161117154445_create_push_type_assets.push_type.rb
406
+ - test/dummy/db/migrate/20161117154446_add_field_store_default_values.push_type.rb
407
+ - test/dummy/db/migrate/20161117154447_drop_legacy_push_type_taxonomies.push_type.rb
408
408
  - test/dummy/db/schema.rb
409
409
  - test/dummy/db/seeds.rb
410
410
  - test/dummy/log/test.log
@@ -417,12 +417,12 @@ test_files:
417
417
  - test/dummy/public/robots.txt
418
418
  - test/dummy/Rakefile
419
419
  - test/dummy/README.md
420
- - test/dummy/tmp/cache/assets/sprockets/v3.0/3D/3DiLOA9ufk-bm1-9-hOFWYmGKMgJWxv8xBbSS2pKDN4.cache
421
420
  - test/dummy/tmp/cache/assets/sprockets/v3.0/4V/4V4h35yOMMC6CxoIsHSNeCpxS4Ljmip4Hl2_ZZ0CDac.cache
422
421
  - test/dummy/tmp/cache/assets/sprockets/v3.0/9v/9vnNjAebssmz7XPUIgssBZbkNcX-l446wdMdLtHbbyQ.cache
423
422
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Bh/Bhp0_DYasdK0hX0mRKWCZpQTU5CN7XMmpm_kLGhQ-mY.cache
424
423
  - test/dummy/tmp/cache/assets/sprockets/v3.0/bY/bY6iFXjb4GQ6vQhngFtUw77t8vuS5vo_X5acqWO_pxU.cache
425
424
  - test/dummy/tmp/cache/assets/sprockets/v3.0/co/coq7bDnirlRe5Ubmus12avMdwG5atjZpOOc0fS6JeLs.cache
425
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/Eq/EqAqaJ_tfMAtqoArQz8TAEgvbpQnvyKDhWfkgsLgDDk.cache
426
426
  - test/dummy/tmp/cache/assets/sprockets/v3.0/g9/g9WK77HQsQX-LgR1PysZLd_bk7r1dnYWdXuWo0Wm_JY.cache
427
427
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Hc/HcdeXL_NQCzwkHwn5IOfrZzULmR3Di7_rbRmKJcUxd0.cache
428
428
  - test/dummy/tmp/cache/assets/sprockets/v3.0/IU/IUrx_cz11W6a7Js_I-zzSgQEpw58K2zYnJsvznf71Pg.cache
@@ -430,15 +430,15 @@ test_files:
430
430
  - test/dummy/tmp/cache/assets/sprockets/v3.0/n-/n-AVacTIOztKN9mPiB3ZELfidOz1W5urnRN4AsSujqA.cache
431
431
  - test/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache
432
432
  - test/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache
433
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/pl/plmO1IoJjY_rOEVF1tqlu49tmlR7S7ymF0T7YUqP6Uw.cache
433
434
  - test/dummy/tmp/cache/assets/sprockets/v3.0/qN/qNOz7Rvtjul20-XTH3jifHnv-ypnSVomm2Q1nckbmqQ.cache
434
435
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Rw/RwQxsln4oXkMhlSGY35qm1h9zc0CS5B2ArFvT7oG2a4.cache
435
- - test/dummy/tmp/cache/assets/sprockets/v3.0/tn/tnKqEfyTQNEMuWAhX3xym0TbSoUwIe8XlKbKLmN8oPA.cache
436
436
  - test/dummy/tmp/cache/assets/sprockets/v3.0/VT/VT0xDh7gu1K3uYidKny01QY0vyaeQDbHoPICVlZmQQc.cache
437
437
  - test/dummy/tmp/cache/assets/sprockets/v3.0/VT/vTiVJlF_TNDD87ZATW7HFaFu8lZXC3ZvESmDE-QbR6k.cache
438
438
  - test/dummy/tmp/cache/assets/sprockets/v3.0/XM/XM3DBlByPxBkHmk_0YnTMQRksSqlxv1pXVEhlfudgp8.cache
439
439
  - test/dummy/tmp/cache/assets/sprockets/v3.0/YC/YCmmKydZG1FxHcFZiHcaSZhbT44fV2vJglp5i1fOvAc.cache
440
- - test/dummy/tmp/generators/config/initializers/push_type.rb
441
- - test/dummy/tmp/generators/config/routes.rb
440
+ - test/dummy/tmp/generators/app/models/home_page.rb
441
+ - test/dummy/tmp/generators/app/views/nodes/home_page.html.erb
442
442
  - test/fields/push_type/asset_field_test.rb
443
443
  - test/fields/push_type/boolean_field_test.rb
444
444
  - test/fields/push_type/date_field_test.rb
@@ -1,50 +0,0 @@
1
- PushType.setup do |config|
2
-
3
- # By default all node types can be placed at the root of the
4
- # content tree. Alternatively, set an array of node type symbols
5
- # to whiltelist acceptable root nodes.
6
- config.root_nodes = :all
7
-
8
- # Set the slug of the node that the `NodesFrontEndContoller` will
9
- # render when visting the root URL of the site (the homepage).
10
- # This setting can be overridden in config/routes.rb.
11
- config.home_slug = 'home'
12
-
13
- # Set an array of node type symbols which will not be exposed to
14
- # the `NodesFrontEndContoller`. These nodes will not be accessible
15
- # through their permalink.
16
- config.unexposed_nodes = []
17
-
18
- # Media styles allow you to predefine a collection of geometry
19
- # strings for resizing images on the fly with the `Asset#media`
20
- # method. Example: `image.media(:large)`
21
- config.media_styles = {
22
- large: '1024x1024>',
23
- medium: '512x512>',
24
- small: '256x256>'
25
- }
26
-
27
- # Configure the email address to be used as the "from" address
28
- # for PushType's build in mailers.
29
- config.mailer_sender = 'pushtype@example.com'
30
-
31
- # PushType uses Dragonfly for managing uploaded images/assets.
32
- # Dragonfly datastore configuration
33
- config.dragonfly_datastore = :file
34
- config.dragonfly_datastore_options = {
35
- root_path: Rails.root.join('public/system/dragonfly', Rails.env),
36
- server_root: Rails.root.join('public')
37
- }
38
-
39
- # For S3 storage, remember to add to Gemfile:
40
- # gem 'dragonfly-s3_data_store'
41
- # config.dragonfly_datastore = :s3
42
- # config.dragonfly_datastore_options = {
43
- # bucket_name: ENV['S3_BUCKET'],
44
- # access_key_id: ENV['S3_ACCESS_KEY_ID'],
45
- # secret_access_key: ENV['SECRET_ACCESS_KEY_ID']
46
- # }
47
-
48
- # config.dragonfly_secret = 'dc1920e3931b436af827ff34f1699c971fcb6a83c5ca566e2e5991d81c65bd97'
49
-
50
- end
@@ -1,15 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
- # Mount all the registered PushType Rails Engines. This should be placed
4
- # at the end of your routes.rb file to ensure your application routes are
5
- # not overidden by PushType.
6
- #
7
- # Overide the default mount points by passing a hash of options.
8
- # Example:
9
- #
10
- # mount_push_type admin: 'cms', front_end: 'blog'
11
- #
12
- mount_push_type
13
-
14
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
15
- end