class ManifoldMock::Generators::TemplateGenerator

Constants

ZB_TEMPLATES

Public Class Methods

source_root() click to toggle source
# File lib/generators/manifold_mock/template_generator.rb, line 12
def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Public Instance Methods

create_template() click to toggle source
# File lib/generators/manifold_mock/template_generator.rb, line 16
def create_template
  if ZB_TEMPLATES.include?(options.template) && options.framework == "foundation"
    if options.haml?
      remove_file "app/views/layouts/application.html.erb"
      template "foundation/haml/#{options.template}.html.haml", "app/views/layouts/application.html.haml"
    else
      remove_file "app/views/layouts/application.html.haml"
      template "foundation/erb/#{options.template}.html.erb", "app/views/layouts/application.html.erb"
    end
  else
    raise "template not found."
  end
end