README.md in pastel-0.6.0 vs README.md in pastel-0.6.1
- old
+ new
@@ -1,28 +1,28 @@
<div align="center">
- <img width="215" src="https://cdn.rawgit.com/peter-murach/pastel/master/assets/pastel_logo.png" alt="pastel logo" />
+ <img width="215" src="https://cdn.rawgit.com/piotrmurach/pastel/master/assets/pastel_logo.png" alt="pastel logo" />
</div>
# Pastel
[![Gem Version](https://badge.fury.io/rb/pastel.svg)][gem]
-[![Build Status](https://secure.travis-ci.org/peter-murach/pastel.svg?branch=master)][travis]
-[![Code Climate](https://codeclimate.com/github/peter-murach/pastel/badges/gpa.svg)][codeclimate]
-[![Coverage Status](https://coveralls.io/repos/peter-murach/pastel/badge.svg)][coverage]
-[![Inline docs](http://inch-ci.org/github/peter-murach/pastel.svg?branch=master)][inchpages]
+[![Build Status](https://secure.travis-ci.org/piotrmurach/pastel.svg?branch=master)][travis]
+[![Code Climate](https://codeclimate.com/github/piotrmurach/pastel/badges/gpa.svg)][codeclimate]
+[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/pastel/badge.svg)][coverage]
+[![Inline docs](http://inch-ci.org/github/piotrmurach/pastel.svg?branch=master)][inchpages]
[gem]: http://badge.fury.io/rb/pastel
-[travis]: http://travis-ci.org/peter-murach/pastel
-[codeclimate]: https://codeclimate.com/github/peter-murach/pastel
-[coverage]: https://coveralls.io/r/peter-murach/pastel
-[inchpages]: http://inch-ci.org/github/peter-murach/pastel
+[travis]: http://travis-ci.org/piotrmurach/pastel
+[codeclimate]: https://codeclimate.com/github/piotrmurach/pastel
+[coverage]: https://coveralls.io/github/piotrmurach/pastel
+[inchpages]: http://inch-ci.org/github/piotrmurach/pastel
> Terminal output styling with intuitive and clean API that doesn't monkey patch String class.
**Pastel** is minimal and focused to work in all terminal emulators.
-![screenshot](https://github.com/peter-murach/pastel/raw/master/assets/screenshot.png)
+![screenshot](https://github.com/piotrmurach/pastel/raw/master/assets/screenshot.png)
-**Pastel** provides independent coloring component for [TTY](https://github.com/peter-murach/tty) toolkit.
+**Pastel** provides independent coloring component for [TTY](https://github.com/piotrmurach/tty) toolkit.
## Features
* Doesn't monkey patch `String`
* Intuitive and expressive API
@@ -56,11 +56,11 @@
* [2.5 Strip](#25-strip)
* [2.6 Styles](#26-styles)
* [2.7 Lookup](#27-lookup)
* [2.8 Valid?](#28-valid)
* [2.9 Colored?](#29-colored)
- * [2.10 Enabled?](#30-enabled)
+ * [2.10 Enabled?](#210-enabled)
* [2.11 Eachline](#211-eachline)
* [2.12 Alias Color](#212-alias-color)
* [3. Supported Colors](#3-supported-colors)
* [4. Environment](#4-environment)
* [5. Command line](#5-command-line)
@@ -131,10 +131,13 @@
puts error.('Error!')
puts warning.('Warning')
```
+If your output is redirected to a file, you probably don't want Pastel to add color to your text.
+See https://github.com/piotrmurach/pastel#210-enabled for a way to easily accomplish this.
+
**Pastel** has companion library called `pastel-cli` that allows you to style text in terminal via `pastel` executable:
```bash
$ pastel green 'Unicorns & rainbows!'
```
@@ -240,10 +243,18 @@
```ruby
pastel = Pastel.new(enabled: true)
pastel.enabled? # => true
```
+If you are outputting to stdout or stderr, and want to suppress color if output is redirected to a file,
+you can set the enabled attribute dynamically, as in:
+
+```ruby
+stdout_pastel = Pastel.new(enabled: $stdout.tty?)
+stderr_pastel = Pastel.new(enabled: $stderr.tty?)
+```
+
### 2.11 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:
```ruby
@@ -338,18 +349,18 @@
PASTEL_COLORS_ALIASES='newcolor_1=red,newcolor_2=on_green'
```
## 5. Command line
-You can also install [pastel-cli](https://github.com/peter-murach/pastel-cli) to use `pastel` executable in terminal:
+You can also install [pastel-cli](https://github.com/piotrmurach/pastel-cli) to use `pastel` executable in terminal:
```bash
$ pastel green 'Unicorns & rainbows!'
```
## Contributing
-1. Fork it ( https://github.com/peter-murach/pastel/fork )
+1. Fork it ( https://github.com/piotrmurach/pastel/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request