Permalink
Browse files

Add pryrc

  • Loading branch information...
sj26 committed Nov 28, 2012
1 parent cd9792f commit a1b2a02e7636082218fb538141ecc35cc89c5b89
Showing with 25 additions and 1 deletion.
  1. +24 −0 .pryrc
  2. +1 −1 move-in
View
24 .pryrc
@@ -0,0 +1,24 @@
+# Load plugins (only those I whitelist)
+Pry.config.should_load_plugins = false
+Pry.plugins["doc"].activate!
+Pry.plugins["git"].activate!
+
+# Launch Pry with access to the entire Rails stack.
+# 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
+
+ if Rails.version[0..0] == "2"
+ require 'console_app'
+ require 'console_with_helpers'
+ elsif Rails.version[0..0] == "3"
+ require 'rails/console/app'
+ require 'rails/console/helpers'
+ extend Rails::ConsoleMethods if Gem::Version.new(Rails.version) >= Gem::Version.new("3.2.0")
+ else
+ warn "[WARN] cannot load Rails console commands (Not on Rails2 or Rails3?)"
+ end
+end
View
@@ -16,7 +16,7 @@ pushd $HOME
git submodule update
popd
- for file in .ackrc .bin .gemrc .gitconfig .gitignore .js .railsrc .tmux.conf .vim .zsh
+ for file in .ackrc .bin .gemrc .gitconfig .gitignore .js .pryrc .railsrc .tmux.conf .vim .zsh
[ -L $file ] || ln -fs .home/$file
for suffix in rc
[ -L .vim$suffix ] || ln -fs .vim/$suffix .vim$suffix

0 comments on commit a1b2a02

Please sign in to comment.