rails/spring — pull request #313 by rubemz (2014-06-13 12:56:24+00:00)
Title: fix the listen watcher

Fix the listen watcher listening directories with a path that starts with the same substring than the root path. Before this fix, if a given directory had a path that starts equal to the root path, it would discard it thinking it would be a root subdirectory.

For example, the root path is a Rails app at **~/source/app** and I also wanted to listen changes in another directory (that is a dependency) located at **~/source/app**_core.

However, the listen watcher wasn't listening the **~/source/app**_core because this [logic](https://github.com/rails/spring/blob/master/lib/spring/watcher/listen.rb#L46-L47) checks if a given directory matches the beginning of the root path and not listening that.

This PR fixes it by correctly checking if a given directory is a subdirectory of the root directory and avoiding mistakes as described before.