Sha256: ca5d96960d83bf2e646e320af340d5c6334174d743e83ac0a982de0be712dd3b

Contents?: true

Size: 591 Bytes

Versions: 15

Compression:

Stored size: 591 Bytes

Contents

module Vfs
  class << self
    def default_storage
      ::Vfs::Storages::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

15 entries across 15 versions & 1 rubygems

Version Path
vfs-0.3.12 lib/vfs/vfs.rb
vfs-0.3.11 lib/vfs/vfs.rb
vfs-0.3.10 lib/vfs/vfs.rb
vfs-0.3.9 lib/vfs/vfs.rb
vfs-0.3.8 lib/vfs/vfs.rb
vfs-0.3.7 lib/vfs/vfs.rb
vfs-0.3.6 lib/vfs/vfs.rb
vfs-0.3.5 lib/vfs/vfs.rb
vfs-0.3.4 lib/vfs/vfs.rb
vfs-0.3.3 lib/vfs/vfs.rb
vfs-0.3.2 lib/vfs/vfs.rb
vfs-0.3.1 lib/vfs/vfs.rb
vfs-0.3 lib/vfs/vfs.rb
vfs-0.2.1 lib/vfs/vfs.rb
vfs-0.2 lib/vfs/vfs.rb