Skip to content

Instantly share code, notes, and snippets.

@xta
Forked from olivierlacan/.pryrc
Created January 9, 2013 03:26
Show Gist options
  • Save xta/4490317 to your computer and use it in GitHub Desktop.
Save xta/4490317 to your computer and use it in GitHub Desktop.
# 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