Sha256: bce8385b623f723f3c54035ea689091860c3b53f20860bdd0055dfb7ef1a7ebb
Contents?: true
Size: 1017 Bytes
Versions: 4
Compression:
Stored size: 1017 Bytes
Contents
module Pageflow module Generators class ThemeGenerator < Rails::Generators::Base desc 'Copies a theme template to the app.' argument :name, required: false, default: 'custom', desc: 'The scope to copy views to' source_root File.expand_path("../../../../../app/assets", __FILE__) 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!('@import "./default/', %Q'@import "./#{name}/') end gsub_file themes_path('stylesheets', "#{name}/variables.css.scss"), '$theme-name: "default";', %Q'$theme-name: "#{name}";' end private def themes_path(type, path) File.join('app', 'assets', type, 'pageflow', 'themes', path) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems