Sha256: 51b879781a77fe0c49239ea38377e9954e218f6bd2696d94cbad715b97bb2182

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

module I0n
  module Generators
    class LayoutGenerator < Rails::Generators::Base

      source_root File.expand_path('../templates', __FILE__)

      def gemfile
        # File minification 
        gem 'smurf' 
        # Templates
        gem 'haml'
        gem 'haml-rails' 
        # Stylesheets
        gem "compass"
        gem 'compass-susy-plugin'
      end

      def setup_application
        application do
          "
      config.generators do |g|
        g.stylesheets false
        g.template_engine :haml
      end
          "
        end  
      end

      def create_compass_config
        copy_file "config/initializers/compass.rb", "#{Rails.root}/config/initializers/compass.rb" 
        copy_file "config/compass.rb", "#{Rails.root}/config/compass.rb"
      end

      def create_sass_extensions
        copy_file "lib/sass_extensions.rb", "#{Rails.root}/lib/sass_extensions.rb" 
      end

      def create_sass_directory
        directory "app/sass", "#{Rails.root}/app/sass"    
      end

      def create_layout
        copy_file "app/views/layouts/application.haml", "#{Rails.root}/app/views/layouts/application.haml"
        copy_file "app/views/shared/_error_messages.haml", "#{Rails.root}/app/views/shared/_error_messages.haml" 
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i0n_rails3_generators-0.2.9 lib/generators/i0n/layout/layout_generator.rb