Created
May 14, 2018 08:44
-
-
Save sugamasao/4224f8ecfa99a72b7cd07183e0a340f5 to your computer and use it in GitHub Desktop.
requireしたファイルと現実のファイルの差分を得る
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
# こんな感じでいけそうなんだけど、どうか | |
at_exit { | |
path = File.join(File.expand_path(__dir__)) | |
require_files = $LOADED_FEATURES.select{|f| f.start_with?(path)} | |
files = Dir.glob("./**/*.rb").map{|f| File.expand_path(f)}.select{|f| f.start_with?(path)} | |
diff = files - require_files | |
puts "*** not required files(#{ diff.size }) ***" | |
puts diff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment