aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2012-02-16 08:12:53 +0200
committerUģis Ozols <ugis.ozolss@gmail.com>2012-02-16 08:12:53 +0200
commit45cad84f4986ec9a1d78a5ced1a842f7a9048b5d (patch)
tree521776b5aea5c0e092ad35a75b4196d5f025513b /lib
parente05fedb9b77b18a176d916313f73c55963b29610 (diff)
downloadrefinerycms-blog-45cad84f4986ec9a1d78a5ced1a842f7a9048b5d.tar.gz
refinerycms-blog-45cad84f4986ec9a1d78a5ced1a842f7a9048b5d.tar.bz2
refinerycms-blog-45cad84f4986ec9a1d78a5ced1a842f7a9048b5d.zip
Generate blog initializer when running rails g refinery:blog. Closes #196.
Diffstat (limited to 'lib')
-rw-r--r--lib/generators/refinery/blog/blog_generator.rb6
-rw-r--r--lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb15
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/generators/refinery/blog/blog_generator.rb b/lib/generators/refinery/blog/blog_generator.rb
index 6c0a604..a9a54da 100644
--- a/lib/generators/refinery/blog/blog_generator.rb
+++ b/lib/generators/refinery/blog/blog_generator.rb
@@ -1,6 +1,12 @@
module Refinery
class BlogGenerator < Rails::Generators::Base
+ source_root File.expand_path("../templates", __FILE__)
+
+ def generate_blog_initializer
+ template "config/initializers/refinery/blog.rb.erb", File.join(destination_root, "config", "initializers", "refinery", "blog.rb")
+ end
+
def rake_db
rake("refinery_blog:install:migrations")
end
diff --git a/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb
new file mode 100644
index 0000000..8a2bc8e
--- /dev/null
+++ b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb
@@ -0,0 +1,15 @@
+Refinery::Blog.configure do |config|
+ # config.validate_source_url = <%= Refinery::Blog.validate_source_url.inspect %>
+
+ # config.comments_per_page = <%= Refinery::Blog.comments_per_page.inspect %>
+
+ # config.posts_per_page = <%= Refinery::Blog.posts_per_page.inspect %>
+
+ # config.post_teaser_length = <%= Refinery::Blog.post_teaser_length.inspect %>
+
+ # config.approximate_ascii = <%= Refinery::Blog.approximate_ascii.inspect %>
+
+ # config.strip_non_ascii = <%= Refinery::Blog.strip_non_ascii.inspect %>
+
+ # config.share_this_key = <%= Refinery::Blog.share_this_key.inspect %>
+end