Class: Distillery::ROM::Path Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/distillery/rom/path.rb,
lib/distillery/rom/path/file.rb,
lib/distillery/rom/path/archive.rb,
lib/distillery/rom/path/virtual.rb

Overview

This class is abstract.

Abstract class used for ROM path

Direct Known Subclasses

Archive, File, Virtual

Defined Under Namespace

Classes: Archive, File, Virtual

Instance Method Summary collapse

Instance Method Details

#basenameString

Get path basename

Returns:

  • (String)

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/distillery/rom/path.rb', line 48

def basename
    raise NotImplementedError
end

#copy(to, length = nil, offset = 0, force: false, link: :hard) ⇒ Boolean

Copy ROM content to the filesystem, possibly using link if requested.

Parameters:

  • to (String)

    file destination

  • length (Integer, nil) (defaults to: nil)

    data length to be copied

  • offset (Integer) (defaults to: 0)

    data offset

  • force (Boolean) (defaults to: false)

    remove previous file if necessary

  • link (:hard, :sym, nil) (defaults to: :hard)

    use link instead of copy if possible

Returns:

  • (Boolean)

    status of the operation

Raises:

  • (NotImplementedError)


75
76
77
# File 'lib/distillery/rom/path.rb', line 75

def copy(to, length = nil, offset = 0, force: false, link: :hard)
    raise NotImplementedError
end

#delete!Boolean

Delete physical content.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


98
99
100
# File 'lib/distillery/rom/path.rb', line 98

def delete!
    raise NotImplementedError
end

#entryString

Entry

Returns:

  • (String)

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/distillery/rom/path.rb', line 39

def entry
    raise NotImplementedError
end

#fileString

File directly accessible on the file system

Returns:

  • (String)

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/distillery/rom/path.rb', line 21

def file
    raise NotImplementedError
end

#reader {|io| ... } ⇒ Object

Note:

Can be costly, prefer existing #copy if possible

ROM reader

Yield Parameters:

  • io (#read)

    stream for reading

Returns:

  • block value

Raises:

  • (NotImplementedError)


60
61
62
# File 'lib/distillery/rom/path.rb', line 60

def reader(&block)
    raise NotImplementedError
end

#rename(path, force: false) ⇒ Boolean

Note:

Renaming could lead to silent removing if same ROM is on its way

Rename ROM and physical content.

Parameters:

  • path (String)

    new ROM path

  • force (Boolean) (defaults to: false)

    remove previous file if necessary

Returns:

  • (Boolean)

    status of the operation

Raises:

  • (NotImplementedError)


89
90
91
# File 'lib/distillery/rom/path.rb', line 89

def rename(path, force: false)
    raise NotImplementedError
end

#storageString

File or directory that is considered the storage space for entries

Returns:

  • (String)

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/distillery/rom/path.rb', line 30

def storage
    raise NotImplementedError
end

#to_sString

Path value as string.

Returns:

  • (String)

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/distillery/rom/path.rb', line 13

def to_s
    raise NotImplementedError
end