Skip to content

Instantly share code, notes, and snippets.

@jteneycke
Forked from straydogstudio/.pryrc
Created May 13, 2013 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jteneycke/5570664 to your computer and use it in GitHub Desktop.
Save jteneycke/5570664 to your computer and use it in GitHub Desktop.
#switch default editor for pry to sublime text
Pry.config.editor = "vim"
#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
#if in bundler, break out, so awesome print doesn't have to be in Gemfile
if defined? Bundler
Gem.post_reset_hooks.reject! { |hook| hook.source_location.first =~ %r{/bundler/} }
Gem::Specification.reset
load 'rubygems/custom_require.rb'
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"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment