Class: Spree::Storefront::Generators::ThemeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Spree::Storefront::Generators::ThemeGenerator
- Defined in:
- lib/generators/spree/storefront/theme/theme_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_paths ⇒ Object
9 10 11 12 13 14 |
# File 'lib/generators/spree/storefront/theme/theme_generator.rb', line 9 def self.source_paths [ File.('templates', __dir__), File.('../../../../../app/views', __dir__) ] end |
Instance Method Details
#copy_theme ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/generators/spree/storefront/theme/theme_generator.rb', line 16 def copy_theme empty_directory "app/models/spree/themes" template "model.rb.tt", "app/models/spree/themes/#{file_name}.rb" empty_directory "app/views/themes" directory "themes/default", "app/views/themes/#{file_name}" append_to_file "config/initializers/spree.rb", after: "Rails.application.config.after_initialize do\n" do " Spree.page_builder.themes << Spree::Themes::#{class_name}\n" end end |