Class: NewSiteFilesGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/new_site_files/new_site_files_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_filesObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/new_site_files/new_site_files_generator.rb', line 8

def copy_files
  # copy_file will do a straight copy
  copy_file "Gemfile", "Gemfile" if options.gemfile?
  copy_file "app_helper.rb", "app/helpers/application_helper.rb"
  copy_file "yui-grid-body.css", "public/stylesheets/application.css"

  # template will allow us to execute erb in the template
  template "haml-application.erb", "app/views/layouts/application.haml"
  template "application.rb", "config/application.rb" if options.app_config?
  template "routes.rb", "config/routes.rb" if options.routes?
end