loading/carried_library_features.rb
tests/_examples/loading/carried_library_features.rb in the metorex repository.
p require("nkf")
p require("nkf")
require "json"
p $LOADED_FEATURES.grep(/nkf|json\.rb/).map { |feature| File.basename(feature, ".*") }
p $LOADED_FEATURES.any? { |feature| feature.end_with?("/json.rb") }
Output:
true
false
["nkf", "nkf", "json"]
true