Closed fcoury closed 12 years ago
Fixes the problem when adding colors to frozen strings:
1.8.7 :006 > x="a" => "a" 1.8.7 :007 > x.color(:yellow) => "\e[33ma\e[0m" 1.8.7 :009 > x.freeze => "a" 1.8.7 :010 > x.color(:yellow) TypeError: can't modify frozen string from /Users/fcoury/.rvm/gems/ree-1.8.7-2011.12/gems/rainbow-1.1.3/lib/rainbow.rb:91:in `insert' from /Users/fcoury/.rvm/gems/ree-1.8.7-2011.12/gems/rainbow-1.1.3/lib/rainbow.rb:91:in `wrap_with_code' from /Users/fcoury/.rvm/gems/ree-1.8.7-2011.12/gems/rainbow-1.1.3/lib/rainbow.rb:33:in `color' from (irb):10
That looks great, thanks. I'll merge it and release new gem tomorrow.
Fixes the problem when adding colors to frozen strings: