ttilley/fssm — pull request #46 by kou1okada (2014-02-25 03:29:49+00:00)
Title: Bugfix for FSSM::Tree::Cache on UNC.

Maybe, this problem occurs only under the cygwin environment.

Cause of a problem:

Pathname("//host/share").join("hoge.txt")
# => #
Pathname("//host/share/").join("hoge.txt")
# => #

This makes corruption at FSSM::Pathname.for().join() in FSSM::Tree::NodeEnumerable.each().
Therefore FSSM::Tree::Cache.files is not work correctly on UNC.
This patch modifies the behavior as below.

before:

FSSM::Pathname.for("//host/share/hoge.txt").segments
# => ["//host/share", "hoge.txt"]
cache = FSSM::Tree::Cache.new
# => #
cache.set "//host/share/hoge.txt"
# => 2014-02-25 11:38:19 +0900
cache.files
# => {"//host/sharehoge.txt"=>2014-02-25 11:38:19 +0900}

after:

FSSM::Pathname.for("//host/share/hoge.txt").segments
# => ["//host/share/", "hoge.txt"]
cache = FSSM::Tree::Cache.new
# => #
cache.set "//host/share/hoge.txt"
# => 2014-02-25 11:38:19 +0900
cache.files
# => {"//host/share/hoge.txt"=>2014-02-25 11:38:19 +0900}