Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pry & ap

  • Loading branch information...
commit e24ec3541736f430e3606b2584a5aaac68077c02 1 parent 20aee4d
@korin authored
Showing with 18 additions and 8 deletions.
  1. +2 −1  .aprc
  2. +16 −7 .pryrc
View
3  .aprc
@@ -1,3 +1,4 @@
AwesomePrint.defaults = {
- :indent => 2
+ :indent => -2,
+ :limit => true
}
View
23 .pryrc
@@ -1,16 +1,26 @@
require "rubygems"
-require "awesome_print"
-Pry.print = proc { |output, value| output.puts value.ai }
+begin
+ require "awesome_print"
+ Pry.config.print = proc { |output, value| output.puts value.ai }
+rescue LoadError => err
+ warn "Couldn't load awesome_print: #{err}"
+end
-require 'hirb'
+begin
+ require 'hirb'
-Hirb.enable
+ Hirb.enable
-Pry.config.print = proc do |output, value|
- Hirb::View.view_or_page_output(value) || Pry::DEFAULT_PRINT.call(output, value)
+ old_print = Pry.config.print
+ Pry.config.print = proc do |output, value|
+ Hirb::View.view_or_page_output(value) || old_print.call(output, value)
+ end
+rescue LoadError => err
+ warn "Couldn't load Hirb: #{err}"
end
+
# vim FTW
Pry.config.editor = "gvim --nofork"
@@ -21,7 +31,6 @@ Pry.prompt = [proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} >
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead.
# If you don't, you can load it through the lines below :)
rails = File.join Dir.getwd, 'config', 'environment.rb'
-
if File.exist?(rails) && ENV['SKIP_RAILS'].nil?
require rails
Please sign in to comment.
Something went wrong with that request. Please try again.