Sha256: caed55fffa1bccb7a59412da79e8817a23afaee943fa97a5e296c4ac27ca5b62

Contents?: true

Size: 505 Bytes

Versions: 14

Compression:

Stored size: 505 Bytes

Contents

module DeepCover
  module Analyser::IgnoreUncovered
    def initialize(source, ignore_uncovered: [], **options)
      super
      @allow_filters = Array(ignore_uncovered)
        .map{|kind| :"is_#{kind}?"}
        .select{|name| respond_to?(name) }
        .map{|name| method(name)}   # So was tempted to write `.map(&method(:method))`!
    end

    def node_runs(node)
      runs = super
      if runs == 0 && @allow_filters.any?{ |f| f[node] }
        runs = nil
      end
      runs
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
deep-cover-0.1.14 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.13 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.12 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.11 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.10 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.9 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.8 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.7 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.6 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.5 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.4 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.3 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.2 lib/deep_cover/analyser/ignore_uncovered.rb
deep-cover-0.1.1 lib/deep_cover/analyser/ignore_uncovered.rb