Skip to content

Commit

Permalink
pry & ap
Browse files Browse the repository at this point in the history
  • Loading branch information
rlisowski committed Jun 21, 2012
1 parent 20aee4d commit e24ec35
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .aprc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
AwesomePrint.defaults = {
:indent => 2
:indent => -2,
:limit => true
}
23 changes: 16 additions & 7 deletions .pryrc
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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

Expand Down

0 comments on commit e24ec35

Please sign in to comment.