class Covered::Include

Attributes

pattern[R]

Public Class Methods

new(output, pattern, base = "") click to toggle source
Calls superclass method
# File lib/covered/files.rb, line 54
def initialize(output, pattern, base = "")
        super(output)
        
        @pattern = pattern
        @base = base
end

Public Instance Methods

each() { |coverage| ... } click to toggle source
Calls superclass method
# File lib/covered/files.rb, line 77
def each(&block)
        paths = glob
        
        super do |coverage|
                paths.delete(coverage.path)
                
                yield coverage
        end
        
        paths.each do |path|
                yield Coverage.new(path)
        end
end
glob() click to toggle source
# File lib/covered/files.rb, line 63
def glob
        paths = Set.new
        root = self.expand_path(@base)
        pattern = File.expand_path(@pattern, root)
        
        Dir.glob(pattern) do |path|
                unless File.directory?(path)
                        paths << File.realpath(path)
                end
        end
        
        return paths
end