Created
April 22, 2015 08:20
-
-
Save palkan/7f50407612fb351eab08 to your computer and use it in GitHub Desktop.
Pry $LOAD_PATH hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add the current directories /lib and /spec directories to the path if they exist | |
Pry.config.hooks.add_hook(:before_session, :load_path) do | |
dir = `pwd`.chomp | |
%w(lib spec test).map{ |d| "#{dir}/#{d}" }.each { |p| $: << p unless !File.exist?(p) || $:.include?(p) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment