Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6499af9811
Fetching contributors…

Cannot retrieve contributors at this time

93 lines (76 sloc) 1.597 kb
#
# See also:
#
# http://dotfiles.org/~sd/.irbrc
#
puts "Loading #{__FILE__}..."
require 'rubygems' rescue nil
#
# http://stackoverflow.com/questions/80091/diff-a-ruby-string-or-array
#
begin
require 'diffy'
Diffy::Diff.default_format = :color
rescue LoadError
# noop in case we cannot load the gem
end
#
# http://pablotron.org/software/wirble/README
#
begin
require 'wirble'
Wirble.init(
:history_size => 4096
)
Wirble.colorize
rescue LoadError
# noop in case we cannot load the gem
end
#
# http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html
#
begin
require 'hirb'
Hirb::View.enable
rescue LoadError
# noop in case we cannot load the gem
end
#
# https://github.com/citizen428/methodfinder
#
begin
require 'methodfinder'
class Object
# Find the methods that return the given result
def method_finder(result)
MethodFinder.find(self, result)
end
end
rescue LoadError
# noop in case we cannot load the gem
end
#
# http://stackoverflow.com/questions/123494/whats-your-favourite-irb-trick
#
class Object
# Return only the methods not present on basic objects
def interesting_methods
(self.methods - Object.new.methods).sort
end
end
class Array
# Returns a columnated version of the array's elements
def columnate
`echo "#{self.join("\n")}" | column`
end
end
#
# Advanced Rails Recipes - recipe 37
#
begin
load File.join(File.dirname(__FILE__), '.railsrc') if defined? Rails or ENV['RAILS_ENV']
rescue LoadError
# NOOP... it's OK if the file doesn't exist
end
# vim:syntax=ruby
# That's all, Folks!
Jump to Line
Something went wrong with that request. Please try again.