Created
January 19, 2012 17:06
-
-
Save rwjblue/1641209 to your computer and use it in GitHub Desktop.
Reload all ruby files in the given directory (defaults to Dir.pwd) that have been loaded.
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
Pry.config.commands.command "reload", "Reload all ruby files in the given directory (defaults to Dir.pwd) that have been loaded." do |*args| | |
args = [Dir.pwd] if args.empty? | |
$LOADED_FEATURES.each do |feature| | |
if args.any?{|dir| feature =~ /#{dir}/} && feature.end_with?('.rb') | |
load feature | |
output.puts "Reloaded: #{feature}." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment