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.
- checksums.yaml +4 -4
- data/config/initializers/dragonfly.rb +0 -13
- data/lib/generators/push_type/install/install_generator.rb +1 -1
- data/lib/generators/push_type/install/templates/push_type.rb +26 -8
- data/lib/push_type/config.rb +31 -0
- data/lib/push_type/core/engine.rb +5 -12
- data/lib/push_type/core.rb +12 -1
- data/test/dummy/config/initializers/push_type.rb +26 -8
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/test.log +1244 -1242
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/generators/app/models/home_page.rb +10 -0
- data/test/dummy/tmp/generators/app/views/nodes/home_page.html.erb +3 -0
- data/test/lib/push_type/core_test.rb +0 -1
- metadata +21 -20
- data/test/dummy/tmp/generators/config/initializers/push_type.rb +0 -15
- data/test/dummy/tmp/generators/config/routes.rb +0 -59
- /data/test/dummy/db/migrate/{20150208150305_create_push_type_users.push_type.rb → 20150209204334_create_push_type_users.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150208150306_create_push_type_nodes.push_type.rb → 20150209204335_create_push_type_nodes.push_type.rb} +0 -0
- /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
- /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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 027e8e1c338edaa1fbc4b8fabb37328db231b35f
|
4
|
+
data.tar.gz: 006c080eab42cc183f85fffcccf8067a86e85d1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
3
|
+
config.root_nodes = :all
|
4
4
|
|
5
|
-
|
5
|
+
config.unexposed_nodes = []
|
6
6
|
|
7
|
-
|
7
|
+
config.home_slug = 'home'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
data/lib/push_type/core.rb
CHANGED
@@ -6,7 +6,7 @@ module PushType
|
|
6
6
|
class << self
|
7
7
|
|
8
8
|
def config
|
9
|
-
PushType::
|
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
|
-
|
3
|
+
config.root_nodes = :all
|
4
4
|
|
5
|
-
|
5
|
+
config.unexposed_nodes = []
|
6
6
|
|
7
|
-
|
7
|
+
config.home_slug = 'home'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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:
|
14
|
+
secret_key_base: 0aa228f56c34f505dfbe61ac5f9833cf6536d4c55c52e6b2af9ebf1c8baf2c4ba4a395a361955b120b344c2e6b548d9c0547fca8d8da5dcbace5718ea9bd888f
|
15
15
|
|
16
16
|
test:
|
17
|
-
secret_key_base:
|
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.
|
data/test/dummy/db/schema.rb
CHANGED
@@ -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:
|
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"
|