Sha256: b6a935c19a82bb133c773291d220be6d2f219c600bacac0f0565f6fe62f2fbb8
Contents?: true
Size: 1.44 KB
Versions: 1
Compression:
Stored size: 1.44 KB
Contents
module SpreeThemeGenerator module Generators class ViewsGenerator < Rails::Generators::Base dir = "#{Gem.loaded_specs['spree_frontend'].full_gem_path}/app/views/spree" source_root File.expand_path(dir, __FILE__) class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (address, checkout, content, home, layouts, order, payments, products, shared, store, taxons)" argument :scope, required: false, default: nil, desc: "The scope to copy views to" def copy_views if options[:views] options[:views].each do |directory| view_directory directory.to_sym end else view_directory :address view_directory :checkout view_directory :home view_directory :layouts view_directory :orders view_directory :payments view_directory :products view_directory :shared view_directory :store view_directory :taxons end end protected def view_directory(name, _target_path = nil) directory name.to_s, _target_path || "#{target_path}/#{name}" do |content| if scope content.gsub "devise/shared/links", "#{scope}/shared/links" else content end end end def target_path @target_path ||= "app/views/spree" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_theme_generator-1.0.0 | lib/generators/spree_theme_generator/views/views_generator.rb |