Class: Card::Generators::SetGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/generators/card/set/set_generator.rb

Instance Method Summary collapse

Methods included from ClassMethods

#banner, #source_root

Instance Method Details

#create_filesObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/card/set/set_generator.rb', line 15

def create_files
  mod_path = if options.core?
               File.join Cardio.gem_root, 'mod', file_name
             else
               File.join 'mod', file_name
    end
  set_path  = File.join(mod_path, 'set', set_pattern, anchors[0..-2], "#{anchors.last}.rb")
  spec_path = File.join(mod_path, 'spec', 'set', set_pattern, anchors[0..-2], "#{anchors.last}_spec.rb")
  template 'set_template.erb', set_path
  template 'set_spec_template.erb', spec_path
end