Class: Card::Generators::FormatGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/generators/card/format/format_generator.rb

Instance Method Summary collapse

Methods included from ClassMethods

#banner, #source_root

Instance Method Details

#create_filesObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/card/format/format_generator.rb', line 14

def create_files
  mod_path = if options.core?
               File.join Cardio.gem_root, 'mod', file_name
             else
               File.join 'mod', file_name
    end
  format_path = File.join(mod_path, 'format', "#{module_name}_format.rb")
  spec_path = File.join(mod_path, 'spec', 'format', "#{module_name}_format_spec.rb")
  template 'format_template.erb', format_path
  template 'format_spec_template.erb', spec_path
end