Created
October 15, 2014 17:39
-
-
Save wmene/db7bfce59ea8463739e5 to your computer and use it in GitHub Desktop.
For a rails project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pry.prompt = [proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} Pry > " }, proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }] | |
#%w{map_by_method hirb}.each { |gem| require gem } | |
# 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 | |
# loading rails configuration if it is running as a rails console | |
load File.dirname(__FILE__) + '/.railsrc' if defined?(Rails) && Rails.env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment