Sha256: d6078e1d25a2d09a162fecc8a0fc90c940850ec09077fdb81fb3bd5fc0484ccd

Contents?: true

Size: 561 Bytes

Versions: 13

Compression:

Stored size: 561 Bytes

Contents

module Vfs
  class << self
    def default_driver
      ::Vfs::Drivers::Local.new
    end

    def to_entry
      '/'.to_entry
    end

    def to_file
      to_entry.file
    end

    def to_dir
      to_entry.dir
    end

    # def [] path
    #   to_entry[path]
    # end
    # alias_method :/, :[]

    %w(
      entry dir file
      entries dirs files
      [] /
      tmp
    ).each do |m|
      script = <<-RUBY
        def #{m} *a, &b
          to_entry.#{m} *a, &b
        end
      RUBY
      eval script, binding, __FILE__, __LINE__
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
vfs-0.5.1 lib/vfs/vfs.rb
vfs-0.5.0 lib/vfs/vfs.rb
vfs-momolog-0.0.1 lib/vfs/vfs.rb
vfs-0.4.8 lib/vfs/vfs.rb
vfs-0.4.7 lib/vfs/vfs.rb
vfs-0.4.6 lib/vfs/vfs.rb
vfs-0.4.5 lib/vfs/vfs.rb
vfs-0.4.4 lib/vfs/vfs.rb
vfs-0.4.3 lib/vfs/vfs.rb
vfs-0.4.2 lib/vfs/vfs.rb
vfs-0.4.1 lib/vfs/vfs.rb
vfs-0.4.0 lib/vfs/vfs.rb
io-0.0.1 lib/vfs/vfs.rb