Skip to content
Browse files

Adds pryrc with Rails integration.

  • Loading branch information...
1 parent bf31010 commit 3abf488d65437f92b529a7153be5619e40cc3e69 @matiaskorhonen committed
Showing with 19 additions and 1 deletion.
  1. +1 −1 install.rb
  2. +18 −0 pryrc
View
2 install.rb
@@ -26,7 +26,7 @@ def symlink_unless_target_exists(source, target)
end
end
-DOTFILES = %w(ackrc gemrc gitignore irbrc vimrc vim zlogin zshrc)
+DOTFILES = %w(ackrc gemrc gitignore irbrc pryrc vimrc vim zlogin zshrc)
HOME = ENV["HOME"]
ZSH_CUSTOM = Dir["oh-my-zsh/custom/*"]
View
18 pryrc
@@ -0,0 +1,18 @@
+# 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'
+ else
+ warn "[WARN] cannot load Rails console commands (Not on Rails2 or Rails3?)"
+ end
+end

0 comments on commit 3abf488

Please sign in to comment.
Something went wrong with that request. Please try again.