Class: Amp::Core::Repositories::AbstractVersionedFile

Inherits:
Object
  • Object
show all
Includes:
CommonVersionedFileMethods
Defined in:
lib/amp-core/repository/abstract/abstract_versioned_file.rb

Instance Method Summary collapse

Methods included from CommonVersionedFileMethods

#===, #branch, #children, #clean?, #date, #description, #unified_diff_with, #user

Instance Method Details

#==(vfile) ⇒ Boolean

Are two versioned files the same? This means same path and revision indexes.

Parameters:

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


102
103
104
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 102

def ==(vfile)
  raise NotImplementedError.new("==() must be implemented by subclasses of AbstractVersionedFile.")
end

#changesetAbstractChangeset

The changeset to which this versioned file belongs.

Returns:

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 25

def changeset
  raise NotImplementedError.new("changeset() must be implemented by subclasses of AbstractVersionedFile.")
end

#cmp(item) ⇒ Boolean

Compares to either a bit of text or another versioned file. Returns true if different, false for the same. (much like <=> == 0 for the same)

Parameters:

Returns:

  • (Boolean)

    true if different, false if same.

Raises:

  • (NotImplementedError)


93
94
95
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 93

def cmp(item)
  raise NotImplementedError.new("cmp() must be implemented by subclasses of AbstractVersionedFile.")
end

#dataString

The contents of a file at the given revision

Returns:

  • (String)

    the data at the current revision

Raises:

  • (NotImplementedError)


68
69
70
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 68

def data
  raise NotImplementedError.new("data() must be implemented by subclasses of AbstractVersionedFile.")
end

#flagsString

Gets the flags for this file (‘x’, ‘l’, or ”)

Returns:

  • (String)

    ‘x’, ‘l’, or ”

Raises:

  • (NotImplementedError)


110
111
112
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 110

def flags
  raise NotImplementedError.new("flags() must be implemented by subclasses of AbstractVersionedFile.")
end

#hashInteger

The hash value for sticking this fucker in a hash.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


76
77
78
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 76

def hash
  raise NotImplementedError.new("hash() must be implemented by subclasses of AbstractVersionedFile.")
end

#pathString

The path to this file

Returns:

  • (String)

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 42

def path
  raise NotImplementedError.new("path() must be implemented by subclasses of AbstractVersionedFile.")
end

#renamed?Boolean

Has this file been renamed? If so, return some useful info

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


82
83
84
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 82

def renamed?
  raise NotImplementedError.new("renamed() must be implemented by subclasses of AbstractVersionedFile.")
end

#repoAbstractLocalRepository Also known as: repository

The repo to which this VersionedFile belongs

Returns:

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 33

def repo
  raise NotImplementedError.new("repo() must be implemented by subclasses of AbstractVersionedFile.")
end

#revisionInteger

The revision of the file. This can be vague, so let me explain: This is the revision of the repo from which this VersionedFile is. If this is unclear, please submit a patch fixing it.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 52

def revision
  raise NotImplementedError.new("revision() must be implemented by subclasses of AbstractVersionedFile.")
end

#sizeInteger

The size of this file

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


60
61
62
# File 'lib/amp-core/repository/abstract/abstract_versioned_file.rb', line 60

def size
  raise NotImplementedError.new("size() must be implemented by subclasses of AbstractVersionedFile.")
end