This is my .irbrc configuration file
Place it in your home directory (~/.irbrc) or you can symlink it from other folder like this: $ cd ~ (or ‘cd’) $ ln -s folder/where/you/cloned/this/repo/irbrc/dot_irbrc .irbrc
-
rubygems (www.rubygems.com)
-
Wirble (pablotron.org/software/wirble/)
-
pp (www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/pp/rdoc/index.html)
-
irb/ext/save-history (ruby-doc.org/core/files/lib/irb/ext/save-history_rb.html)
-
mush (github.com/rafmagana/mush)
You’ll need to create a file called .irb-save-history in your home directory for this to work
I use a simple prompt for the IRb sessions
IRB.conf = :SIMPLE And a customized one for Rails sessions IRB.conf[:RAILS] = {}
This will print the log in the console.
IRB.conf = Proc.new do
logger = Logger.new(STDOUT)
ActiveRecord::Base.logger = logger …
clear - clear the screen ri - it’s a wrapper to the ri command-line ruby documentation utility
log_ar_to :record - Change the ActiveRecord’s logger to log/record.log log_ac_to :controller - Change the ActiveController’s logger to log/controller.log
Object local_methods - shows the methods of an object getting rid of the Object.instance_methods eigenclass - please read about meta-programming in Ruby to_pboard - “some text”.to_pboard copies “some text” to the Mac OS’s default pasteboard (alias ‘to_pb’) paste - it pastes the content of the Mac OS’s default pasteboard to_find - a wrapper to to_pboard :find ql - do you know the QuickLook feature on Mac OS? well, “path/to/folder_or_image”.ql will show you the folder stats or the image, Ctrl-C will close it
Class class_methods defined_methods - returns a hash with two keys :instance (instance methods) and :class (class methods) metaclass - returns the eigenclass the “include” method is a public one to help to include modules easily.
q => exit cl => clear (helper method)
-
Fork the project.
-
Make your feature addition or bug fix.
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 Rafael Magaña. See LICENSE for details.