Class: Amp::Repositories::AbstractVersionedFile

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

Direct Known Subclasses

Git::VersionedFile, Mercurial::VersionedFile

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:

Raises:

  • (NotImplementedError)


87
88
89
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 87

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)


10
11
12
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 10

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)


78
79
80
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 78

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)


53
54
55
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 53

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)


95
96
97
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 95

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:

Raises:

  • (NotImplementedError)


61
62
63
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 61

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

#pathString

The path to this file

Returns:

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 27

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:

Raises:

  • (NotImplementedError)


67
68
69
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 67

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)


18
19
20
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 18

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:

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 37

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

#sizeInteger

The size of this file

Returns:

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/amp/repository/abstract/abstract_versioned_file.rb', line 45

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