covered 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/lib/covered/policy.rb +30 -5
- data/lib/covered/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4068cf73e42feb7446c80e133d59bffa5b1f0c4470026622822f7552dabda2
|
4
|
+
data.tar.gz: fe9517317d00fe427bf5b4b0b85a079291541647d02395910b387a9e9220ae95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0038497474c96ede779378af2a0ca669f979ddfbc209a42762ac3199e6ce214de185673ebace77d7adc5fb270815803162412ab69b96b5a4c9ddd5f175a3e6a7'
|
7
|
+
data.tar.gz: 299c83743a10e8ed36eca554fe5052cd03bd572caa06142011769a11ba0a8135f09609ae305cbddf3f6c4e7787e373d602a4c4584fb2d7752d7c1ab9926e7b31
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Covered [![Build Status](https://travis-ci.com/ioquatix/covered.svg)](https://travis-ci.com/ioquatix/covered)
|
1
|
+
# Covered [![Build Status](https://travis-ci.com/ioquatix/covered.svg)](https://travis-ci.com/ioquatix/covered) [![Coverage Status](https://coveralls.io/repos/github/ioquatix/covered/badge.svg)](https://coveralls.io/github/ioquatix/covered)
|
2
2
|
|
3
3
|
Covered uses modern Ruby features to generate comprehensive coverage, including support for templates which are compiled into Ruby.
|
4
4
|
|
@@ -79,15 +79,21 @@ This report lists several files in order of least coverage.l
|
|
79
79
|
|
80
80
|
### Coveralls/Travis Integration
|
81
81
|
|
82
|
-
You can send coverage information to [Coveralls](https://coveralls.io).
|
82
|
+
You can send coverage information to [Coveralls](https://coveralls.io) by editing your `.travis.yml` file:
|
83
83
|
|
84
84
|
```
|
85
|
-
|
85
|
+
matrix:
|
86
|
+
include:
|
87
|
+
- rvm: 2.6
|
88
|
+
env: COVERAGE=PartialSummary,Coveralls
|
86
89
|
```
|
87
90
|
|
88
91
|
This will print out a brief report and then upload the coverage data. This integrates transparently with Travis.
|
89
92
|
|
90
|
-
|
93
|
+
## See Also
|
94
|
+
|
95
|
+
- [coveralls-ruby](https://github.com/lemurheavy/coveralls-ruby) – the official Coveralls implementation for Ruby.
|
96
|
+
- [simplecov](https://github.com/colszowka/simplecov) – one of the original coverage implementations for Ruby, uses the built-in `coverage` library.
|
91
97
|
|
92
98
|
## Contributing
|
93
99
|
|
data/lib/covered/policy.rb
CHANGED
@@ -23,8 +23,6 @@ require_relative "files"
|
|
23
23
|
require_relative "source"
|
24
24
|
require_relative "capture"
|
25
25
|
|
26
|
-
require_relative 'coveralls'
|
27
|
-
|
28
26
|
module Covered
|
29
27
|
def self.policy(&block)
|
30
28
|
policy = Policy.new
|
@@ -90,15 +88,42 @@ module Covered
|
|
90
88
|
|
91
89
|
attr :reports
|
92
90
|
|
91
|
+
class Autoload
|
92
|
+
def initialize(name)
|
93
|
+
@name = name
|
94
|
+
end
|
95
|
+
|
96
|
+
def call(*args)
|
97
|
+
begin
|
98
|
+
klass = Covered.const_get(@name)
|
99
|
+
rescue NameError
|
100
|
+
require_relative @name.downcase
|
101
|
+
end
|
102
|
+
|
103
|
+
begin
|
104
|
+
klass = Covered.const_get(@name)
|
105
|
+
|
106
|
+
return klass.new.call(*args)
|
107
|
+
rescue NameError
|
108
|
+
warn "Could not find #{name} call Ignoring."
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def to_s
|
113
|
+
"\#<#{self.class} loading #{@name}>"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
93
117
|
def reports!(coverage = ENV['COVERAGE'])
|
94
118
|
if coverage
|
95
119
|
names = coverage.split(',')
|
96
120
|
|
97
121
|
names.each do |name|
|
98
|
-
|
122
|
+
begin
|
123
|
+
klass = Covered.const_get(name)
|
99
124
|
@reports << klass.new
|
100
|
-
|
101
|
-
|
125
|
+
rescue NameError
|
126
|
+
@reports << Autoload.new(name)
|
102
127
|
end
|
103
128
|
end
|
104
129
|
else
|
data/lib/covered/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: covered
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.0.
|
174
|
+
rubygems_version: 3.0.2
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: A modern approach to code coverage.
|