Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mscoutermarsh committed Jan 26, 2014
1 parent cc980bc commit 80b8b2e
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 8 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Expand Up @@ -2,17 +2,16 @@
*.rbc
.bundle
.config
coverage
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp

# YARD artifacts
.yardoc
_yardoc
doc/
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in rspec-rainbow.gemspec
gemspec
31 changes: 29 additions & 2 deletions README.md
@@ -1,2 +1,29 @@
rspec-rainbow
=============
# Rspec::Rainbow

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

gem 'rspec-rainbow'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-rainbow

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
1 change: 1 addition & 0 deletions Rakefile
@@ -0,0 +1 @@
require "bundler/gem_tasks"
24 changes: 24 additions & 0 deletions lib/rainbow.rb
@@ -0,0 +1,24 @@
require 'rspec/core/formatters/base_text_formatter'

class Rainbow < ::RSpec::Core::Formatters::BaseTextFormatter
def initialize(options)
@colors = (31..36).to_a
@color_index = 0
super(options)
end

def rainbow
@color_index == (@colors.size - 1) ? @color_index = 0 : @color_index += 1
@colors[@color_index]
end

def color(text, color_code)
colorize(text, rainbow)
end

def color_code_for(code_or_symbol)
return code_or_symbol if code_or_symbol.is_a?(Integer)
super
end

end
24 changes: 24 additions & 0 deletions rspec-rainbow.gemspec
@@ -0,0 +1,24 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = "rspec-rainbow"
spec.version = "0.0.1"
spec.authors = ["Mike Coutermarsh"]
spec.email = ["coutermarsh.mike@gmail.com"]
spec.description = %q{TODO: Write a gem description}
spec.summary = %q{TODO: Write a gem summary}
spec.homepage = "https://github.com/mscoutermarsh/rspec-rainbow"
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'rspec', ['>= 2.14.0', '< 3.1.0']

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
end

0 comments on commit 80b8b2e

Please sign in to comment.