Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 720 Bytes
# vim FTW
Pry.config.editor = "mvim --servername VIM --remote-tab-silent"
Pry.config.history.file = "~/.history/.irb_history"
# My pry is polite
Pry.config.hooks.add_hook(:when_started, :load_rails) do
self.send(:include, Rails::ConsoleMethods)
end
# Prompt with ruby version
Pry.prompt = [proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]
# Toys methods
# Stealed from https://gist.github.com/807492
class Array
def self.toy(n=10, &block)
block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1}
end
end
class Hash
def self.toy(n=10)
Hash[Array.toy(n).zip(Array.toy(n){|c| (96+(c+1)).chr})]
end
end
Jump to Line
Something went wrong with that request. Please try again.