8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/generators/view_primitives/component_copier.rb', line 8
def self.included(base)
base.no_tasks do
define_method(:template) do |source, *args, **options, &blk|
destination = args.first || options[:to]
return unless destination.nil? || confirm_overwrite(destination)
super(source, *args, **options, &blk)
end
define_method(:copy_file) do |source, *args, **options|
destination = args.first || options[:to]
return unless destination.nil? || confirm_overwrite(destination)
super(source, *args, **options)
end
end
end
|