blocky 0.0.1 → 0.0.2

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: 089381daded3ec34ea21f974304efe6d00a6e302
4
- data.tar.gz: 1fa8b37080dc81097f4ed3e00a167e5fedcc8b60
3
+ metadata.gz: 47b5913b5fca8af33a8132ac10b2c218a180b28f
4
+ data.tar.gz: a25276667566652cdd7e7b8f8a071258aab9afd5
5
5
  SHA512:
6
- metadata.gz: e62369eca3ea91377be162f7e7a47d6ac721823bd950ae97689d1d8da57237e84856384e2b673842a1aefb497c299778cc7eff1a02530f19417e6b7c1b813a76
7
- data.tar.gz: 34b739c83c99a224b951130f9d3fb580378879cf99d2b09d5506131566b10b15d4ff75b7bebcb61db098bfcb49c82b5ffed06f8819514be22141972cb6025f92
6
+ metadata.gz: 32d357f0799977ec77c94e8f9c6f3013048d3f58bddbb709c8f93697d74d956b957cd7101960d694d41a8cb6261b5f6c2e20479a32b1d97d09b5c95494859b68
7
+ data.tar.gz: 77e038857499412e99e4d4125e4e90d53d836d2b8eb5a8bf6cb37746d1c5341d4d7f0606a7a597c0487d349ead036505625a0ed063aa065412e32ead6a1aa2f1
data/README.md CHANGED
@@ -50,6 +50,24 @@ By default, any logged in user can create, update, and delete any content block.
50
50
 
51
51
  TODO: Add example for limiting access to admin users.
52
52
 
53
+ ## Usage
54
+
55
+ To create a content block, simply use the `blocky` helper
56
+ and specify a content key in any ERB template:
57
+
58
+ ```erb
59
+ <%= blocky(:features) %>
60
+ ```
61
+
62
+ By default, using the same content key on multiple pages
63
+ will create a separate content block for each page. To
64
+ create a content block that updates across multiple pages,
65
+ include the `global` option when specifying the content block.
66
+
67
+ ```erb
68
+ <%= blocky(:contact_email, global: true) %>
69
+ ```
70
+
53
71
  ## Contributing
54
72
 
55
73
  1. Fork it
@@ -60,7 +60,7 @@
60
60
  <p>
61
61
  <code class="code-block">
62
62
  <span class="tag">&lt;%=</span>
63
- <span class="method">blocky</span>(<span class="symbol">:contact_email</span>)
63
+ <span class="method">blocky</span>(<span class="symbol">:features</span>)
64
64
  <span class="tag">%&gt;</span>
65
65
  </code>
66
66
  </p>
@@ -1,3 +1,3 @@
1
1
  module Blocky
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,94 +1,41 @@
1
- module Blogelator
1
+ module Blocky
2
2
  class InstallGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path("../../../..", __FILE__)
4
-
4
+
5
5
  def ask_questions
6
- @site_name = ask("What is the name of your blog? [Blogelator]")
7
- if @site_name.blank?
8
- @site_name = "Blogelator"
9
- end
10
-
11
- @blogelator_route = ask("What route should be used to access the blog? [/blog]")
12
- if @blogelator_route.blank?
13
- @blogelator_route = "/blog"
6
+ @blocky_route = ask("What route should be used to manage content blocks? [/admin/content]")
7
+ if @blocky_route.blank?
8
+ @blocky_route = "/admin/content"
14
9
  end
15
-
10
+
16
11
  @user_class = ask("What class is used for user authentication? [User]")
17
12
  if @user_class.blank?
18
13
  @user_class = "User"
19
14
  end
20
15
  end
21
-
16
+
22
17
  def create_initializer_file
23
- create_file "config/initializers/blogelator.rb", <<-INITIALIZER
24
- Blogelator.posts_per_page = 5
25
- Blogelator.site_name = "#{@site_name}"
26
- Blogelator.user_class = "#{@user_class}"
27
- Blogelator.s3_access_key_id = ENV["BLOGELATOR_S3_KEY"]
28
- Blogelator.s3_secret_access_key = ENV["BLOGELATOR_S3_SECRET"]
29
- Blogelator.s3_bucket = ENV["BLOGELATOR_S3_BUCKET"]
18
+ create_file "config/initializers/blocky.rb", <<-INITIALIZER
19
+ Blocky.user_class = "#{@user_class}"
20
+ Blocky.s3_access_key_id = ENV["BLOCKY_S3_KEY"]
21
+ Blocky.s3_secret_access_key = ENV["BLOCKY_S3_SECRET"]
22
+ Blocky.s3_bucket = ENV["BLOCKY_S3_BUCKET"]
30
23
  INITIALIZER
31
24
  end
32
-
33
- def create_stylesheets
34
- create_file "app/assets/stylesheets/blogelator/application.css.scss", <<-APPLICATIONCSS
35
- /*
36
- *= require blogelator/application/all
37
- *= require_self
38
- */
39
- APPLICATIONCSS
40
-
41
- create_file "app/assets/stylesheets/blogelator/admin.css.scss", <<-ADMINCSS
42
- /*
43
- *= require blogelator/admin/all
44
- *= require_self
45
- */
46
- ADMINCSS
47
- end
48
-
49
- def copy_variables_file
50
- puts File.expand_path("../../../..", __FILE__)
51
- source = "lib/assets/stylesheets/blogelator/_variables_sample.scss"
52
- destination = "app/assets/stylesheets/blogelator/_variables.scss"
53
- copy_file source, destination
54
- end
55
-
56
- def create_overrides_directory
57
- empty_directory "app/overrides"
58
- end
59
-
60
- def configure_application
61
- application <<-APP
62
25
 
63
- config.to_prepare do
64
- # Load application's model / class decorators
65
- Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
66
- Rails.configuration.cache_classes ? require(c) : load(c)
67
- end
68
-
69
- # Load application's view overrides
70
- Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c|
71
- Rails.configuration.cache_classes ? require(c) : load(c)
72
- end
73
- end
74
- APP
75
- end
76
-
77
26
  def install_migrations
78
- rake "blogelator:install:migrations"
27
+ rake "blocky:install:migrations"
79
28
  end
80
-
29
+
81
30
  def mount_engine
82
31
  insert_into_file(File.join("config", "routes.rb"), :after => "Application.routes.draw do\n") do <<-MOUNTENGINE
83
- # This line mounts Blogelator's routes to the path '#{@blogelator_route}'.
84
- # This means, any requests to '#{@blogelator_route}', will go to Blogelator::PostsController.
32
+ # This line mounts Blocky's routes to the path '#{@blocky_route}'.
33
+ # This means, any requests to '#{@blocky_route}', will go to Blocky::ContentBlocksController.
85
34
  # If you would like to change where this engine is mounted, simply change the :at option to something different.
86
- #
87
- # We ask that you don't use the :as option here, as Blogelator relies on it being the default of "blogelator"
88
- mount Blogelator::Engine, at: "#{@blogelator_route}"
35
+ mount Blocky::Engine, at: "#{@blocky_route}"
89
36
  MOUNTENGINE
90
37
  end
91
38
  end
92
-
39
+
93
40
  end
94
- end
41
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blocky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison