kyrylo/pry-theme


An easy way to customize Pry colors via theme files

License: Zlib

Language: Ruby


Pry Theme

Pry Theme version badge Build Status

Description

Pry Theme is a plugin for Pry, which helps you to customise your Pry colors via prytheme.rb files.

Railscasts Solarized Tomorrow Zenburn

Installation

All you need is to install the gem. The pry-theme plugin will be detected and used automatically.

gem install pry-theme

Synopsis

Theme files

Theme file is nothing but a Ruby file, which has .prytheme.rb extension (for example, beautiful.prytheme.rb). In order to set up the desired theme, add the following line to your .pryrc:

Pry.config.theme = "theme-name"

The default theme is the one from the pry-classic family. It is dependent on your terminal capabilities. For example, if you're using Windows, your default theme will be pry-classic-16, since the Windows terminal can't support more than 16 colours. If you're using xterm or urxvt, then your default theme will be pry-classic-256 (basically, you shouldn't notice it, because it resembles the default outlook of Pry, as though Pry Theme isn't present). This outlines the rule: the more colours your terminal supports, the more vivid version of pry-classic is used.

Let's change it to something more neoteric:

Pry.config.theme = "pry-modern-256"

That's all! Launch your Pry and you will see the changes.

CLI

Pry Theme has a command-line interface available via Pry. Just launch Pry and start working with it. For example, you can temporary change themes on the fly (only for the current session):

[1] pry(main)> pry-theme try pry-classic-8

This subcommand would switch your current theme to pry-classic-8 theme.

You can find more information about CLI in Pry Theme Wiki.

Managing themes

Creating new themes isn't hard. Check out Pry Theme Wiki article on that.

Theme files must have .prytheme.rb extension. Check out Pry Theme Collection if you want to find some themes other than default ones.

If you already have your theme stored somewhere on disk, just put it in the $HOME/.pry/themes directory.

If you don't want to bother with routine operations, you can install a theme from the Collection with help of pry-theme install <name> subcommand. For example, you can want to install the xoria256 theme. Just execute pry-theme install xoria256 and you're done.

Oh, and don't forget to adjust your .pryrc!

Limitations

No limitations. Pry Theme will run everywhere where you can launch Pry.

Credits

  • Thanks to banister for bringing the plugin in masses and contributing a bunch of themes;
  • Thanks to Karandashev for "Puzzle" font;
  • Thanks to Creatica for "Dited" font;
  • Thanks to noprompt for a HEX to ANSI conversion Ruby implementation, which I borrowed from one of his projects.

License

The project uses Zlib License. See LICENSE file for more information.

Project Statistics

Sourcerank 10
Repository Size 771 KB
Stars 140
Forks 10
Watchers 7
Open issues 2
Dependencies 5
Contributors 8
Tags 23
Created
Last updated
Last pushed

Top Contributors See all

Kyrylo Silin John Mair ☈king Daniel Bayerlein Josh Cheek Shannon Skipper Mon-Ouie Roman Usherenko

Packages Referencing this Repo

pry-theme
The plugin enables color theme support for Pry.
Latest release 1.3.0 - Updated - 140 stars

Recent Tags See all

v1.2.0 January 16, 2017
v1.1.3 July 21, 2014
v1.1.2 June 16, 2014
v1.1.1 June 14, 2014
v1.1.0 June 13, 2014
v1.0.3 May 11, 2014
v1.0.2 May 11, 2014
v1.0.1 November 18, 2013
v1.0.0 November 12, 2013
v0.2.0 March 26, 2013
v0.1.3 September 22, 2012
v0.1.2 August 31, 2012
v0.1.0 July 22, 2012
v0.0.10 July 08, 2012
v0.0.9 July 04, 2012

Something wrong with this page? Make a suggestion

Last synced: 2019-01-26 04:59:22 UTC

Login to resync this repository