lib/guard/asset-copy.rb
# Called on file(s) modifications that the Guard watches.
# @param [Array<String>] paths the changes files or paths
# @raise [:task_has_failed] when run_on_change has failed
Called on file(s) modifications that the Guard watches.
Called on file ( s ) modifications that the Guard watches .
def run_on_change(paths)
      paths.each do |file|
        output_file = get_output(file)
        FileUtils.mkdir_p File.dirname(output_file)
        FileUtils.cp(file, output_file)
        ::Guard::UI.info "# copied '#{file}' to '#{output_file}'"
        ::Guard::Notifier.notify("# copied #{file}", :title => "Guard::Copy", :image => :success) if @options[:notifications]
      end
      notify paths
    end
def run_on_change ( paths ) paths . each do | file | output_file = get_output ( file ) FileUtils . mkdir_p File . dirname ( output_file ) FileUtils . cp ( file , output_file ) :: Guard :: UI . info "# copied '#{file}' to '#{output_file}'" :: Guard :: Notifier . notify ( "# copied #{file}" , :title => "Guard::Copy" , :image => :success ) if @options [ :notifications ] end notify paths end
Called on file(s) modifications that the Guard watches.
Called on file ( s ) modifications that the Guard watches .
[:task_has_failed] when run_on_change has failed
[ : task_has_failed ] when run_on_change has failed
paths
<not_specific>
<not_specific>
paths the changes files or paths
paths the changes files or paths