Class: Toppings::Generators::ComponentsGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions, Helper::BaseFileHelper, Helper::IndexFileHelper, Helper::PathHelper
Defined in:
lib/toppings/generators/components_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helper::PathHelper

#root_file_path, #stylesheets_path

Class Method Details

.source_rootObject



37
38
39
# File 'lib/toppings/generators/components_generator.rb', line 37

def source_root
  template_path.join('components')
end

Instance Method Details

#create_component_fileObject



15
16
17
18
19
20
# File 'lib/toppings/generators/components_generator.rb', line 15

def create_component_file
  self.class.base_name = type.pluralize
  template rescued_sass_partial(type), base_path.join(sassy_file_name(name, partial: true))
  create_file index_file_path, skip: true
  append_import name, index_file_path
end