Sha256: 52730616eafc03801b0c18c307a114299349edbab1b43777be666ac4e5622f11

Contents?: true

Size: 708 Bytes

Versions: 7

Compression:

Stored size: 708 Bytes

Contents

module ScssBoilerplate
  module Generators
    class NamespaceGenerator < ::Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)
      
      argument :namespace, :type => :string, :default => "application"

      def generate_namespace
        # create namespace
        template "namespace.css.scss", "app/assets/stylesheets/#{namespace}.css.scss"
        directory "namespace", "app/assets/stylesheets/#{namespace}"
        # add import to manifest
        manifest = "app/assets/stylesheets/application.css.scss"
        create_file manifest unless File.exists? manifest
        append_to_file manifest, "\n@import \"#{namespace}.css.scss\";"
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scss-boilerplate-rails-0.1.6 ./lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.5 ./lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.4 ./lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.3 lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.2 lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.1 lib/generators/scss_boilerplate/namespace/namespace_generator.rb
scss-boilerplate-rails-0.1.0 lib/generators/scss_boilerplate/namespace/namespace_generator.rb