Sha256: 9b308670c6b1224b482bbace1d39955ded48310226e43f18f2d031ede0697e31

Contents?: true

Size: 1.8 KB

Versions: 13

Compression:

Stored size: 1.8 KB

Contents

def wagn_simplecov_filters
  add_filter 'spec/'
  add_filter '/config/'
  add_filter '/tasks/'
	
	# filter all wagn mods
  add_filter do |src_file|
    src_file.filename =~ /tmp\// and not
    /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
  end
	
	# add group for each deck mod
  Dir['mod/*'].map{ |path| path.sub('mod/','') }.each do |mod|
    add_group mod.capitalize do |src_file|
      src_file.filename =~ /mod\/#{mod}\// or 
        (
          src_file.filename =~ /tmp\// and
          /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/#{mod}/**/#{m[1]}"].present? } 
        )
    end
  end

  add_group 'Sets' do |src_file|
    src_file.filename =~ /tmp\/set\// and
    /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
  end
  add_group 'Set patterns' do |src_file|
    src_file.filename =~ /tmp\/set_pattern\// and
    /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
  end
  add_group 'Formats' do |src_file|
    src_file.filename =~ /mod\/[^\/]+\/formats/
  end
  add_group 'Chunks' do |src_file|
    src_file.filename =~ /mod\/[^\/]+\/chunks/
  end
end

def wagn_core_dev_simplecov_filters
  filters.clear # This will remove the :root_filter that comes via simplecov's defaults
  add_filter do |src|
    !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /wagn/
  end    
  
  add_filter '/spec/'
  add_filter '/features/'
  add_filter '/config/'
  add_filter '/tasks/'
  add_filter '/generators/'
  add_filter 'lib/wagn'

  add_group 'Card', 'lib/card'  
  add_group 'Set Patterns', 'tmp/set_pattern/'
  add_group 'Sets',         'tmp/set/'
  add_group 'Formats' do |src_file|
    src_file.filename =~ /mod\/[^\/]+\/format/
  end
  add_group 'Chunks' do |src_file|
    src_file.filename =~ /mod\/[^\/]+\/chunk/
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wagn-1.14.9 lib/wagn/simplecov_helper.rb
wagn-1.14.8 lib/wagn/simplecov_helper.rb
wagn-1.14.7 lib/wagn/simplecov_helper.rb
wagn-1.14.6 lib/wagn/simplecov_helper.rb
wagn-1.14.5 lib/wagn/simplecov_helper.rb
wagn-1.14.4 lib/wagn/simplecov_helper.rb
wagn-1.14.3 lib/wagn/simplecov_helper.rb
wagn-1.14.2 lib/wagn/simplecov_helper.rb
wagn-1.14.1 lib/wagn/simplecov_helper.rb
wagn-1.14.0 lib/wagn/simplecov_helper.rb
wagn-1.14.0.pre3 lib/wagn/simplecov_helper.rb
wagn-1.14.0.pre2 lib/wagn/simplecov_helper.rb
wagn-1.14.0.pre1 lib/wagn/simplecov_helper.rb