Skip to content

Instantly share code, notes, and snippets.

@voodoo
Forked from robmerrell/irbrc
Created December 3, 2009 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voodoo/247816 to your computer and use it in GitHub Desktop.
Save voodoo/247816 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hirb'
# irb options
IRB.conf[:AUTO_INDENT]=true
# Hirb
Hirb.enable :pager=>false
# make hashes show up as yaml (from the Hirb documentation)
class Hirb::Helpers::Yaml
def self.render(output, options={})
output.to_yaml
end
end
Hirb::View.format_class Hash, :class=>"Hirb::Helpers::Yaml"
# return methods and instance methods of a class
class Object
def my_methods
methods(false).map { |m| "#{name}::#{m}" }.sort + instance_methods(false).sort
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment