rainbow 1.99.1 → 1.99.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Changelog.md +4 -0
- data/Gemfile +3 -3
- data/Guardfile +1 -1
- data/lib/rainbow/color.rb +9 -9
- data/lib/rainbow/presenter.rb +7 -7
- data/lib/rainbow/version.rb +1 -1
- data/rainbow.gemspec +8 -9
- data/spec/support/presenter_shared_examples.rb +1 -1
- data/spec/unit/presenter_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb3910912fab41b3d9e26d64011f8a66832ed388
|
4
|
+
data.tar.gz: b64ec3a33953e13ce1215a5bdda8750a013fb2de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a681a15d3f2ecbb3b3d7758961b5ba0b39fefdc6a8b4e7ada9627567c2ea2793edbdb3dd8120ae33b5e94ea39648d0fa84d3b01973dc944e267945834541d566
|
7
|
+
data.tar.gz: 7caeccfe18b3229c1e4da06ec4d1a606a48ebb1125020e04239ad3dad4f62e039192ee41da1a9eee0158e88759f1e70ceec4d24ea8d2665ea819f1be39555b7f
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
@@ -57,3 +57,7 @@
|
|
57
57
|
* `require "rainbow/string"` -> `require "rainbow/ext/string"`
|
58
58
|
* custom rainbow wrapper instances (with separate enabled/disabled state)
|
59
59
|
* shortcut methods for changing text color (`Rainbow("foo").red`)
|
60
|
+
|
61
|
+
## 1.99.2 (2014-01-24)
|
62
|
+
|
63
|
+
* bring back ruby 1.8 support
|
data/Gemfile
CHANGED
@@ -3,8 +3,8 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in rainbow.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'coveralls', require
|
7
|
-
gem 'mime-types', '< 2.0.0', platforms
|
6
|
+
gem 'coveralls', :require => false
|
7
|
+
gem 'mime-types', '< 2.0.0', :platforms => [:ruby_18]
|
8
8
|
|
9
9
|
group :guard do
|
10
10
|
gem 'guard'
|
@@ -12,6 +12,6 @@ group :guard do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
platform :rbx do
|
15
|
+
gem 'json'
|
15
16
|
gem 'rubysl'
|
16
|
-
gem 'rubysl-json'
|
17
17
|
end
|
data/Guardfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# A sample Guardfile
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
3
3
|
|
4
|
-
guard :rspec, cmd
|
4
|
+
guard :rspec, :cmd => 'rspec --color' do
|
5
5
|
watch(%r{^spec/.+_spec\.rb$})
|
6
6
|
watch(%r{^lib/(.+)\.rb$}) { "spec" }
|
7
7
|
watch('spec/spec_helper.rb') { "spec" }
|
data/lib/rainbow/color.rb
CHANGED
@@ -52,15 +52,15 @@ module Rainbow
|
|
52
52
|
class Named < Indexed
|
53
53
|
|
54
54
|
NAMES = {
|
55
|
-
black
|
56
|
-
red
|
57
|
-
green
|
58
|
-
yellow
|
59
|
-
blue
|
60
|
-
magenta
|
61
|
-
cyan
|
62
|
-
white
|
63
|
-
default
|
55
|
+
:black => 0,
|
56
|
+
:red => 1,
|
57
|
+
:green => 2,
|
58
|
+
:yellow => 3,
|
59
|
+
:blue => 4,
|
60
|
+
:magenta => 5,
|
61
|
+
:cyan => 6,
|
62
|
+
:white => 7,
|
63
|
+
:default => 9,
|
64
64
|
}
|
65
65
|
|
66
66
|
def initialize(ground, name)
|
data/lib/rainbow/presenter.rb
CHANGED
@@ -6,13 +6,13 @@ module Rainbow
|
|
6
6
|
class Presenter < ::String
|
7
7
|
|
8
8
|
TERM_EFFECTS = {
|
9
|
-
reset
|
10
|
-
bright
|
11
|
-
italic
|
12
|
-
underline
|
13
|
-
blink
|
14
|
-
inverse
|
15
|
-
hide
|
9
|
+
:reset => 0,
|
10
|
+
:bright => 1,
|
11
|
+
:italic => 3,
|
12
|
+
:underline => 4,
|
13
|
+
:blink => 5,
|
14
|
+
:inverse => 7,
|
15
|
+
:hide => 8,
|
16
16
|
}
|
17
17
|
|
18
18
|
# Sets color of this text.
|
data/lib/rainbow/version.rb
CHANGED
data/rainbow.gemspec
CHANGED
@@ -4,15 +4,14 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'rainbow/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
11
|
-
spec.description
|
12
|
-
spec.summary
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
15
|
-
spec.required_ruby_version = '>= 1.9.2'
|
7
|
+
spec.name = "rainbow"
|
8
|
+
spec.version = Rainbow::VERSION
|
9
|
+
spec.authors = ["Marcin Kulik"]
|
10
|
+
spec.email = ["m@ku1ik.com"]
|
11
|
+
spec.description = %q{Colorize printed text on ANSI terminals}
|
12
|
+
spec.summary = %q{Colorize printed text on ANSI terminals}
|
13
|
+
spec.homepage = "https://github.com/sickill/rainbow"
|
14
|
+
spec.license = "MIT"
|
16
15
|
|
17
16
|
spec.files = `git ls-files`.split($/)
|
18
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
shared_examples_for "presenter with shortcut color methods" do
|
2
2
|
[:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white].each do |name|
|
3
3
|
describe "##{name}" do
|
4
|
-
subject { presenter.
|
4
|
+
subject { presenter.send(name) }
|
5
5
|
|
6
6
|
it { should eq(presenter.color(name)) }
|
7
7
|
end
|
data/spec/unit/presenter_spec.rb
CHANGED
@@ -17,7 +17,7 @@ module Rainbow
|
|
17
17
|
end
|
18
18
|
|
19
19
|
shared_examples_for "text color method" do
|
20
|
-
let(:color) { double('color', codes
|
20
|
+
let(:color) { double('color', :codes => [1, 2]) }
|
21
21
|
|
22
22
|
before do
|
23
23
|
allow(Color).to receive(:build).
|
@@ -34,7 +34,7 @@ module Rainbow
|
|
34
34
|
end
|
35
35
|
|
36
36
|
shared_examples_for "text background method" do
|
37
|
-
let(:color) { double('color', codes
|
37
|
+
let(:color) { double('color', :codes => [1, 2]) }
|
38
38
|
|
39
39
|
before do
|
40
40
|
allow(Color).to receive(:build).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainbow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.99.
|
4
|
+
version: 1.99.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Kulik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
102
|
requirements:
|
103
103
|
- - '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
105
|
+
version: '0'
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '>='
|