diff --git a/CHANGELOG b/CHANGELOG index 37596ef..ded774e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +0.0.7: +* Replace calls to String#clone by String#dup so it doesn't error on frozen strings + 0.0.6: * Fixed args for puts/print (completely overlooked 0 args) * Changed how nested spaces are passed around diff --git a/lib/inkjet/colors.rb b/lib/inkjet/colors.rb index c5c3998..524bc95 100644 --- a/lib/inkjet/colors.rb +++ b/lib/inkjet/colors.rb @@ -41,7 +41,7 @@ def self.included(base) end def colorize(color, str, wrap=false) - colorize!(color, str.clone, wrap) + colorize!(color, str.dup, wrap) end def colorize!(color, str, wrap=false) @@ -49,7 +49,7 @@ def colorize!(color, str, wrap=false) end def colorize_background(color, str, wrap=false) - colorize_background!(color, str.clone, wrap) + colorize_background!(color, str.dup, wrap) end def colorize_background!(color, str, wrap=false) @@ -57,7 +57,7 @@ def colorize_background!(color, str, wrap=false) end def colorize_with_background(fg_color, bg_color, str, wrap=false) - colorize_with_background!(fg_color, bg_color, str.clone, wrap) + colorize_with_background!(fg_color, bg_color, str.dup, wrap) end def colorize_with_background!(fg_color, bg_color, str, wrap=false) diff --git a/lib/inkjet/string.rb b/lib/inkjet/string.rb index 5e2f74e..2d42063 100644 --- a/lib/inkjet/string.rb +++ b/lib/inkjet/string.rb @@ -55,7 +55,7 @@ def clean! end def clean - clone.clean! + dup.clean! end # Apply a formatting code to the appropriate chunks in the string. @@ -86,13 +86,13 @@ def apply_inkjet_code!(code, wrap=false) end def apply_inkjet_code(code, wrap=false) - clone.apply_inkjet_code!(code, wrap) + dup.apply_inkjet_code!(code, wrap) end def apply_inkjet_codes(codes, wrap=false) - cloned = clone - codes.each { |code| cloned.apply_inkjet_code!(code, wrap) } - cloned + dupd = dup + codes.each { |code| dupd.apply_inkjet_code!(code, wrap) } + dupd end def apply_inkjet_codes!(codes, wrap=false) diff --git a/lib/inkjet/styles.rb b/lib/inkjet/styles.rb index 084328e..db0e541 100644 --- a/lib/inkjet/styles.rb +++ b/lib/inkjet/styles.rb @@ -18,7 +18,7 @@ def self.included(base) end def stylize(style, str, wrap=false) - stylize!(style, str.clone, wrap) + stylize!(style, str.dup, wrap) end def stylize!(style, str, wrap=false) diff --git a/lib/inkjet/version.rb b/lib/inkjet/version.rb index c047b04..0fa42f5 100644 --- a/lib/inkjet/version.rb +++ b/lib/inkjet/version.rb @@ -1,3 +1,3 @@ module Inkjet - VERSION = '0.0.6' + VERSION = '0.0.7' end