rainbow 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rainbow.rb +2 -2
- data/test/rainbow_test.rb +6 -0
- metadata +3 -3
data/lib/rainbow.rb
CHANGED
@@ -4,7 +4,7 @@ require File.join(File.dirname(__FILE__), 'ansi_color')
|
|
4
4
|
module Sickill
|
5
5
|
module Rainbow
|
6
6
|
class << self; attr_accessor :enabled; end
|
7
|
-
@enabled = STDOUT.tty? && ENV['TERM'] != 'dumb'
|
7
|
+
@enabled = STDOUT.tty? && ENV['TERM'] != 'dumb' || ENV['CLICOLOR_FORCE'] == '1'
|
8
8
|
|
9
9
|
TERM_COLORS = {
|
10
10
|
:black => 0,
|
@@ -86,7 +86,7 @@ module Sickill
|
|
86
86
|
def wrap_with_code(code) #:nodoc:
|
87
87
|
return self unless Sickill::Rainbow.enabled
|
88
88
|
|
89
|
-
var = self.
|
89
|
+
var = self.dup
|
90
90
|
matched = var.match(/^(\e\[([\d;]+)m)*/)
|
91
91
|
var.insert(matched.end(0), "\e[#{code}m")
|
92
92
|
var.concat("\e[0m") unless var =~ /\e\[0m$/
|
data/test/rainbow_test.rb
CHANGED
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: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: marcin.kulik@gmail.com
|
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
46
|
rubyforge_project:
|
47
|
-
rubygems_version: 1.8.
|
47
|
+
rubygems_version: 1.8.22
|
48
48
|
signing_key:
|
49
49
|
specification_version: 3
|
50
50
|
summary: Rainbow extends ruby String class enabling coloring text on ANSI terminals
|