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
35 36 37 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 35 def self.source_root end |
Instance Method Details
#component_name ⇒ Object
56 57 58 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 56 def component_name name end |
#components_path ⇒ Object
64 65 66 67 68 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 64 def components_path [:components_path] && Pathname.new([:components_path]) || Roger::Cli::Base.project && Roger::Cli::Base.project.html_path + RogerStyleGuide.components_path end |
#do ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 47 def do self.destination_root = components_path = {} [:exclude_pattern] = /.js\Z/ unless [:js] directory(".", component_name, ) end |
#partial_extension ⇒ Object
60 61 62 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 60 def partial_extension [:extension] end |
#project_template_path ⇒ Object
70 71 72 73 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 70 def project_template_path Roger::Cli::Base.project && Roger::Cli::Base.project.path + "lib/component_template" end |
#source_paths ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/roger_style_guide/generators/component_generator.rb', line 39 def source_paths if [:template_path] [[:template_path]] else [project_template_path, File.dirname(__FILE__) + "/component/template"] end end |