Add pry-theme -e — Edit theme then display results.
Better style, thanks to Banister.
Fixed lputs usage

The output object wasn't being passed to lputs. Therefore, when it wasn't
$stdout, information would be printed in the wrong place.
Fix aquamarine color names

Resolve issue #15 (Duplicate colors 86:aquamarine03 and
122:aquamarine03).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Really set default theme, when none specified

Fix issue #13 (when running pry-theme -l and .prytheme doesn't exist, we
get a TypeError because you're trying to dup nil).

------------------------------------------------------------------------
Description by banister:

this line in your test_theme method on the pry-theme command fails:

  old_theme = PryTheme.current_theme.dup

because PryTheme.current_theme is nil (and you cannot dup nil)
------------------------------------------------------------------------

If a user doesn't specify his color theme in `~/.pryrc`, he get a proper
warning message that pry-theme falled back to default theme. But in fact
it doesn't fall back (only informs). So, @current_theme ivar is set to
nil in such cases.

This commit fixes the issue and slightly improves visual style of
string interpolations in the code (oh, and also replaces hard-coded
"pry-classic" to more flexible DEFAULT_THEME_NAME value).

Reported-by: John Mair <jrmair@gmail.com>
Reported-by: Mon Ouie <mon.ouie@gmail.com>
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add vim-default and vim-detailed

Resolve issue #12 (Need to include another 8 color theme in default set
for windows users)

Thanks-to: ☈king <rking-pry-vimscheme@sharpsaw.org>
Reported-by: John Mair <jrmair@gmail.com>
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Get rid of useless variable

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Improve `--edit` command

First of all, move Theme.pathify_theme method to Helper. Then, add an
argument support for `-e` command. For example:

  pry(main)> pry-theme -e pry-classic

This will open `pry-classic` theme for editing.

Also, add a support for theme creation mechanism. For example:

  pry(main)> pry-theme -e +new_theme

The "+" mark indicates that we want to create a new theme. The command
will create a new file in theme directory and fill it with data from the
template (with some hints).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Fix my broken English

And improve an example of global variables.

Reported-by: Ryan King <rkingithub@sharpsaw.org>
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add some unit tests for Helper

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add tests for Color

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Don't raise NoColorError

Just output the error and return from the execution.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add some tests for Commands

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add support for different notations for `--color`

In this commit add a support for HEX, RGB and human-readable arguments
for `-c` aka `--color` command for `pry-theme` command.

First of all, I'm very thankful to Joel Holdbrooks (aka noprompt) for
Ruby impelementation of HEX to ANSI conversion with approximations
(because ANSI color palette consists only of 256 colors, while HEX has a
lot more). Mention him in Credits section of README.

Add ColorConverter module, which handles all color conversions:

  * RGB to ANSI;
  * RGB to HEX;
  * ANSI to HEX;
  * HEX to RGB;
  * HEX to ANSI.

Add helper methods for color detection to Helper module:

  * #ansi?;
  * #hex?;
  * #rgb?.

And finally, add the tests for the ColorConverter, `pry-theme -c`
command and the new Helper methods.

Ideally, the command works like this:

  pry(main)> pry-theme -c #FF3AE0
  pry(main)> pry-theme -c 32,13,244
  pry(main)> pry-theme -c red

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add `.travis.yml`

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Invoke `run_command` in the current Pry session

Not in the new one.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Refactor `edit_theme` method

Remove some repeating code in the method.

Create Helper method `display_header`, which displays headers for
`--edit` command.

Refactor example for `test_theme` method. Make it clearer and shorter.

Amend some output information, because the old one wasn't concise
enough.

Add default color-depth for template, because it can't be empty.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Amend chunk output for `--list`

Because it was really silly.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Add TermNotation scope for terminal notations

Resolve issue #17 (Eliminate notations mess in code)

Place all terminal notations in one place. Replace all hard-coded parts
of code on the subject of notations with new TermNotation's values.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Hide require calls in methods and load them lazily

Fix #10 (Pry Theme significantly increases Pry's load time)

In order to implement themes installation and getting remote list of
themes, I need to require some libraries (base64, net/http and json).
This crap significally increases time needed to load Pry, which is a
bit^W lot annoyning.

Before this commit we had the following situation:

  % time pry --no-plugins -e 'exit'
    0.65s user 0.04s system 93% cpu 0.742 total

Damn! That's lightning fast!

But with Pry Theme being installed the situation was wretched:

  % time pry -e 'exit'
    0.75s user 0.06s system 94% cpu 0.847 total

"Fuck, man, I wouldn't use your crappy plugin! NO FRIGGIN WAY!" - said a
potential plugin user. "Stand still and be prepared!" - responded I.

Wowzers! Suddenly, super ugly trick comes into play. I masterly direct
`require` calls and airily hide them into the methods that dared to use
their functionality: cryptic `base64`, inornated `json` and stumpy
`net/http`. And these methods are `show_remote_list` and
`install_theme`.

What is ugly about this solution is that I duplicate some `require`
calls. That is the main drawback. But as long as I have only two methods
that use this dirty hack, I think, we'll be fine.

Let's see how this, actually, affects the load time:

  % time pry -e 'exit'
    0.69s user 0.04s system 94% cpu 0.773 total

Not bad.

Summary: ugly, but works.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>