$LOAD_PATH.push('/Users/edipofederle/work/requires')
load('load.rb')
$LOAD_PATH.push('/Users/edipofederle/work/requires')
require('load') # first time will executed
require('load') # second time will NOT executed
falar sobre"
$LOADED_FEATURES - ruby keep tracked the fiiles already loaded here
NO NEED extension - THIS IS SHOW RUBY LOAD THE C Code
In ~/work
load('/Users/edipofederle/work/requires/foo.rb')
depois mudar require de foo.rb
no bar.rb
para require_relative
This Rubygems code actually replaces the default require method with its own version. That version will look through your installed gems in addition to the directories in $LOAD_PATH. If Rubygems finds the file in your gems, it will add that gem to your $LOAD_PATH:
puts $LOAD_PATH.grep(/json/)
JSO
puts $LOADED_FEATURES.grep(/json/)