vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/shell/basic.rb
# Deals with file collision and returns true if the file should be
# overwriten and false otherwise. If a block is given, it uses the block
# response as the content for the diff.
#
# ==== Parameters
# destination<String>:: the destination file to solve conflicts
# block<Proc>:: an optional block that returns the value to be used in diff
#
Deals with file collision and returns true if the file should be
overwriten and false otherwise. If a block is given, it uses the block
response as the content for the diff.

Parameters
destination:: the destination file to solve conflicts
block:: an optional block that returns the value to be used in diff
Deals with file collision and returns true if the file should be overwriten and false otherwise . If a block is given it uses the block response as the content for the diff . Parameters destination :: the destination file to solve conflicts block :: an optional block that returns the value to be used in diff
def file_collision(destination)
        return true if @always_force
        options = block_given? ? "[Ynaqdh]" : "[Ynaqh]"
        while true
          answer = ask %[Overwrite #{destination}? (enter "h" for help) #{options}]
          case answer
            when is?(:yes), is?(:force), ""
              return true
            when is?(:no), is?(:skip)
              return false
            when is?(:always)
              return @always_force = true
            when is?(:quit)
              say 'Aborting...'
              raise SystemExit
            when is?(:diff)
              show_diff(destination, yield) if block_given?
              say 'Retrying...'
            else
              say file_collision_help
          end
        end
      end
def file_collision ( destination ) return true if @always_force options = block_given? ? "[Ynaqdh]" : "[Ynaqh]" while true answer = ask %[Overwrite #{destination}? (enter "h" for help) #{options}] case answer when is? ( :yes ) , is? ( :force ) , "" return true when is? ( :no ) , is? ( :skip ) return false when is? ( :always ) return @always_force = true when is? ( :quit ) say 'Aborting...' raise SystemExit when is? ( :diff ) show_diff ( destination , yield ) if block_given? say 'Retrying...' else say file_collision_help end end end
Deals with file collision and returns true if the file should be
overwriten and false otherwise.
Deals with file collision and returns true if the file should be overwriten and false otherwise .
destination
<not_specific>