Class: Solidus::Views::OverrideGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/solidus/views/override_generator.rb

Constant Summary collapse

VIEWS =
Dir.glob(views_folder.join('**', '*'))

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.views_folderObject



9
10
11
# File 'lib/generators/solidus/views/override_generator.rb', line 9

def self.views_folder
  Spree::Frontend::Engine.root.join('app', 'views', 'spree')
end

Instance Method Details

#copy_viewsObject



24
25
26
27
28
29
30
31
# File 'lib/generators/solidus/views/override_generator.rb', line 24

def copy_views
  views_to_copy.each do |file|
    next if File.directory?(file)

    dest_file = Pathname.new(file).relative_path_from(source_dir)
    copy_file file, Rails.root.join('app', 'views', 'spree', dest_file)
  end
end