Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Because railstie boot after config/initializers.So theme_park.rb must…

… exist.
  • Loading branch information...
commit 4ced6cfb2106e21dd22c08172665f1bdb789b1be 1 parent 0b434f7
Thierry Zires authored
25 lib/generators/templates/theme_park.rb
@@ -11,17 +11,16 @@
11 11 # |- views
12 12 # |- layouts
13 13 #
14   -# Uncomment below lines if you really need to.
  14 +# Change below lines if you really need to.
15 15 # ===
16   -# ThemePark.setup do |config|
17   -#
18   -# config.root = "#{::Rails.root}/themes/"
19   -# config.prefix = 'themes'
20   -# config.images_path = ':root/:name/assets/images'
21   -# config.javascripts_path = ':root/:name/assets/javascripts'
22   -# config.stylesheets_path = ':root/:name/assets/stylesheets'
23   -# config.compiled_path = ':root/:name/assets/compiled'
24   -# config.views_path = ':root/:name/views'
25   -#
26   -# end
27   -# ===
  16 +ThemePark.setup do |config|
  17 +
  18 + config.root = "#{::Rails.root}/themes/"
  19 + config.prefix = 'themes'
  20 + config.images_path = ':root/:name/assets/images'
  21 + config.javascripts_path = ':root/:name/assets/javascripts'
  22 + config.stylesheets_path = ':root/:name/assets/stylesheets'
  23 + config.compiled_path = ':root/:name/assets/compiled'
  24 + config.views_path = ':root/:name/views'
  25 +
  26 +end
5 lib/generators/theme_park/create_generator.rb
... ... @@ -1,11 +1,6 @@
1 1 # encoding: utf-8
2 2 require 'fileutils'
3 3
4   -begin
5   - require File.join(::Rails.root, 'config', 'initializers', 'theme_park.rb')
6   -rescue Exception => e
7   -end
8   -
9 4 module ThemePark
10 5 module Generators
11 6 class CreateGenerator < ::Rails::Generators::Base
14 lib/theme_park/railtie.rb
@@ -14,16 +14,10 @@ class Railtie < ::Rails::Railtie
14 14 initializer "ThemePark.environment", :group => :all do |app|
15 15
16 16 config = app.config
17   -
18   - config.theme_park = ThemePark.setup do |config|
19   - config.root = "#{::Rails.root}/themes/"
20   - config.prefix = 'themes'
21   - config.images_path = ':root/:name/assets/images'
22   - config.javascripts_path = ':root/:name/assets/javascripts'
23   - config.stylesheets_path = ':root/:name/assets/stylesheets'
24   - config.compiled_path = ':root/:name/assets/compiled'
25   - config.views_path = ':root/:name/views'
26   - end
  17 +
  18 + # Because this is boot after initializer file.
  19 + # So config/initializers/theme_park.rb must exist.
  20 + config.theme_park = ThemePark
27 21
28 22 ActiveSupport.on_load(:action_view) do
29 23 ActionView::Helpers::AssetTagHelper.send :include, ThemePark::Rails::AssetTagHelper

0 comments on commit 4ced6cf

Please sign in to comment.
Something went wrong with that request. Please try again.