rspec-rainbow 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3fa791cdbf86491a406675b8ad733cbdf38404e
4
+ data.tar.gz: b7f1fbb64296c1226bf050f19cee279b2905cf29
5
+ SHA512:
6
+ metadata.gz: a6cbd25197872eab8a37ed5826675c9d8d03287de6a15f466e97fe74d0c9842da051c21b14da13b2ab2d7032a85bed778b3b88c16fd2c58002ade2605a4b7ca8
7
+ data.tar.gz: 492dce51d5de60ed03258fe28116945970f1b9bfd185aaa7f6d68d25d2bc46f5fd3ee71666e9939dff64d833e4d870b74fbaf905fc19310eb1d83d1e9de48845
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-rainbow.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Mike Coutermarsh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ 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, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # rspec-rainbow
2
+
3
+ Add some color to your rspec tests!
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'rspec-rainbow'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install rspec-rainbow
18
+
19
+ Then, when running rspec:
20
+
21
+ $ rspec --format Rainbow
22
+
23
+ If you want to use Rainbow by default, add it to your ```.rspec``` file.
24
+
25
+ --format Rainbow
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/rainbow.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'rspec/core/formatters/progress_formatter'
2
+
3
+ class Rainbow < ::RSpec::Core::Formatters::ProgressFormatter
4
+
5
+ def initialize(options)
6
+ @colors = (31..36).to_a
7
+ @color_index = 0
8
+ super(options)
9
+ end
10
+
11
+ def rainbow
12
+ @color_index == (@colors.size - 1) ? @color_index = 0 : @color_index += 1
13
+ @colors[@color_index]
14
+ end
15
+
16
+ def color(text, color_code)
17
+ colorize(text, rainbow)
18
+ end
19
+
20
+ def color_code_for(code_or_symbol)
21
+ return code_or_symbol if code_or_symbol.is_a?(Integer)
22
+ super
23
+ end
24
+
25
+ end
@@ -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
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rspec-rainbow"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["Mike Coutermarsh"]
9
+ spec.email = ["coutermarsh.mike@gmail.com"]
10
+ spec.description = %q{rainbow formatter}
11
+ spec.summary = %q{rspec rainbow formatter}
12
+ spec.homepage = "https://github.com/mscoutermarsh/rspec-rainbow"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency 'rspec-core', ['>= 2.14.0', '< 3.1.0']
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-rainbow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mike Coutermarsh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2014-01-26 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec-core
16
+ prerelease: false
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 2.14.0
22
+ - - <
23
+ - !ruby/object:Gem::Version
24
+ version: 3.1.0
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: "1.3"
35
+ type: :development
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: rake
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - &id004
43
+ - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id003
48
+ description: rainbow formatter
49
+ email:
50
+ - coutermarsh.mike@gmail.com
51
+ executables: []
52
+
53
+ extensions: []
54
+
55
+ extra_rdoc_files: []
56
+
57
+ files:
58
+ - .gitignore
59
+ - Gemfile
60
+ - LICENSE
61
+ - README.md
62
+ - Rakefile
63
+ - lib/rainbow.rb
64
+ - rspec-rainbow.gemspec
65
+ homepage: https://github.com/mscoutermarsh/rspec-rainbow
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+
70
+ post_install_message:
71
+ rdoc_options: []
72
+
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - *id004
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - *id004
81
+ requirements: []
82
+
83
+ rubyforge_project:
84
+ rubygems_version: 2.2.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: rspec rainbow formatter
88
+ test_files: []
89
+