Skip to content

Instantly share code, notes, and snippets.

@robmerrell
Created November 30, 2009 07:44
Show Gist options
  • Save robmerrell/245314 to your computer and use it in GitHub Desktop.
Save robmerrell/245314 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