Sha256: 9db439f21de85deb842292ac906d85f0253e5ac26bf39d462124f79a9b58b703

Contents?: true

Size: 610 Bytes

Versions: 19

Compression:

Stored size: 610 Bytes

Contents

module FakeFS
  # Fake symlink class
  class FakeSymlink
    attr_accessor :name, :target, :parent

    def initialize(target)
      @target = target
    end

    def inspect
      "symlink(#{name} -> #{target.split('/').last})"
    end

    def entry
      FileSystem.find(target)
    end

    def delete
      parent.delete(self)
    end

    def to_s
      File.join(parent.to_s, name)
    end

    def respond_to?(method, include_private = false)
      entry.respond_to?(method, include_private)
    end

    private

    def method_missing(*args, &block)
      entry.send(*args, &block)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
fakefs-0.11.2 lib/fakefs/fake/symlink.rb
fakefs-0.11.1 lib/fakefs/fake/symlink.rb
fakefs-0.11.0 lib/fakefs/fake/symlink.rb
fakefs-0.10.2 lib/fakefs/fake/symlink.rb
fakefs-0.10.1 lib/fakefs/fake/symlink.rb
fakefs-0.10.0 lib/fakefs/fake/symlink.rb
fakefs-0.9.3 lib/fakefs/fake/symlink.rb
fakefs-0.9.2 lib/fakefs/fake/symlink.rb
fakefs-0.9.1 lib/fakefs/fake/symlink.rb
fakefs-0.9.0 lib/fakefs/fake/symlink.rb
fakefs-0.8.1 lib/fakefs/fake/symlink.rb
fakefs-0.8.0 lib/fakefs/fake/symlink.rb
fakefs-0.7.0 lib/fakefs/fake/symlink.rb
fakefs-0.6.7 lib/fakefs/fake/symlink.rb
fakefs-0.6.5 lib/fakefs/fake/symlink.rb
fakefs-0.6.4 lib/fakefs/fake/symlink.rb
fakefs-0.6.3 lib/fakefs/fake/symlink.rb
fakefs-0.6.1 lib/fakefs/fake/symlink.rb
fakefs-0.6.0 lib/fakefs/fake/symlink.rb