Class: Card::Generators::FormatGenerator
- Inherits:
-
NamedBase
- Object
- Rails::Generators::NamedBase
- NamedBase
- Card::Generators::FormatGenerator
- Defined in:
- lib/generators/card/format/format_generator.rb
Instance Method Summary collapse
Methods inherited from NamedBase
Methods included from ClassMethods
Instance Method Details
#create_files ⇒ Object
15 16 17 18 |
# File 'lib/generators/card/format/format_generator.rb', line 15 def create_files template "format_template.erb", format_path template "format_spec_template.erb", format_path("spec") end |
#format_path(modifier = nil) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/generators/card/format/format_generator.rb', line 20 def format_path modifier=nil suffix = modifier ? "_#{modifier}" : nil filename = "#{module_name}_format#{suffix}.rb" path_parts = [mod_path, modifier, "format", filename].compact File.join(*path_parts) end |