Class: SectionGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SectionGenerator
- Defined in:
- lib/generators/section_generator.rb
Overview
Generates a new section.
Instance Method Summary collapse
- #create_coffee_file ⇒ Object
- #create_folder ⇒ Object
- #create_partial ⇒ Object
- #create_sass_file ⇒ Object
- #parse_arguments ⇒ Object
Instance Method Details
#create_coffee_file ⇒ Object
18 19 20 21 |
# File 'lib/generators/section_generator.rb', line 18 def create_coffee_file create_file "#{@section.asset_filepath}.coffee", "class #{@section.filename}\n # Your CoffeeScript code goes here.\n" end |
#create_folder ⇒ Object
9 10 11 |
# File 'lib/generators/section_generator.rb', line 9 def create_folder empty_directory @section.folder_filepath end |
#create_partial ⇒ Object
13 14 15 16 |
# File 'lib/generators/section_generator.rb', line 13 def create_partial create_file "#{@section.partial_filepath}.html.haml", ".#{@section.filename}\n -# DOM content goes here.\n" end |
#create_sass_file ⇒ Object
23 24 25 26 |
# File 'lib/generators/section_generator.rb', line 23 def create_sass_file create_file "#{@section.asset_filepath}.sass", ".#{@section.filename}\n /* Your SASS goes here. */\n" end |
#parse_arguments ⇒ Object
5 6 7 |
# File 'lib/generators/section_generator.rb', line 5 def parse_arguments @section = SectionsRails::Section.new name end |