In a gemspec, I can specify the require_paths
, which represent paths I want to be able to require from at runtime. These get put into the $LOAD_PATH
by RubyGems.
My question is: is there a way I can determine what these paths are at runtime? Can I examine elements of $LOAD_PATH
and know which ones were added just for my gem?
Update: Ultimately, I would like to dynamically load ruby files from inside the gem, e.g.
load_from 'foo/bar'
And have that find $MY_GEMS_LIB_DIR/foo/bar/*.rb
. I can certainly go through the entire $LOAD_PATH
looking for foo/bar
, but I'd rather restrict it just to the gem.