返回顶部

收藏

Finds files that were probably left behind by emacs sessions.

更多
require 'find'
module Find
  def match(*paths)
    matched = []
    find(*paths) { |path| matched << path if yield path }
    return matched
  end
  module_function :match
end

def emacs_droppings(*paths)
  Find.match(*paths) do |p|
    (p[-1] == ?~ and p[0] != ?~) or (p[0] == ?# and p[-1] == ?#)
  end
end

标签:Ruby,文件

收藏

0人收藏

支持

0

反对

0

发表评论