Sha256: c7413405bd55acee98e1b63c58490c25d764bc05deeb36e453099056724a094f

Contents?: true

Size: 527 Bytes

Versions: 13

Compression:

Stored size: 527 Bytes

Contents

class String
  def to_entry_on driver = nil
    path = self
    driver ||= Vfs.default_driver

    path = "./#{path}" unless path =~ /^[\/\.\~]/
    Vfs::Entry.new(driver, path).entry
  end
  alias_method :to_entry, :to_entry_on

  def to_file_on driver = nil
    to_entry_on(driver).file
  end
  alias_method :to_file, :to_file_on

  def to_dir_on driver = nil
    to_entry_on(driver).dir
  end
  alias_method :to_dir, :to_dir_on
end

class File
  def to_entry
    path.to_entry
  end

  def to_file
    path.to_file
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

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