Class: AppThemer::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- AppThemer::LayoutGenerator
- Defined in:
- lib/generators/app_themer/layout/layout_generator.rb
Instance Method Summary collapse
- #copy_base_stylesheets ⇒ Object
- #copy_images ⇒ Object
- #copy_javascripts ⇒ Object
- #copy_layout ⇒ Object
- #copy_theme_stylesheets ⇒ Object
Instance Method Details
#copy_base_stylesheets ⇒ Object
24 25 26 27 28 |
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 24 def copy_base_stylesheets copy_file "#{stylesheets_path}/base.css", "public/stylesheets/app-themer/base.css" copy_file "#{stylesheets_path}/handheld.css", "public/stylesheets/app-themer/handheld.css" copy_file "#{stylesheets_path}/override.css", "public/stylesheets/app-themer/override.css" end |
#copy_images ⇒ Object
34 35 36 |
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 34 def copy_images directory "#{images_path}", "public/images/app-themer" end |
#copy_javascripts ⇒ Object
38 39 40 41 |
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 38 def copy_javascripts copy_file "#{javascripts_path}/dd_belatedpng.js", "public/javascripts/app-themer/dd_belatedpng.js" copy_file "#{javascripts_path}/modernizr-1.5.min.js", "public/javascripts/app-themer/modernizr-1.5.min.js" end |
#copy_layout ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 13 def copy_layout return if .no_layout layout_template = .layout_type == 'login' ? "login.html.erb" : "admin.html.erb" case .engine when 'erb' template layout_template, "app/views/layouts/#{layout_name.underscore}.html.erb" when 'haml' generate_haml_layout(layout_template) end end |
#copy_theme_stylesheets ⇒ Object
30 31 32 |
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 30 def copy_theme_stylesheets directory "#{stylesheets_path}/themes/#{.theme}", "public/stylesheets/app-themer/themes/#{.theme}" end |