push_type_core 0.2.0.beta2 → 0.2.0

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 (24) hide show
  1. checksums.yaml +4 -4
  2. data/config/initializers/dragonfly.rb +0 -13
  3. data/lib/generators/push_type/install/install_generator.rb +1 -1
  4. data/lib/generators/push_type/install/templates/push_type.rb +26 -8
  5. data/lib/push_type/config.rb +31 -0
  6. data/lib/push_type/core/engine.rb +5 -12
  7. data/lib/push_type/core.rb +12 -1
  8. data/test/dummy/config/initializers/push_type.rb +26 -8
  9. data/test/dummy/config/secrets.yml +2 -2
  10. data/test/dummy/db/schema.rb +1 -1
  11. data/test/dummy/log/test.log +1244 -1242
  12. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  13. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  15. data/test/dummy/tmp/generators/app/models/home_page.rb +10 -0
  16. data/test/dummy/tmp/generators/app/views/nodes/home_page.html.erb +3 -0
  17. data/test/lib/push_type/core_test.rb +0 -1
  18. metadata +21 -20
  19. data/test/dummy/tmp/generators/config/initializers/push_type.rb +0 -15
  20. data/test/dummy/tmp/generators/config/routes.rb +0 -59
  21. /data/test/dummy/db/migrate/{20150208150305_create_push_type_users.push_type.rb → 20150209204334_create_push_type_users.push_type.rb} +0 -0
  22. /data/test/dummy/db/migrate/{20150208150306_create_push_type_nodes.push_type.rb → 20150209204335_create_push_type_nodes.push_type.rb} +0 -0
  23. /data/test/dummy/db/migrate/{20150208150307_create_push_type_node_hierarchies.push_type.rb → 20150209204336_create_push_type_node_hierarchies.push_type.rb} +0 -0
  24. /data/test/dummy/db/migrate/{20150208150308_create_push_type_assets.push_type.rb → 20150209204337_create_push_type_assets.push_type.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 913da9e49a877e4f10781017676afbf8f87356a9
4
- data.tar.gz: 5d277256f7eb5ca7b6f744dbfb203b6169f39f23
3
+ metadata.gz: 027e8e1c338edaa1fbc4b8fabb37328db231b35f
4
+ data.tar.gz: 006c080eab42cc183f85fffcccf8067a86e85d1f
5
5
  SHA512:
6
- metadata.gz: e9dede54e2d4e68d5ffe2a552abe6d9f6e0066c754d260a9af0055afc50128ea212fecee691fc748e4d43305655a41be47122ba3dd6d278b5ea251daef56d4fa
7
- data.tar.gz: e204e54912e6538c9350c6aad38cc8522b55d7bf341cf88679c78427380126f790e6bc7ebfccffdfca4dc4979689ef34eee928bea99df140918a964ceb44be47
6
+ metadata.gz: 6807bd9745cf1937350e426f2cff294c61c2221070417fdbf464a4038dcb4a90752a6bc55a81918a92a6f8bb721157e735eafe95289b7cd2d9b585b2843adf3c
7
+ data.tar.gz: bf37b3cff59b95aa6f734df9224e0353cf407429be57b595a44da0b1fa43c39d7cdbd8f754360f761b2bb8bbec3ba65f7c4fc9158ecf483059ccddb3c6d8f62c
@@ -1,16 +1,3 @@
1
- # Configure
2
- Dragonfly.app.configure do
3
- plugin :imagemagick
4
-
5
- secret "6fa0d3bcb6c44e897ca39a48eb86eb6262e4351bd0311674ff350ebaeb08c982"
6
-
7
- url_format "/media/:job/:name"
8
-
9
- datastore :file,
10
- root_path: Rails.root.join('public/system/dragonfly', Rails.env),
11
- server_root: Rails.root.join('public')
12
- end
13
-
14
1
  # Logger
15
2
  Dragonfly.logger = Rails.logger
16
3
 
@@ -7,7 +7,7 @@ module PushType
7
7
  class_option :migrate, type: :boolean, default: true
8
8
 
9
9
  def create_push_type_initializer
10
- copy_file 'push_type.rb', 'config/initializers/push_type.rb'
10
+ template 'push_type.rb', 'config/initializers/push_type.rb'
11
11
  end
12
12
 
13
13
  def inject_push_type_routes
@@ -1,15 +1,33 @@
1
1
  PushType.setup do |config|
2
2
 
3
- #config.root_nodes = :all
3
+ config.root_nodes = :all
4
4
 
5
- #config.home_slug = 'home'
5
+ config.unexposed_nodes = []
6
6
 
7
- #config.unexposed_nodes = []
7
+ config.home_slug = 'home'
8
8
 
9
- #config.media_styles = {
10
- # large: '1024x1024>',
11
- # medium: '512x512>',
12
- # small: '256x256>'
13
- #}
9
+ config.media_styles = {
10
+ large: '1024x1024>',
11
+ medium: '512x512>',
12
+ small: '256x256>'
13
+ }
14
+
15
+ # Dragonfly datastore configuration
16
+ config.dragonfly_datastore = :file
17
+ config.dragonfly_datastore_options = {
18
+ root_path: Rails.root.join('public/system/dragonfly', Rails.env),
19
+ server_root: Rails.root.join('public')
20
+ }
21
+
22
+ # For S3 storage, remember to add to Gemfile:
23
+ # gem 'dragonfly-s3_data_store'
24
+ # config.dragonfly_datastore = :s3
25
+ # config.dragonfly_datastore_options = {
26
+ # bucket_name: ENV['S3_BUCKET'],
27
+ # access_key_id: ENV['S3_ACCESS_KEY_ID'],
28
+ # secret_access_key: ENV['SECRET_ACCESS_KEY_ID']
29
+ # }
30
+
31
+ # config.dragonfly_secret = '<%= SecureRandom.hex(32) %>'
14
32
 
15
33
  end
@@ -0,0 +1,31 @@
1
+ module PushType
2
+ module Config
3
+
4
+ mattr_accessor :root_nodes
5
+ @@root_nodes = :all
6
+
7
+ mattr_accessor :unexposed_nodes
8
+ @@unexposed_nodes = []
9
+
10
+ mattr_accessor :home_slug
11
+ @@home_slug = 'home'
12
+
13
+ mattr_accessor :media_styles
14
+ @@media_styles = {
15
+ large: '1024x1024>',
16
+ medium: '512x512>',
17
+ small: '256x256>'
18
+ }
19
+
20
+
21
+ mattr_accessor :dragonfly_datastore
22
+ @@dragonfly_datastore = nil
23
+
24
+ mattr_accessor :dragonfly_datastore_options
25
+ @@dragonfly_datastore_options = nil
26
+
27
+ mattr_accessor :dragonfly_secret
28
+ @@dragonfly_secret = nil
29
+
30
+ end
31
+ end
@@ -4,18 +4,6 @@ module PushType
4
4
  isolate_namespace PushType
5
5
  engine_name 'push_type'
6
6
 
7
- config.root_nodes = :all
8
-
9
- config.home_slug = 'home'
10
-
11
- config.unexposed_nodes = []
12
-
13
- config.media_styles = {
14
- large: '1024x1024>',
15
- medium: '512x512>',
16
- small: '256x256>'
17
- }
18
-
19
7
  config.generators do |g|
20
8
  g.assets false
21
9
  g.helper false
@@ -27,6 +15,11 @@ module PushType
27
15
  config.to_prepare do
28
16
  Rails.application.eager_load! unless Rails.application.config.cache_classes
29
17
  end
18
+
19
+ initializer 'push_type.dragonfly_config' do
20
+ PushType.config.dragonfly_secret ||= Rails.application.secrets.secret_key_base
21
+ PushType.dragonfly_app_setup!
22
+ end
30
23
  end
31
24
  end
32
25
  end
@@ -6,7 +6,7 @@ module PushType
6
6
  class << self
7
7
 
8
8
  def config
9
- PushType::Core::Engine.config
9
+ PushType::Config
10
10
  end
11
11
 
12
12
  def setup(&block)
@@ -36,12 +36,23 @@ module PushType
36
36
  end
37
37
  end.sort
38
38
  end
39
+
40
+ def dragonfly_app_setup!
41
+ Dragonfly.app.configure do
42
+ plugin :imagemagick
43
+ url_format "/media/:job/:name"
44
+ secret PushType.config.dragonfly_secret
45
+ datastore PushType.config.dragonfly_datastore, PushType.config.dragonfly_datastore_options
46
+ end
47
+ end
48
+
39
49
  end
40
50
 
41
51
  module Core
42
52
  end
43
53
  end
44
54
 
55
+ require 'push_type/config'
45
56
  require 'push_type/core/engine'
46
57
  require 'push_type/rails/routes'
47
58
  require 'push_type/field_type'
@@ -1,15 +1,33 @@
1
1
  PushType.setup do |config|
2
2
 
3
- #config.root_nodes = :all
3
+ config.root_nodes = :all
4
4
 
5
- #config.home_slug = 'home'
5
+ config.unexposed_nodes = []
6
6
 
7
- #config.unexposed_nodes = []
7
+ config.home_slug = 'home'
8
8
 
9
- #config.media_styles = {
10
- # large: '1024x1024>',
11
- # medium: '512x512>',
12
- # small: '256x256>'
13
- #}
9
+ config.media_styles = {
10
+ large: '1024x1024>',
11
+ medium: '512x512>',
12
+ small: '256x256>'
13
+ }
14
+
15
+ # Dragonfly datastore configuration
16
+ config.dragonfly_datastore = :file
17
+ config.dragonfly_datastore_options = {
18
+ root_path: Rails.root.join('public/system/dragonfly', Rails.env),
19
+ server_root: Rails.root.join('public')
20
+ }
21
+
22
+ # For S3 storage, remember to add to Gemfile:
23
+ # gem 'dragonfly-s3_data_store'
24
+ # config.dragonfly_datastore = :s3
25
+ # config.dragonfly_datastore_options = {
26
+ # bucket_name: ENV['S3_BUCKET'],
27
+ # access_key_id: ENV['S3_ACCESS_KEY_ID'],
28
+ # secret_access_key: ENV['SECRET_ACCESS_KEY_ID']
29
+ # }
30
+
31
+ # config.dragonfly_secret = '2fcd8782bda2cc7d4af5e73debc5f20ee72ed291ae1bf5c61c70131294fcde45'
14
32
 
15
33
  end
@@ -11,10 +11,10 @@
11
11
  # if you're sharing your code publicly.
12
12
 
13
13
  development:
14
- secret_key_base: dd929b927bce31a05356eda301eb4836880033a9bca7ca756470c41356c995062c6dc0135b672e9834b74aed8bb5ac42c3ce97a224705e4ddae074f5bedb5df8
14
+ secret_key_base: 0aa228f56c34f505dfbe61ac5f9833cf6536d4c55c52e6b2af9ebf1c8baf2c4ba4a395a361955b120b344c2e6b548d9c0547fca8d8da5dcbace5718ea9bd888f
15
15
 
16
16
  test:
17
- secret_key_base: 9ec793b11cb3c0ddce5aa08671eb39b9657bc95b1d0c1042d7666733b2138dde01b54e8f413155992a6d7a2b63e0133d3028105d440e204c9018de4a4f4d6d16
17
+ secret_key_base: 320fa42023072869c0c5042f0523a849026b8f3b2718c8e70863035f966aca0b9924c7aee6572c19823837a04c40e88efa37169a099b9e02164a7ef7d023dc4b
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150208150308) do
14
+ ActiveRecord::Schema.define(version: 20150209204337) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"