Class: SuperTemplate::Generators::TemplateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
AbstractGenerator
Defined in:
lib/generators/super_template/template/template_generator.rb

Instance Method Summary collapse

Methods included from AbstractGenerator

#copy_view_file

Instance Method Details

#create_sidecar_file ⇒ Object



18
19
20
21
22
# File 'lib/generators/super_template/template/template_generator.rb', line 18

def create_sidecar_file
  unless options[:inline]
    create_file File.join(template_path, class_path, "#{file_name}_template.#{options[:format]}.#{options[:template_engine]}")
  end
end

#create_template_file ⇒ Object



24
25
26
# File 'lib/generators/super_template/template/template_generator.rb', line 24

def create_template_file
  template "template.rb.erb", File.join(template_path, class_path, "#{file_name}_template.rb")
end