class Toppings::Generators::SassFileGenerator

Attributes

source_root[RW]

Public Instance Methods

create_file_from_template() click to toggle source
# File lib/toppings/generators/sass_file_generator.rb, line 25
def create_file_from_template
  template sassy_file_name(file_name, dialect: Toppings.conf.sass.template_dialect), file_path(file_name) do |content|
    content if valid_sass?(content)
    Toppings.conf.sass.dialect == 'scss' ? convert_to_scss(content) : content
  end
end
set_current_source_root() click to toggle source
# File lib/toppings/generators/sass_file_generator.rb, line 21
def set_current_source_root
  self.class.source_root = options[:source_root]
end

Private Instance Methods

base_path() click to toggle source
# File lib/toppings/generators/sass_file_generator.rb, line 38
def base_path
  options[:target_path]
end
file_path(file_name) click to toggle source
# File lib/toppings/generators/sass_file_generator.rb, line 34
def file_path(file_name)
  base_path.join(sassy_file_name(file_name))
end