Class: I0n::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- I0n::Generators::LayoutGenerator
- Defined in:
- lib/generators/i0n/layout/layout_generator.rb
Instance Method Summary collapse
- #create_compass_config ⇒ Object
- #create_jammit_assets ⇒ Object
- #create_layout ⇒ Object
- #create_sass_directory ⇒ Object
- #create_sass_extensions_and_rake_tasks ⇒ Object
- #gemfile ⇒ Object
- #remove_default_layout ⇒ Object
- #setup_application ⇒ Object
Instance Method Details
#create_compass_config ⇒ Object
45 46 47 48 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 45 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 |
#create_jammit_assets ⇒ Object
59 60 61 62 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 59 def create_jammit_assets copy_file "config/assets.yml", "#{Rails.root}/config/assets.yml" directory "public/javascripts", "#{Rails.root}/public/javascripts" end |
#create_layout ⇒ Object
64 65 66 67 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 64 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 |
#create_sass_directory ⇒ Object
55 56 57 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 55 def create_sass_directory directory "app/sass", "#{Rails.root}/app/sass" end |
#create_sass_extensions_and_rake_tasks ⇒ Object
50 51 52 53 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 50 def create_sass_extensions_and_rake_tasks copy_file "lib/sass_extensions.rb", "#{Rails.root}/lib/sass_extensions.rb" copy_file "lib/tasks/sass.rake", "#{Rails.root}/lib/tasks/sass.rake" end |
#gemfile ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 7 def gemfile # Memcached gem 'dalli' # Data storage gem 'bson_ext' gem 'mongoid' # File uplaod gem 'carrierwave' gem 'mini_magick' # File minification gem 'jammit' # Templates gem 'haml' gem 'haml-rails' # jQuery gem 'jquery-rails' # Stylesheets gem "compass" gem 'compass-susy-plugin' end |
#remove_default_layout ⇒ Object
69 70 71 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 69 def remove_default_layout remove_file "app/views/layouts/application.html.erb" end |
#setup_application ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/generators/i0n/layout/layout_generator.rb', line 34 def setup_application application do ' config.generators do |g| g.stylesheets false g.template_engine :haml end ' end end |