Sha256: 8feb3db28da3aba5e94e9ac921b57e3d11f53984834e198554e389050c510d55

Contents?: true

Size: 434 Bytes

Versions: 2

Compression:

Stored size: 434 Bytes

Contents

class String
  def to_entry_on storage = nil
    path = self
    storage ||= Vfs.default_storage

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vfs-0.3.15 lib/vfs/integration/string.rb
vfs-0.3.14 lib/vfs/integration/string.rb