Check if something has been required or not
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/require
README.md
require-extra.gemspec

README.md

Additional methods related to #require

You can check if something has been required.

require 'require/extra'
require 'thread'

required? 'thread' # => true

Or you can execute some code when something is required.

require 'require/on'

on_require 'thread' do
  puts 'thread required'
end