Skip to content

Latest commit

 

History

History
82 lines (60 loc) · 2.97 KB

README.md

File metadata and controls

82 lines (60 loc) · 2.97 KB

Jazz Fingers

This repo is a fork, with updates and bug fixes based on jazz_hands.

Spending hours in the rails console? Spruce it up and show off those hard-working hands!

jazz_fingers is an opinionated set of console-related gems and a bit of glue:

  • Pry for a powerful shell alternative to IRB.
  • Awesome Print for stylish pretty print.
  • Hirb for tabular collection output.
  • Pry Rails for additional commands (show-routes, show-models, show-middleware) in the Rails console.
  • Pry Doc to browse Ruby source, including C, directly from the console.
  • Pry Git to teach the console about git. Diffs, blames, and commits on methods and classes, not just files.
  • Pry Remote to connect remotely to a Pry console.
  • Pry Coolline for syntax highlighting as you type.

Usage

Ruby 2.0.0+, Rails 3 or 4 only. Add to your project Gemfile:

group :development, :test do
  gem 'jazz_fingers'
end

That's it. Run rails console as usual.

Hirb isn't enabled by default. To use, run Hirb.enable in the console.

Ruby compiled against a proper readline library, ideally GNU readline, is recommended. Alternatively, gem install rb-readline for an acceptible backup. Using ruby compiled against a libedit wrapper (primarily OS X) will work but is not recommended.

Options

Change the following options by creating an initializer in your Rails project Example config/initializers/jazz_fingers.rb:

if defined?(JazzFingers)
  JazzFingers.colored_prompt = false
end

colored_prompt

Color the console prompt? Defaults to true when the current ruby is compiled against GNU readline or rb-readline, which don't have issues counting characters in colored prompts. false for libedit.

Note: Pry.color = false trumps this setting and disables all console coloring.

prompt_separator

Separator string between the application name and line input. Defaults to » for GNU readline or libedit. Defaults to > for rb-readline which fails on mixed encodings.