= irbtools
This is a meta gem which installs some useful irb gems and configures your irb.
== Setup
gem install irbtools
* On Linux, you also need +xclip+: sudo apt-get install xclip
* On Windows, you need ansicon[https://github.com/adoxa/ansicon]
* On MacOS, you will need growl, if you want to use the +g+ gem.
=== Wrong display widths?
When using double-width unicode chars, you should need to pass the :east_asian_width = true when starting FancyIrb. It is deactivated because of performance issues.
== Usage
To use it, put the following in your ~/.irbrc file (this file is loaded every time you start an irb):
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'irbtools'
If it does not exist, just create a new one.
It's possible to modify, which libraries get loaded:
require 'irbtools/configure'
# here you can modify which libraries get loaded (see below)
Irbtools.init
=== Rails notes
To use irbtools within the rails console, you will have to add irbtools to your Gemfile.
You can put Rails specific configuration in a ~/.railsrc file which gets loaded only in Rails environments.
=== How to load more or less libraries
You have the following ways:
* Irbtools.add_library(lib, in_proc = false, &block)
* Irbtools.remove_library(lib)
* Irbtools.add_package(pkg)
* Irbtools.remove_package(pkg)
Edit the Irbtools.libraries, Irbtools.libraries_in_proc or Irbtools.packages arrays directly. If you use the add_library method, you can apply a block which gets executed when the library is loaded.
== Features
See http://rbjl.net/40-irbtools-release-the-power-of-irb or read the commented source files.
=== Included gems and libraries
* wirb[https://github.com/janlelis/wirb/] colorize output
* hirb[http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html] (active record) tables and custom views for specific objects
* fancy_irb[https://github.com/janlelis/fancy_irb] put result as comment and more colorization
* *fileutils* (stdlib) cd, pwd, ln_s, mv, rm, mkdir, touch ... ;)
* clipboard[http://github.com/janlelis/clipboard] easy clipboard access (copy & paste)
* interactive_editor[https://github.com/jberkel/interactive_editor] lets you open vim, hack something, and it gets loaded into the current session
* sketches[http://sketches.rubyforge.org/] another, more flexible "start editor and it gets loaded into your irb session" plugin
* zucker[http:/rubyzucker.info] nice debug printing (q, o, c, .m, .d) + useful pseudo-constants (Info, OS, RubyVersion, RubyEngine)
* ap[https://github.com/michaeldv/awesome_print] nice debug printing (ap) [also see wp]
* coderay[http://coderay.rubychan.de/] some nice colorful displaying ;)
* boson[http://tagaholic.me/boson/] commands repository (commands also work in the shell!)
* guessmethod[http://guessmethod.rubyforge.org/] automatically corrects typos (method_missing hook) [not loaded by default]
=== Helper methods
See the source for a description. These methods are defined directly by irbtools. Each gem may add its own helper methods.
*General*: ls, cat, rq, rrq/rerequire, ld, session_history, reset!, clear, use_ruby/use, rubies, use_gemset/gemset, gemsets, dbg, Object#ri
*Clipboard*: copy, paste, copy_input, copy_output
*CodeRay*: colorize, ray
==== RVM
If you have RVM installed, you can switch your gemset or ruby with gemset and use (use gemsets and rubies to get a list). The gemset can be changed within the session, while changing ruby starts a new one. Please also note that you need to have installed irbtools for that ruby version. I recommend installing it in the global gemset.
== Welcome message
You can customize the welcome message with Irbtools.welcome_message=
== Todo
* Nicer ri command
=== Planned features for 0.9.0 (next main version)
* define flexibly, whether library should be loaded on start/on subsession or via autoload
* faster loading
== More Features
* See the irbtools-more[https://github.com/janlelis/irbtools-more] package or suggest some useful utilities/tweaks ;)
== Copyright
Copyright (c) 2010-2011 Jan Lelis, http://rbjl.net, released under the MIT license.
J-_-L