simplecov-murmur 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +54 -0
- data/Rakefile +10 -0
- data/lib/simplecov-murmur/version.rb +7 -0
- data/lib/simplecov-murmur.rb +55 -0
- data/simplecov-murmur.gemspec +24 -0
- data/test/test_helper.rb +6 -0
- data/test/test_simplecov-murmur.rb +11 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 887323ba539e9bafc29d4c6189048dc9988d668f
|
4
|
+
data.tar.gz: 69c53076e572995dca6f634c4a8886b519a5419a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4e5e980aaae88bdf1bea7e96ba84764c7228f3c2c7ef943d4c5f18c0875abc6225c7a80a6573036ae1b5a4bf3a97b6597180aa693b127108272f4e9c0d2b4b57
|
7
|
+
data.tar.gz: 557d6dbf0645d35e39886e1e20507247089094b3fb07e352a4de68960e7718aecd98fff7170bf9e24c49535d07c667ecc278923b99ebe7f19ec64be40655b342
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 daisuko
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# simplecov-murmur
|
2
|
+
|
3
|
+
Console formatter for SimpleCov
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
`Gemfile`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'simplecov-murmur', require: false, group: 'test'
|
11
|
+
```
|
12
|
+
|
13
|
+
`test/test_helper.rb` or `test/spec_helper.rb`:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'simplecov-murmur'
|
17
|
+
|
18
|
+
SimpleCov.formatter = SimpleCov::Formatter::MurMurFormatter
|
19
|
+
# or
|
20
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
21
|
+
SimpleCov::Formatter::MurMurFormatter,
|
22
|
+
SimpleCov::Formatter::HTMLFormatter
|
23
|
+
]
|
24
|
+
```
|
25
|
+
|
26
|
+
## Example
|
27
|
+
```
|
28
|
+
All Files:
|
29
|
+
[ 23.53%] lib/tempfile.rb
|
30
|
+
[ 30.00%] concern.rb
|
31
|
+
[ 36.36%] lib/schedule.rb
|
32
|
+
[ 47.88%] app.rb
|
33
|
+
[ 58.82%] user.rb
|
34
|
+
[ 80.00%] access_point.rb
|
35
|
+
[ 83.33%] lib/report.rb
|
36
|
+
[ 86.67%] helpers.rb
|
37
|
+
[100.00%] config/boot.rb
|
38
|
+
[100.00%] lib/date.rb
|
39
|
+
```
|
40
|
+
|
41
|
+
## Mode
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
SimpleCov::Formatter::MurMurFormatter.mode = :all
|
45
|
+
```
|
46
|
+
|
47
|
+
| mode | target |
|
48
|
+
|:--------|:------------------------|
|
49
|
+
| :all | all files |
|
50
|
+
| :short | without 100% (default) |
|
51
|
+
|
52
|
+
## License
|
53
|
+
simplecov-murmur is released under the [MIT License](LICENSE.txt).
|
54
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require "pathname"
|
2
|
+
require "colorize"
|
3
|
+
|
4
|
+
class SimpleCov::Formatter::MurMurFormatter
|
5
|
+
def self.mode=(val)
|
6
|
+
@@mode = val
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.mode
|
10
|
+
@@mode ||= :short
|
11
|
+
end
|
12
|
+
|
13
|
+
def short?
|
14
|
+
self.class.mode == :short
|
15
|
+
end
|
16
|
+
|
17
|
+
def format(result)
|
18
|
+
root = Pathname.new(SimpleCov.root || Dir.pwd)
|
19
|
+
report = if result.groups.empty?
|
20
|
+
message_per_group "All Files", result.files, root
|
21
|
+
else
|
22
|
+
result.groups.map do |name, files|
|
23
|
+
message_per_group name, files, root
|
24
|
+
end.join("\n")
|
25
|
+
end
|
26
|
+
report << "\n"
|
27
|
+
|
28
|
+
puts report
|
29
|
+
|
30
|
+
report
|
31
|
+
end
|
32
|
+
|
33
|
+
def message_per_group(name, files, root)
|
34
|
+
message = files.sort {|a, b| a.covered_percent <=> b.covered_percent}
|
35
|
+
.map {|file| message_per_file file, root}.compact.join("\n")
|
36
|
+
|
37
|
+
[name.colorize(:blue) + ":", message].join("\n")
|
38
|
+
end
|
39
|
+
|
40
|
+
def message_per_file(file, root)
|
41
|
+
percent = file.covered_percent
|
42
|
+
file_name = Pathname.new(file.filename).relative_path_from(root).to_s
|
43
|
+
|
44
|
+
short? && percent == 100 ? nil : " [#{colorize(percent)}] #{file_name}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def colorize(val)
|
48
|
+
("%6.2f%" % val.round(2)).colorize(case val.to_i
|
49
|
+
when 0..79 then :red
|
50
|
+
when 80..89 then :yellow
|
51
|
+
else :green
|
52
|
+
end)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'simplecov-murmur/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "simplecov-murmur"
|
8
|
+
gem.version = SimpleCov::Formatter::MurMurFormatter::VERSION
|
9
|
+
gem.authors = ["daisuko"]
|
10
|
+
gem.email = ["striker.daisuko@gmail.com"]
|
11
|
+
gem.description = %q{Console formatter for SimpleCov}
|
12
|
+
gem.summary = %q{Console formatter for SimpleCov}
|
13
|
+
gem.homepage = "https://github.com/daisuko/simplecov-murmur"
|
14
|
+
|
15
|
+
gem.add_dependency 'colorize'
|
16
|
+
|
17
|
+
gem.add_development_dependency 'rake'
|
18
|
+
gem.add_development_dependency 'minitest'
|
19
|
+
|
20
|
+
gem.files = `git ls-files`.split($/)
|
21
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
22
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
23
|
+
gem.require_paths = ["lib"]
|
24
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simplecov-murmur
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- daisuko
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Console formatter for SimpleCov
|
56
|
+
email:
|
57
|
+
- striker.daisuko@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/simplecov-murmur.rb
|
68
|
+
- lib/simplecov-murmur/version.rb
|
69
|
+
- simplecov-murmur.gemspec
|
70
|
+
- test/test_helper.rb
|
71
|
+
- test/test_simplecov-murmur.rb
|
72
|
+
homepage: https://github.com/daisuko/simplecov-murmur
|
73
|
+
licenses: []
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.2.2
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Console formatter for SimpleCov
|
95
|
+
test_files:
|
96
|
+
- test/test_helper.rb
|
97
|
+
- test/test_simplecov-murmur.rb
|