module I0n module Generators class LayoutGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) def setup_application_for_haml inject_into_file 'config/application.rb', IO.read("#{LayoutGenerator.source_root}/config/_application.rb", :after => 'config.encoding = "utf-8"' end def create_compass_config copy_file 'config/initializers/compass.rb', 'config/initializers/compass.rb' copy_file 'config/compass.rb', 'config/compass.rb' end def create_sass_extensions copy_file 'lib/sass_extensions', 'lib/sass_extensions' end def create_sass_directory directory 'app/sass', 'app/sass' end def create_layout copy_file 'app/views/layout/application.haml', 'app/views/layout/application.haml' copy_file 'app/views/shared/_error_messages.haml', 'app/views/shared/_error_messages.haml' end end end end