ruby-win32/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
def remove_executables(gemspec)
    return if gemspec.nil?
    if(gemspec.executables.size > 0)
      raise Gem::FilePermissionError.new(Gem.bindir) unless
        File.writable?(Gem.bindir)
      list = Gem.source_index.search(gemspec.name).delete_if { |spec|
        spec.version == gemspec.version
      }
      executables = gemspec.executables.clone
      list.each do |spec|
        spec.executables.each do |exe_name|
          executables.delete(exe_name)
        end
      end
      return if executables.size == 0
      answer = @force_executables || ask_yes_no(
        "Remove executables and scripts for\n" +
        "'#{gemspec.executables.join(", ")}' in addition to the gem?",
        true) # " # appease ruby-mode - don't ask
      unless answer
        say "Executables and scripts will remain installed."
        return
      else
        gemspec.executables.each do |exe_name|
          say "Removing #{exe_name}"
          File.unlink File.join(Gem.bindir, exe_name) rescue nil
          File.unlink File.join(Gem.bindir, exe_name + ".bat") rescue nil
        end
      end
    end
  end
##
# Remove executables and batch files (windows only) for the gem as
# it is being installed
#
# gemspec::[Specification] the gem whose executables need to be removed.
#
Remove executables and batch files (windows only) for the gem as
it is being installed

:[Specification] the gem whose executables need to be removed.
Remove executables and batch files ( windows only ) for the gem as it is being installed : [ Specification ] the gem whose executables need to be removed .
def remove_executables(gemspec)
    return if gemspec.nil?
    if(gemspec.executables.size > 0)
      raise Gem::FilePermissionError.new(Gem.bindir) unless
        File.writable?(Gem.bindir)
      list = Gem.source_index.search(gemspec.name).delete_if { |spec|
        spec.version == gemspec.version
      }
      executables = gemspec.executables.clone
      list.each do |spec|
        spec.executables.each do |exe_name|
          executables.delete(exe_name)
        end
      end
      return if executables.size == 0
      answer = @force_executables || ask_yes_no(
        "Remove executables and scripts for\n" +
        "'#{gemspec.executables.join(", ")}' in addition to the gem?",
        true) 
      unless answer
        say "Executables and scripts will remain installed."
        return
      else
        gemspec.executables.each do |exe_name|
          say "Removing #{exe_name}"
          File.unlink File.join(Gem.bindir, exe_name) rescue nil
          File.unlink File.join(Gem.bindir, exe_name + ".bat") rescue nil
        end
      end
    end
  end
def remove_executables ( gemspec ) return if gemspec . nil? if ( gemspec . executables . size > 0 ) raise Gem :: FilePermissionError . new ( Gem . bindir ) unless File . writable? ( Gem . bindir ) list = Gem . source_index . search ( gemspec . name ) . delete_if { | spec | spec . version == gemspec . version } executables = gemspec . executables . clone list . each do | spec | spec . executables . each do | exe_name | executables . delete ( exe_name ) end end return if executables . size == 0 answer = @force_executables || ask_yes_no ( "Remove executables and scripts for\n" + "'#{gemspec.executables.join(", ")}' in addition to the gem?" , true ) unless answer say "Executables and scripts will remain installed." return else gemspec . executables . each do | exe_name | say "Removing #{exe_name}" File . unlink File . join ( Gem . bindir , exe_name ) rescue nil File . unlink File . join ( Gem . bindir , exe_name + ".bat" ) rescue nil end end end end
Remove executables and batch files (windows only) for the gem as
it is being installed
Remove executables and batch files ( windows only ) for the gem as it is being installed
# " # appease ruby-mode - don't ask
gemspec