class CleanupVendor::Path

Public Instance Methods

gem_level?() click to toggle source
# File lib/cleanup_vendor/path.rb, line 23
def gem_level?
  @gem_level ||= parent.glob('*.gemspec').any?
end
include?(enum) click to toggle source
# File lib/cleanup_vendor/path.rb, line 27
def include?(enum)
  descend.any? { |p| enum.include?(p) }
end
match?(patterns) click to toggle source
# File lib/cleanup_vendor/path.rb, line 15
def match?(patterns)
  patterns.any? do |p|
    p.eql?(self) ||
      p.start_with?('**') && fnmatch?(p, File::FNM_EXTGLOB) ||
      basename.fnmatch?(p, File::FNM_EXTGLOB) && gem_level?
  end
end
recursive_entries() { |path| ... } click to toggle source
# File lib/cleanup_vendor/path.rb, line 7
def recursive_entries
  return to_enum(:recursive_entries) unless block_given?

  glob('**/*', File::FNM_DOTMATCH) do |path|
    yield(Path.new(path)) unless path == self
  end
end
summary() click to toggle source
# File lib/cleanup_vendor/path.rb, line 31
def summary
  entries = [self] + recursive_entries.to_a
  entries.map(&:stat)
end