Skip to content

Instantly share code, notes, and snippets.

@olivierlacan
Forked from renz45/.pryrc
Created January 5, 2012 01:16
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save olivierlacan/1563187 to your computer and use it in GitHub Desktop.
Save olivierlacan/1563187 to your computer and use it in GitHub Desktop.
Pry configuraton
# switch default editor for pry to sublime text
Pry.config.editor = "sublime"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
# use awesome print for all objects in pry
begin
require 'awesome_print'
Pry.config.print = proc { |output, value| output.puts "=> #{ap value}" }
rescue
puts "=> Unable to load awesome_print, please type 'gem install awesome_print' or 'sudo gem install awesome_print'."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment