Autocomplete and colorize your Ruby shell ( irb ) with wirble
Lets first install wirble
sudo gem install wirble
Add following lines to ~/.irbrc
#!/usr/bin/ruby require 'irb/completion' require 'rubygems' require 'wirble' Wirble.init Wirble.colorize
Now invoke irb.
$ irb >> 1.m # press TAB here to auto complete 1.method 1.methods 1.modulo >> 1.methods # press ENTER and the output will be colorized=> ["%", "odd?", "inspect", "prec_i", "<<", "tap", "div", "&", "pretty_print", "po", "clone", ">>", "public_methods", "__send__", "object_id", "instance_var iable_defined?", "equal?", "freeze", "to_sym", "*", "ord", "+", "extend", "next", "pretty_print_cycle", "send", "round", "methods", "prec_f", "-", "even?",s ingleton_method_added", "divmod", "hash", "/", "integer?", "downto", "poc", "dup", "to_enum", "instance_variables", "|", "eql?", "size", "id", "instance_eva l", "truncate", "~", "to_i", "singleton_methods", "modulo", "taint", "zero?", "times", "instance_variable_get", "frozen?", "enum_for", "display", "instance_ of?", "^", "method", "to_a", "+@", "pretty_print_inspect", "-@", "quo", "instance_exec", "type", "**", "upto", "to_f", "<", "step", "protected_methods", "<= >", "between?", "==", "remainder", ">", "===", "ri", "to_int", "nonzero?", "pred", "instance_variable_set", "coerce", "respond_to?", "kind_of?", "floor", "s ucc", ">=", "prec", "to_s", "<=", "pretty_inspect", "fdiv", "class", "private_methods", "=~", "tainted?", "__id__", "abs", "untaint", "nil?", "chr", "pretty _print_instance_variables", "id2name", "is_a?", "ceil", "[]"]
Waseem 1:18 pm on November 13, 2011 Permalink |
You should give a shot to pry[1]. It’s quite impressive.
[1]: http://pry.github.com/
tuxdna 1:33 pm on November 13, 2011 Permalink |
Yes, I tried that too. Pry has a whole list of features that don’t work for me for some reason. I guess IRB is enough for me right now
banister 7:32 am on November 14, 2011 Permalink
Hi,
If some pry features are not working for you could you file issues here: https://github.com/pry/pry/issues
thanks