README.md in pastel-0.5.1 vs README.md in pastel-0.5.2
- old
+ new
@@ -67,13 +67,15 @@
**Pastel** provides a simple, minimal and intuitive API for styling your strings:
```ruby
pastel = Pastel.new
-pastel.red('Unicorns!')
+puts pastel.red('Unicorns!')
```
+**Pastel** doesn't print the colored string out, just returns it, you'll have to print it yourself.
+
You can compose multiple styles through chainable API:
```ruby
pastel.red.on_green.bold('Unicorns!')
```
@@ -119,11 +121,11 @@
```
You can also predefine needed styles and reuse them:
```ruby
-error = pastel.red.on_bold.detach
+error = pastel.red.bold.detach
warning = pastel.yellow.detach
puts error.('Error!')
puts warning.('Warning')
```
@@ -207,10 +209,10 @@
In cases when the color support is not provided no styling will be applied to the colored string. Moreover, you can force **Pastel** to always print out string with coloring switched on:
```ruby
pastel = Pastel.new(enabled: true)
-pastel.enabled? # => false
+pastel.enabled? # => true
```
### 2.9 Eachline
Normally **Pastel** colors string by putting color codes at the beginning and end of the string, but if you provide `eachline` option set to some string, that string will be considered the line delimiter. Consequently, each line will be separately colored with escape sequence and reset code at the end. This option is desirable if the output string contains newlines and you're using background colors. Since color code that spans more than one line is often interpreted by terminal as providing background for all the lines that follow. This in turn may cause programs such as pagers to spill the colors throughout the text. In most cases you will want to set `eachline` to `\n` character like so: