Class: ManifoldMock::Generators::TemplateGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ManifoldMock::Generators::TemplateGenerator
- Defined in:
- lib/generators/manifold_mock/template_generator.rb
Constant Summary collapse
- ZB_TEMPLATES =
['banded','blog', 'feed', 'grid', 'orbit', 'banner-home', 'sidebar']
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/generators/manifold_mock/template_generator.rb', line 12 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#create_template ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/manifold_mock/template_generator.rb', line 16 def create_template if ZB_TEMPLATES.include?(.template) && .framework == "foundation" if .haml? remove_file "app/views/layouts/application.html.erb" template "foundation/haml/#{.template}.html.haml", "app/views/layouts/application.html.haml" else remove_file "app/views/layouts/application.html.haml" template "foundation/erb/#{.template}.html.erb", "app/views/layouts/application.html.erb" end else raise "template not found." end end |