Module | Wirble |
In: |
lib/wirble.rb
|
Wirble: A collection of useful Irb features.
To use, add the following to your ~/.irbrc:
require 'rubygems' require 'wirble' Wirble.init
If you want color in Irb, add this to your ~/.irbrc as well:
Wirble.colorize
Note: I spent a fair amount of time documenting this code in the README. If you‘ve installed via RubyGems, root around your cache a little bit (or fire up gem_server) and read it before you tear your hair out sifting through the code below.
VERSION | = | '0.1.3' |
Enable color results.
# File lib/wirble.rb, line 505 505: def self.colorize(custom_colors = nil) 506: Colorize.enable(custom_colors) 507: end
Load everything except color.
# File lib/wirble.rb, line 512 512: def self.init(opt = nil) 513: # make sure opt isn't nil 514: opt ||= {} 515: 516: # load internal irb/ruby features 517: Internals.init(opt) unless opt && opt[:skip_internals] 518: 519: # load the history 520: History.new(opt) unless opt && opt[:skip_history] 521: 522: # load shortcuts 523: unless opt && opt[:skip_shortcuts] 524: # load ri shortcuts 525: RiShortcut.init 526: 527: # include common shortcuts 528: Object.class_eval { include Shortcuts } 529: end 530: 531: colorize(opt[:colors]) if opt && opt[:init_colors] 532: end