Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What a coincidence. <a href="http://www.rubyflow.com/" rel="nofollow noreferrer">Rubyflow</a> just yesterday announced the <a href="http://irb.tools/" rel="nofollow noreferrer">irbtools</a> gem, which is a meta-gem containing lots of cool irb enhancement gems. It contains:</p> <ul> <li>Colorized and output as comment by <code>wirb</code> and <code>fancy_irb</code></li> <li>Nice IRB prompt and IRB’s auto indention</li> <li>Includes stdlib’s FileUtils: <code>ls</code>, <code>cd</code>, <code>pwd</code>, <code>ln_s</code>, <code>rm</code>, <code>mkdir</code>, <code>touch</code>, <code>cat</code></li> <li>Many debugging helpers: <code>ap</code>, <code>q</code>, <code>o</code>, <code>c</code>, <code>y</code>, <code>Object#m</code>, <code>Object#d</code> <ul> <li><code>ap</code> – awesome_print</li> <li><code>q</code> – like <code>p</code>, but on one line</li> <li><code>Object#m</code> – ordered method list (takes integer parameter: level of nesting)</li> <li><code>Object#d</code> – puts the object, returns self (using <code>tap</code>)</li> </ul></li> <li>“Magical” information constants: <code>Info, OS, RubyVersion, RubyEngine</code> <ul> <li><code>OS.windows?</code></li> <li><code>RubyEngine.jruby?</code></li> <li><code>RubyVersion.is.at_least? 1.9</code></li> </ul></li> <li>Clipboard features: <code>copy</code> and <code>paste</code> <ul> <li>also available: <code>copy_input</code> and <code>copy_output</code> for session history</li> </ul></li> <li>Call <code>vim</code> (or another supported editor) to edit a file, close it and it gets loaded into your current irb session, powered by <code>interactive_editor</code></li> <li>Another way of live loading into irb: sketches</li> <li>Highlight a string with <code>olorize('string')</code> or a file with <code>ray('path')</code>, powered by coderay</li> <li>Displays ActiveRecord database entries as tables with <code>hirb</code></li> <li>Restart <code>irb</code> with <code>reset!</code> or change the Ruby version with the <code>use</code> method and <code>rvm!</code></li> <li>Includes the current directory in the load path (was removed in 1.9.2 for security reasons, but is pretty annoying in IRB)</li> <li>Shorter requiring like this: <code>rq:mathn</code></li> <li>And rerquiring with <code>rrq</code></li> <li>Try the included <code>Object#ri</code> helper, powered by <code>ori</code>!</li> <li>Access to a lot of more commands with <code>boson</code> – call commands to get started</li> </ul> <p>There are nice screenshots on the <a href="http://irb.tools/" rel="nofollow noreferrer">irbtools</a> page. One nice thing about it is that each of the utilities can stand on its own, in case you just want to cherry-pick one or two features.</p> <p><strong>2013 Update</strong></p> <p>Since I wrote this, <a href="http://pryrepl.org/" rel="nofollow noreferrer">Pry</a> has become a popular IRB replacement. It doesn't do as much as <code>irbtools</code> out of the box, but it extensible with plugin gems that add cool features. You can browse source code like it was a unix directory:</p> <pre><code>pry(main)&gt; cd FileUtils pry(FileUtils):1&gt; show-method rm From: /opt/ruby/lib/ruby/1.9.1/fileutils.rb @ line 556: Number of lines: 10 Owner: FileUtils def rm(list, options = {}) fu_check_options options, OPT_TABLE['rm'] list = fu_list(list) fu_output_message "rm#{options[:force] ? ' -f' : ''} #{list.join ' '}" if options[:verbose] return if options[:noop] list.each do |path| remove_file path, options[:force] end end pry(FileUtils):2&gt; </code></pre> <p>You can also browse Ruby documentation, issue shell commands, and if you're a Rails user, you can use the <code>pry-rails</code> gem to get pry in your Rails console. There's also a way to hook it into Sinatra and use it with Heroku. </p> <p>There's ample documentation--there are a bunch of screencasts including a Railscast. It's definitely worth looking into.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload