color_pound_spec_reporter 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +59 -0
- data/Rakefile +15 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/color_pound_spec_reporter.gemspec +23 -0
- data/example/color-output.png +0 -0
- data/lib/color_pound_spec_reporter.rb +58 -0
- data/lib/color_pound_spec_reporter/version.rb +4 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 228dbc02c86fedde8adc8f7c778e75e7060dfc72
|
4
|
+
data.tar.gz: 1ab35a099dea9466ce1fdec1195689c660c43571
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c1bfc869e244f40520a69541c8d8b8d1d6ff3171b493c1c4e9de4a607881f90559d53f7caeccbc16a3dbbdf486599370cfe8035d1cdbdea76902dc4bf1c409e8
|
7
|
+
data.tar.gz: f739cc191dd9db6d2cbf6b2ac3c1a8692863e88a9ef9ab2aa29cc8365a426c0baa107a8ae2cde7f4a0d63c767f38aa05e1c55ec77993829ff5e5f4cc9558833d
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Daniel P. Clark
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# ColorPoundSpecReporter
|
2
|
+
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
Add this line to your application's Gemfile:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'color_pound_spec_reporter'
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install color_pound_spec_reporter
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Add the following lines to your test helper file.
|
23
|
+
```ruby
|
24
|
+
require 'color_pound_spec_reporter'
|
25
|
+
|
26
|
+
Minitest::Reporters.use! [ColorPoundSpecReporter.new]
|
27
|
+
```
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
1. Fork it ( https://github.com/[my-github-username]/color_pound_spec_reporter/fork )
|
32
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
+
5. Create a new Pull Request
|
36
|
+
|
37
|
+
##License
|
38
|
+
|
39
|
+
The MIT License (MIT)
|
40
|
+
|
41
|
+
Copyright (c) 2015 Daniel P. Clark
|
42
|
+
|
43
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
44
|
+
of this software and associated documentation files (the "Software"), to deal
|
45
|
+
in the Software without restriction, including without limitation the rights
|
46
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
47
|
+
copies of the Software, and to permit persons to whom the Software is
|
48
|
+
furnished to do so, subject to the following conditions:
|
49
|
+
|
50
|
+
The above copyright notice and this permission notice shall be included in
|
51
|
+
all copies or substantial portions of the Software.
|
52
|
+
|
53
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
54
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
55
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
56
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
57
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
58
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
59
|
+
THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
|
7
|
+
Rake::TestTask.new(:test) do |t|
|
8
|
+
t.libs << 'lib'
|
9
|
+
t.libs << 'test'
|
10
|
+
t.pattern = 'test/**/*_test.rb'
|
11
|
+
t.verbose = false
|
12
|
+
end
|
13
|
+
|
14
|
+
task default: :test
|
15
|
+
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "color_pound_spec_reporter"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'color_pound_spec_reporter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "color_pound_spec_reporter"
|
8
|
+
spec.version = ColorPoundSpecReporter::VERSION
|
9
|
+
spec.authors = ["Daniel P. Clark"]
|
10
|
+
spec.email = ["6ftdan@gmail.com"]
|
11
|
+
spec.summary = %q{Modifies your SpecReporter for easy to follow colored output.}
|
12
|
+
spec.description = %q{SpecReporter with easy to follow colors.}
|
13
|
+
spec.homepage = "https://github.com/danielpclark/color_pound_spec_reporter"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
|
19
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
20
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
21
|
+
spec.add_development_dependency "minitest"
|
22
|
+
spec.add_development_dependency "minitest-reporters", ">= 0.14.24"
|
23
|
+
end
|
Binary file
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'color_pound_spec_reporter/version'
|
2
|
+
require 'minitest/reporters'
|
3
|
+
|
4
|
+
class ColorPoundSpecReporter < Minitest::Reporters::SpecReporter
|
5
|
+
# minitest-reporters methods for version 0.14.24
|
6
|
+
def pass(suite, test, test_runner)
|
7
|
+
common_print(suite, test, :green, 'PASS')
|
8
|
+
end
|
9
|
+
|
10
|
+
def skip(suite, test, test_runner)
|
11
|
+
common_print(suite, test, :yellow, 'SKIP')
|
12
|
+
end
|
13
|
+
|
14
|
+
def failure(suite, test, test_runner)
|
15
|
+
common_print(suite, test, :red, 'FAIL')
|
16
|
+
print_exception(test_runner.exception)
|
17
|
+
end
|
18
|
+
|
19
|
+
def error(suite, test, test_runner)
|
20
|
+
common_print(suite, test, :red, 'ERROR')
|
21
|
+
print_exception(test_runner.exception)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Just in case we load a more recent minitest-reporters v1
|
25
|
+
def record(test)
|
26
|
+
Minitest::Reporters::BaseReporter.instance_method(:record).bind(self).call(test)
|
27
|
+
print pad_test(test.name) if test.failure
|
28
|
+
print_colored_status(test)
|
29
|
+
print(" (%.2fs)" % test.time)
|
30
|
+
print " :: #{color_pound test.name}" unless test.failure
|
31
|
+
puts
|
32
|
+
print_exception(test.failure) if !test.skipped? && test.failure
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def common_print(suite, test, color, message)
|
37
|
+
print_suite(suite) unless @suites.include?(suite)
|
38
|
+
print pad_test(test) if color.eql?(:red)
|
39
|
+
print( send(color) { pad_mark(message) } )
|
40
|
+
print_time(test)
|
41
|
+
print " :: #{color_pound test}" unless color.eql?(:red)
|
42
|
+
puts
|
43
|
+
end
|
44
|
+
|
45
|
+
def print_exception(ex)
|
46
|
+
print_info(ex)
|
47
|
+
puts
|
48
|
+
end
|
49
|
+
|
50
|
+
def color_pound(str)
|
51
|
+
str.to_s.gsub(/(?<foo>(?<!:)(?:#|:)\w{1,}\??)/, ANSI::Code.yellow('\k<foo>')).
|
52
|
+
gsub(/(?<foo>[A-Z]\S*)/, ANSI::Code.cyan('\k<foo>')).
|
53
|
+
gsub(/(?<foo>(?:NIL|NULL|ERROR|FAIL|EXCEPTION|FALSE))/i, ANSI::Code.red('\k<foo>')).
|
54
|
+
gsub(/(?<foo>(?:self|true))/, ANSI::Code.green('\k<foo>'))
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: color_pound_spec_reporter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel P. Clark
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.8'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest-reporters
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.14.24
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.14.24
|
69
|
+
description: SpecReporter with easy to follow colors.
|
70
|
+
email:
|
71
|
+
- 6ftdan@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
78
|
+
- CODE_OF_CONDUCT.md
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- color_pound_spec_reporter.gemspec
|
86
|
+
- example/color-output.png
|
87
|
+
- lib/color_pound_spec_reporter.rb
|
88
|
+
- lib/color_pound_spec_reporter/version.rb
|
89
|
+
homepage: https://github.com/danielpclark/color_pound_spec_reporter
|
90
|
+
licenses:
|
91
|
+
- MIT
|
92
|
+
metadata: {}
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 2.4.6
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: Modifies your SpecReporter for easy to follow colored output.
|
113
|
+
test_files: []
|