Sha256: da0d7d9e3582878a5ab39ebecae68c68a1c482f31cd05ab172bbba549828f1d8

Contents?: true

Size: 744 Bytes

Versions: 12

Compression:

Stored size: 744 Bytes

Contents

# Generates a new section.
class SectionGenerator < Rails::Generators::Base
  argument :name, :type => :string

  def parse_arguments
    @section = SectionsRails::Section.new name
  end

  def create_folder
    empty_directory @section.folder_filepath
  end

  def create_partial
    create_file "#{@section.partial_filepath}.html.haml",
                ".#{@section.filename}\n  -# DOM content goes here.\n"
  end

  def create_coffee_file
    create_file "#{@section.asset_filepath}.coffee",
                "class #{@section.filename}\n  # Your CoffeeScript code goes here.\n"
  end

  def create_sass_file
    create_file "#{@section.asset_filepath}.sass",
                ".#{@section.filename}\n  /* Your SASS goes here. */\n"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sections_rails-0.11.0 lib/generators/section_generator.rb
sections_rails-0.10.0 lib/generators/section_generator.rb
sections_rails-0.9.0 lib/generators/section_generator.rb
sections_rails-0.8.1 lib/generators/section_generator.rb
sections_rails-0.8.0 lib/generators/section_generator.rb
sections_rails-0.7.2 lib/generators/section_generator.rb
sections_rails-0.7.1 lib/generators/section_generator.rb
sections_rails-0.7.0 lib/generators/section_generator.rb
sections_rails-0.6.12 lib/generators/section_generator.rb
sections_rails-0.6.11 lib/generators/section_generator.rb
sections_rails-0.6.10 lib/generators/section_generator.rb
sections_rails-0.6.9 lib/generators/section_generator.rb