GithubHelp home page GithubHelp logo

isabella232 / jazz_hands Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chef/jazz_hands

0.0 0.0 0.0 41 KB

Pry-based enhancements for the default Rails 3 and 4 consoles

License: MIT License

Ruby 100.00%

jazz_hands's Introduction

Jazz Hands Bitdeli Badge

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

jazz_hands 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 Debugger to turn the console into a simple debugger.
  • Pry Stack Explorer to navigate the call stack and frames.
  • Coolline and Coderay for syntax highlighting as you type. Optional. MRI 1.9.3/2.0.0 only

Usage

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

group :development, :test do
  gem 'jazz_hands'
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_hands.rb:

if defined?(JazzHands)
  JazzHands.colored_prompt = false
  JazzHands.enable_syntax_highlighting_as_you_type!
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.

Syntax highlighting

Syntax highlighting as you type via Coolline and Coderay is disabled by default due to slightly buggy behavior. To enable, add JazzHands.enable_syntax_highlighting_as_you_type! to the initializer. Only works with MRI 1.9.3 or 2.0.0.

Contributing

Patches and bug reports are welcome. Just send a pull request or file an issue. Project changelog.

jazz_hands's People

Contributors

nixme avatar caseylang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.