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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ee9ff727d34b2454f900ea9f0b41e3b37801f0351da7b67e1def1925dd2e4e8
4
- data.tar.gz: 7c9b15d856eab2589bfae31bddb1adf153b013038ff4cc13c4e407533da6b5f2
3
+ metadata.gz: 6d4068cf73e42feb7446c80e133d59bffa5b1f0c4470026622822f7552dabda2
4
+ data.tar.gz: fe9517317d00fe427bf5b4b0b85a079291541647d02395910b387a9e9220ae95
5
5
  SHA512:
6
- metadata.gz: 1e93e9bb129a5960c85e958e8a4dcc7e1639e83269c6618eeffadd057aae6227d7e939707c51540893a2760002f152a3311e16d5022bc63893ab3b6d991e58eb
7
- data.tar.gz: 8db25730358dbe19ecd5591780dd9e1c3d2a07193f31f300346673eea59b0986243d5735bca22c89f98e28ce0220336e2e190ed6a23e8176676a383e8c3ce3e0
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
- COVERAGE=BriefSummary,Coveralls rspec
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
 
@@ -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
- if klass = Covered.const_get(name)
122
+ begin
123
+ klass = Covered.const_get(name)
99
124
  @reports << klass.new
100
- else
101
- warn "Could not find #{name} call Ignoring."
125
+ rescue NameError
126
+ @reports << Autoload.new(name)
102
127
  end
103
128
  end
104
129
  else
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Covered
22
- VERSION = "0.10.0"
22
+ VERSION = "0.10.1"
23
23
  end
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.0
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.1
174
+ rubygems_version: 3.0.2
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: A modern approach to code coverage.