Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FSSM::Pathname.segments method to work correctly. #44

Closed
wants to merge 1 commit into from
Closed

Fixed FSSM::Pathname.segments method to work correctly. #44

wants to merge 1 commit into from

Conversation

kou1okada
Copy link

Maybe, this problem occurs only under the cygwin environment.
The FSSM::Pathname.segments method did not work correctly. Therefore reconnection with join method failed to insert File::SEPARATOR into between each segment.

This problem makes failure for watch sub-command of compress.

before:

FSSM::Pathname.for("/tmp/foo").segments
# => ["//", "tmp", "foo"]
FSSM::Pathname.for("/tmp/foo").join("bar")
# => #<Pathname:/tmp/foo/bar>
# OK, no problem. But a result of segments is a little bit strange.

FSSM::Pathname.for("//host/share/foo").segments
# => ["//", "host", "share", "foo"]
FSSM::Pathname.for("//host/share/foo").join("bar")
# => #<Pathname://host/share/foo/bar>
# OK, no problem. But a result of segments is a little bit strange.

cache = FSSM::Tree::Cache.new
# => #<FSSM::Tree::Cache:0x00000600730888 @children={}>
cache.set "/tmp/foo"
# => 2014-02-13 23:20:19 +0900
cache.files
# => {"//tmpfoo"=>2014-02-13 23:20:19 +0900}
# Oops!!! The path is corrupted. It's a problem!!!

after:

FSSM::Pathname.for("/tmp/foo").segments
# => ["/", "tmp", "foo"]
FSSM::Pathname.for("/tmp/foo").join("bar")
# => #<Pathname:/tmp/foo/bar>
# OK, no problem. A result of segments is also reasonable.

FSSM::Pathname.for("//host/share/foo").segments
# => ["//host/share", "foo"]
FSSM::Pathname.for("//host/share/foo").join("bar")
# => #<Pathname://host/share/foo/bar>
# OK, no problem. A result of segments is also reasonable.

cache = FSSM::Tree::Cache.new
# => #<FSSM::Tree::Cache:0x00000600272878 @children={}>
cache.set "/tmp/foo"
# => 2014-02-13 23:20:19 +0900
cache.files
# => {"/tmp/foo"=>2014-02-13 23:20:19 +0900}
# OK, fixed a problem.

Maybe, this problem occurs only under the cygwin environment.
The FSSM::Pathname.segments method did not work correctly. Therefore reconnection with join method failed to insert File::SEPARATOR into between each segment.

This problem makes failure for watch sub-command of compress.

before:

    FSSM::Pathname.for("/tmp/foo").segments
    # => ["//", "tmp", "foo"]
    FSSM::Pathname.for("/tmp/foo").join("bar")
    # => #<Pathname:/tmp/foo/bar>
    # OK, no problem. But a result of segments is a little bit strange.

    FSSM::Pathname.for("//host/share/foo").segments
    # => ["//", "host", "share", "foo"]
    FSSM::Pathname.for("//host/share/foo").join("bar")
    # => #<Pathname://host/share/foo/bar>
    # OK, no problem. But a result of segments is a little bit strange.

    cache = FSSM::Tree::Cache.new
    # => #<FSSM::Tree::Cache:0x00000600730888 @children={}>
    cache.set "/tmp/foo"
    # => 2014-02-13 23:20:19 +0900
    cache.files
    # => {"//tmpfoo"=>2014-02-13 23:20:19 +0900}
    # Oops!!! The path is corrupted. It's a problem!!!

after:

    FSSM::Pathname.for("/tmp/foo").segments
    # => ["/", "tmp", "foo"]
    FSSM::Pathname.for("/tmp/foo").join("bar")
    # => #<Pathname:/tmp/foo/bar>
    # OK, no problem. A result of segments is also reasonable.

    FSSM::Pathname.for("//host/share/foo").segments
    # => ["//host/share", "foo"]
    FSSM::Pathname.for("//host/share/foo").join("bar")
    # => #<Pathname://host/share/foo/bar>
    # OK, no problem. A result of segments is also reasonable.

    cache = FSSM::Tree::Cache.new
    # => #<FSSM::Tree::Cache:0x00000600272878 @children={}>
    cache.set "/tmp/foo"
    # => 2014-02-13 23:20:19 +0900
    cache.files
    # => {"/tmp/foo"=>2014-02-13 23:20:19 +0900}
    # OK, fixed a problem.
@kou1okada kou1okada closed this Feb 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant