rainbow 1.99.2 → 2.0.0
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 +4 -4
- data/.travis.yml +0 -1
- data/Changelog.md +4 -0
- data/Gemfile +2 -2
- data/Guardfile +1 -1
- data/README.markdown +4 -3
- data/lib/rainbow.rb +0 -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 +9 -8
- data/spec/support/presenter_shared_examples.rb +1 -1
- data/spec/unit/presenter_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 372e902e66070b47cdb7c31a2261929f57086e59
|
4
|
+
data.tar.gz: 57e6af68cbd87bf8c79298b9d6d77e0a46719dc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37394c88313337fb8fc04dc6d1f649eaea0c257d25a4e44e4cd1f54d07a87fb3cfce3673c86a33079468440fd040d21bf4c57d53fd4ef9d8a8a01169465236fc
|
7
|
+
data.tar.gz: a0a235ea3d51152d2a107435229730daa19f8d4a1f838803af6af87707a2e17fc2f48fb6195d78fab26acce0673aca33535a499c9ebc4feb5b64d6696edf63f2
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
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', :
|
7
|
-
gem 'mime-types', '< 2.0.0', :
|
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'
|
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, :
|
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/README.markdown
CHANGED
@@ -76,9 +76,10 @@ public interface with methods that are presentation specific.
|
|
76
76
|
NOTE: the mixing doesn't include shortcut methods for changing text color, you
|
77
77
|
should use "string".color(:blue) instead of "string".blue
|
78
78
|
|
79
|
-
NOTE: the mixin is included in String by default in rainbow versions
|
80
|
-
|
81
|
-
|
79
|
+
NOTE: the mixin is included in String by default in rainbow 1.x versions.
|
80
|
+
In rainbow 2.x the behavior was changed - if you're upgrading from 1.x to 2.x
|
81
|
+
and you used direct String methods then you can either require the string
|
82
|
+
extension as shown above or update your code to use the new presenter API.
|
82
83
|
|
83
84
|
### Color specification
|
84
85
|
|
data/lib/rainbow.rb
CHANGED
data/lib/rainbow/color.rb
CHANGED
@@ -52,15 +52,15 @@ module Rainbow
|
|
52
52
|
class Named < Indexed
|
53
53
|
|
54
54
|
NAMES = {
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
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
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
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,14 +4,15 @@ $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
|
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"
|
15
|
+
spec.required_ruby_version = '>= 1.9.2'
|
15
16
|
|
16
17
|
spec.files = `git ls-files`.split($/)
|
17
18
|
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.public_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', :
|
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', :
|
37
|
+
let(:color) { double('color', codes: [1, 2]) }
|
38
38
|
|
39
39
|
before do
|
40
40
|
allow(Color).to receive(:build).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainbow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Kulik
|
@@ -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: 1.9.2
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '>='
|