Class: Pageflow::Generators::ThemeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow/theme/theme_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_templateObject


11
12
13
14
15
16
17
18
19
# File 'lib/generators/pageflow/theme/theme_generator.rb', line 11

def copy_template
  directory('stylesheets/pageflow/themes/default', themes_path('stylesheets', name))
  directory('images/pageflow/themes/default', themes_path('images', name))

  template('stylesheets/pageflow/themes/default.css.scss', themes_path('stylesheets', "#{name}.css.scss")) do |content|
    content.gsub!('$theme-name: "default";', %Q'$theme-name: "#{name}";')
    content.gsub!('@import "./default/', %Q'@import "./#{name}/')
  end
end