lib/covered/files.rb in covered-0.10.1 vs lib/covered/files.rb in covered-0.10.2
- old
+ new
@@ -34,14 +34,14 @@
def empty?
@paths.empty?
end
- def mark(path, *args)
+ def mark(path, lineno, value)
coverage = (@paths[path] ||= Coverage.new(path))
- coverage.mark(*args)
+ coverage.mark(lineno, value)
return coverage
end
def each(&block)
@@ -91,11 +91,11 @@
class Filter < Wrapper
def accept?(path)
true
end
- def mark(path, *args)
+ def mark(path, lineno, value)
super if accept?(path)
end
def each(&block)
super do |coverage|
@@ -107,25 +107,20 @@
end
end
end
class Skip < Filter
- def initialize(output, pattern, base = "")
+ def initialize(output, pattern)
super(output)
@pattern = pattern
- @base = self.expand_path(base)
end
attr :pattern
def accept? path
- if @base
- path = relative_path(path)
- end
-
- !(@pattern === path)
+ !@pattern.match?(path)
end
end
class Only < Filter
def initialize(output, pattern)
@@ -154,10 +149,10 @@
File.expand_path(super, @path)
end
def relative_path(path)
if path.start_with?(@path)
- path[@path.size+1..-1]
+ path.slice(@path.size+1, path.size)
else
super
end
end