Permalink
Browse files

( ꒪⌓꒪) Add .pryrc ██████████████████████

  • Loading branch information...
1 parent 7b983c5 commit 3220a6494e9b7147f4337c9b113d9a973ee7f4a7 @yuroyoro committed Oct 12, 2012
Showing with 34 additions and 1 deletion.
  1. +33 −0 .pryrc
  2. +1 −1 setup.sh
View
33 .pryrc
@@ -0,0 +1,33 @@
+begin
+ require 'awesome_print'
+ Pry.config.print = proc { |output, value| output.puts value.ai }
+rescue LoadError => err
+ puts "no awesome_print :("
+end
+
+begin
+ require 'hirb'
+rescue LoadError
+ # Missing goodies, bummer
+ puts "no hirb :("
+end
+
+if defined? Hirb
+ # Slightly dirty hack to fully support in-session Hirb.disable/enable toggling
+ Hirb::View.instance_eval do
+ def enable_output_method
+ @output_method = true
+ @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
+ end
+
+ def disable_output_method
+ Pry.config.print = @old_print
+ @output_method = nil
+ end
+ end
+
+ Hirb.enable
+end
View
@@ -1,6 +1,6 @@
#!/bin/bash
-DOT_FILES=( .zsh .zshrc .zshrc.alias .zshrc.linux .zshrc.osx .ctags .emacs.el .gdbinit .gemrc .gitconfig .gitignore .inputrc .irbrc .sbtconfig .screenrc .vimrc .vrapperrc import.scala .tmux.conf .dir_colors .rdebugrc)
+DOT_FILES=( .zsh .zshrc .zshrc.alias .zshrc.linux .zshrc.osx .ctags .emacs.el .gdbinit .gemrc .gitconfig .gitignore .inputrc .irbrc .sbtconfig .screenrc .vimrc .vrapperrc import.scala .tmux.conf .dir_colors .rdebugrc .pryrc)
for file in ${DOT_FILES[@]}
do

0 comments on commit 3220a64

Please sign in to comment.