Class: AppThemer::LayoutGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/app_themer/layout/layout_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_base_stylesheetsObject



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_imagesObject



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_javascriptsObject



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_layoutObject



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 options.no_layout
  layout_template = options.layout_type == 'login' ? "login.html.erb" : "admin.html.erb"
  case options.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_stylesheetsObject



30
31
32
# File 'lib/generators/app_themer/layout/layout_generator.rb', line 30

def copy_theme_stylesheets
  directory "#{stylesheets_path}/themes/#{options.theme}", "public/stylesheets/app-themer/themes/#{options.theme}"
end