rainbow 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/rainbow.rb +2 -2
  2. data/test/rainbow_test.rb +6 -0
  3. metadata +3 -3
@@ -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.clone
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$/
@@ -112,6 +112,12 @@ class RainbowTest < Test::Unit::TestCase #:nodoc:
112
112
  assert_equal string, "hello"
113
113
  end
114
114
 
115
+ def test_frozen
116
+ string = "frozen"
117
+ string.freeze
118
+ string.color(:red)
119
+ end
120
+
115
121
  class MyString < String
116
122
  end
117
123
 
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.3
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: 2011-12-06 00:00:00.000000000Z
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.10
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