Class: Frame::Generators::LayoutGenerator

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

Instance Method Summary collapse

Methods inherited from Base

banner, source_root

Instance Method Details

#add_default_layoutObject



20
21
22
23
# File 'lib/generators/frame/layout/layout_generator.rb', line 20

def add_default_layout
  template('app/views/layouts/defaults.html.erb')
  template('app/views/layouts/default_layout.html.erb')
end

#add_imagesObject



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

def add_images
  template('app/assets/images/econ_f_64.gif')
  template('app/assets/images/favicon.ico')
end

#add_page_helpersObject



25
26
27
# File 'lib/generators/frame/layout/layout_generator.rb', line 25

def add_page_helpers
  template('app/helpers/application_helper.rb')
end

#copy_cssObject



39
40
41
42
# File 'lib/generators/frame/layout/layout_generator.rb', line 39

def copy_css
  template('app/assets/stylesheets/frame.css')
  add_if_missing('app/assets/stylesheets/application.css', " *= require frame\n", :after => " *= require_self\n")
end

#remove_indexObject



13
14
15
16
17
18
# File 'lib/generators/frame/layout/layout_generator.rb', line 13

def remove_index
  filename="public/index.html"
  #if File.exists?(filename) and yes?("Would you like to remove '#{filename}'?")
    remove_file filename
  #end
end

#replace_html_appObject



34
35
36
37
# File 'lib/generators/frame/layout/layout_generator.rb', line 34

def replace_html_app
  @title = Rails.application.class.parent_name
  template('app/views/layouts/application.html.erb')
end