ttilley/fssm — Issue #36: Do not alter $LOAD_PATH from library itself
Author: luislavena
Created: 2012-01-04 20:04:20+00:00
State: open

Hello,

Noticed that by requiring `fssm`, `$LOAD_PATH` gets altered:

https://github.com/ttilley/fssm/blob/master/lib/fssm.rb#L1-2

I've a series of good reasons why you shouldn't alter the LOAD_PATH during a require:

From Sinatra Issue:
https://github.com/sinatra/sinatra/issues/441

> The usage of File.dirname will result in a relative path (./) contrary to a full path in some implementations of Ruby.
>
> Since Ruby 1.9.2, $LOAD_PATH is expanded, which means that it will have to expand the paths over and over again and resolve it prior doing a require.
>
> Please remove those lines, since 99% or use cases are covered by RubyGems (lib directory is already in the $LOAD_PATH and you shouldn't play with it)
>
> `ruby -Ilib ...`
>
> Altering the $LOAD_PATH after RubyGems did for you result in duplicate entries (RubyGems expanded versus non-expanded one)

And from Thin pull request:

https://github.com/macournoyer/thin/pull/80

Thank you.