From 36c7e48310785ea3f2e1388e8cfcd4c303e3c55a Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Tue, 21 Nov 2017 21:01:21 +0100 Subject: [PATCH] Let's don't talk about String mixin anymore --- README.markdown | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/README.markdown b/README.markdown index 9efac4c..7410b7a 100644 --- a/README.markdown +++ b/README.markdown @@ -67,29 +67,6 @@ calls: Rainbow("hola!").blue.bright.underline ``` -### String mixin - -If you don't like wrapping every string you want to colorize with `Rainbow()` -you can include all the rainbow presenter methods directly in a String class by -requiring `rainbow/ext/string`: - -```ruby -require 'rainbow/ext/string' - -puts "this is red".color(:red) + " and " + "this on yellow bg".background(:yellow) + " and " + "even bright underlined!".underline.bright -``` - -This way of using Rainbow is not recommended though as it pollutes String's -public interface with methods that are presentation specific. - -NOTE: the mixin doesn't include shortcut methods for changing text color, you -should use "string".color(:blue) instead of "string".blue - -NOTE: the mixin is included in String by default in rainbow 1.x versions. -In rainbow 2.x the behavior was changed - if you're upgrading from 1.x to 2.x -and you used direct String methods then you can either require the string -extension as shown above or update your code to use the new presenter API. - ### Refinement If you want to use the Refinements version, you can: