Class: Disguise::Generators::ThemeGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_themeObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/disguise/theme_generator.rb', line 8

def create_theme
  # Basic theme files        
  copy_file "views/_head.html.erb", "themes/#{file_name}/views/layouts/global/_head.html.erb"
  copy_file "views/_header.html.erb", "themes/#{file_name}/views/layouts/global/_header.html.erb"
  copy_file "views/_footer.html.erb", "themes/#{file_name}/views/layouts/global/_footer.html.erb"
  copy_file "views/default.html.erb", "themes/#{file_name}/views/layouts/default.html.erb"

  # Theme description
  copy_file "description.txt", "themes/#{file_name}/description.txt"

  # Images
  copy_file "preview.gif", "public/images/#{file_name}/preview.gif"

  # Stylesheets
  copy_file "stylesheets/styles.css", "public/stylesheets/#{file_name}.css"

  # localization
  copy_file "locales/en.yml", "themes/#{file_name}/locales/en.yml"
end

#show_readmeObject


28
29
30
# File 'lib/generators/disguise/theme_generator.rb', line 28

def show_readme
  readme "INSTALL" if behavior == :invoke
end