Permalink
Browse files

[add] Adding pryrc

  • Loading branch information...
1 parent ac4a669 commit 1829c602d909fae1c3e08c61e7481a57c6e32eb7 @filipeamoreira committed Mar 8, 2012
Showing with 48 additions and 39 deletions.
  1. +7 −21 _irbrc
  2. +3 −0 _npmrc
  3. +2 −0 _profile
  4. +30 −0 _pryrc
  5. +6 −18 _zshrc
View
28 _irbrc
@@ -1,21 +1,7 @@
-# require 'irb/completion'
-# require 'irb/ext/save-history'
-# require 'wirble'
-# Wirble.init
-# Wirble.colorize
-
-# IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
-# IRB.conf[:SAVE_HISTORY] = 1000
-
-
-# class Array
-# def self.toy(n=10,&block)
-# block_given? ? Array.new(n,&block) : Array.new(n) {|i| i+1}
-# end
-# end
-
-# class Hash
-# def self.toy(n=10)
-# Hash[Array.toy(n).zip(Array.toy(n){|c| (96+(c+1)).chr})]
-# end
-# end
+begin
+ require 'pry'
+ Pry.start
+ exit
+rescue LoadError => e
+ warn "=> Unable to load pry"
+end
View
3 _npmrc
@@ -0,0 +1,3 @@
+globalconfig = "/usr/local/etc/npmrc"
+globalignorefile = "/usr/local/etc/npmignore"
+
View
2 _profile
@@ -21,3 +21,5 @@ if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
+export RUBYLIB="/usr/local/lib:$RUBYLIB"
+
View
30 _pryrc
@@ -0,0 +1,30 @@
+# Pry.config.editor = "mate -w"
+
+Pry.config.prompt = proc do |obj, level, _|
+ prompt = ""
+ prompt << "#{Rails.version}@" if defined?(Rails)
+ prompt << "#{RUBY_VERSION}"
+ "#{prompt} (#{obj})> "
+end
+
+Pry.config.exception_handler = proc do |output, exception, _|
+ output.puts "\e[31m#{exception.class}: #{exception.message}"
+ output.puts "from #{exception.backtrace.first}\e[0m"
+end
+
+if defined?(Rails)
+ begin
+ require "rails/console/app"
+ require "rails/console/helpers"
+ rescue LoadError => e
+ require "console_app"
+ require "console_with_helpers"
+ end
+end
+
+begin
+ require "awesome_print"
+ Pry.config.print = proc {|output, value| Pry::Helpers::BaseHelpers.stagger_output("=> #{value.ai}", output)}
+rescue LoadError => err
+ warn "=> Unable to load awesome_print"
+end
View
24 _zshrc
@@ -4,29 +4,15 @@ export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
-# time that oh-my-zsh is loaded.
-# export ZSH_THEME="robbyrussell"
-#export ZSH_THEME="bira"
-# export ZSH_THEME="jreese"
-
-# export ZSH_THEME="filipeamoreira"
export ZSH_THEME="kennethreitz"
# Set to this to use case-sensitive completion
# export CASE_SENSITIVE="true"
-# Comment this out to disable weekly auto-update checks
-# export DISABLE_AUTO_UPDATE="true"
-
-# Uncomment following line if you want to disable colors in ls
-# export DISABLE_LS_COLORS="true"
+DISABLE_AUTO_UPDATE="true"
-# Uncomment following line if you want to disable autosetting terminal title.
-# export DISABLE_AUTO_TITLE="true"
+DISABLE_AUTO_TITLE="true"
-# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
-# Example format: plugins=(rails git textmate ruby lighthouse)
-# plugins=(git rails3 ruby brew cap github node npm osx pip redis-cli rvm ssh-agent)
plugins=(git compleat rails3 ruby brew github node npm osx pip redis-cli rvm ssh-agent)
source $ZSH/oh-my-zsh.sh
@@ -38,7 +24,9 @@ then
export TERM=xterm-256color
fi
-[[ -s "/Users/guto/.rvm/scripts/rvm" ]] && source "/Users/guto/.rvm/scripts/rvm"
[[ $TERM == eterm-color ]] && export TERM=xterm
+
export NODE_PATH=/usr/local/lib/node_modules
-export PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:$HOME/scm/svn/depot_tools/:$PATH"
+export PATH=$HOME/.rbenv/bin:$HOME/.rbenv/shims:$HOME/bin:/usr/local/bin:/usr/local/sbin:$HOME/scm/svn/depot_tools/:/usr/local/n/current/bin:$PATH
+eval "$(rbenv init -)"
+

0 comments on commit 1829c60

Please sign in to comment.