Sha256: 28d63c2e33da138f267a0b5b8c074de16b74a2784cc15eb2ec1b34fb670dc8e4
Contents?: true
Size: 965 Bytes
Versions: 12
Compression:
Stored size: 965 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!('$theme-name: "default";', %Q'$theme-name: "#{name}";') content.gsub!('@import "./default/', %Q'@import "./#{name}/') end end private def themes_path(type, path) File.join('app', 'assets', type, 'pageflow', 'themes', path) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems