Class: RogerStyleGuide::Generators::ComponentGenerator
- Inherits:
-
Roger::Generators::Base
- Object
- Roger::Generators::Base
- RogerStyleGuide::Generators::ComponentGenerator
- Defined in:
- lib/roger_style_guide/generators/component_generator.rb
Overview
The component generator
Class Method Summary collapse
Instance Method Summary collapse
- #component_name ⇒ Object
- #components_path ⇒ Object
- #do ⇒ Object
- #partial_extension ⇒ Object
- #project_template_path ⇒ Object
- #source_paths ⇒ Object
Class Method Details
.source_root ⇒ Object
37 38 39 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 37 def self.source_root end |
Instance Method Details
#component_name ⇒ Object
58 59 60 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 58 def component_name name end |
#components_path ⇒ Object
66 67 68 69 70 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 66 def components_path [:components_path] && Pathname.new([:components_path]) || Roger::Cli::Base.project && Roger::Cli::Base.project.html_path + RogerStyleGuide.components_paths[0] end |
#do ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 49 def do self.destination_root = components_path = {} [:exclude_pattern] = /.js\Z/ unless [:js] directory(".", component_name, ) end |
#partial_extension ⇒ Object
62 63 64 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 62 def partial_extension [:extension] end |
#project_template_path ⇒ Object
72 73 74 75 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 72 def project_template_path Roger::Cli::Base.project && Roger::Cli::Base.project.path + "lib/component_template" end |
#source_paths ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 41 def source_paths if [:template_path] [[:template_path]] else [project_template_path, File.dirname(__FILE__) + "/component/template"] end end |