Class RSCM::RevisionFile
In: lib/rscm/revision_file.rb
Parent: Object

Represents a file within a Revision, and also information about how this file was modified compared with the previous revision.

Methods

==   accept   diff   new   open   to_s  

Constants

MODIFIED = "MODIFIED"
DELETED = "DELETED"
ADDED = "ADDED"
MOVED = "MOVED"

Attributes

developer  [RW]  The developer who modified this file
message  [RW]  The commit message for this file
native_revision_identifier  [RW]  The native SCM’s revision for this file. For non-transactional SCMs this is different from the parent Revision’s
path  [RW]  Relative path from the root of the RSCM::Base instance
previous_native_revision_identifier  [RW]  The native SCM’s previous revision for this file. For non-transactional SCMs this is different from the parent Revision’s
status  [RW]  MODIFIED, DELETED, ADDED or MOVED
time  [RW]  This is a UTC ruby time

Public Class methods

[Source]

    # File lib/rscm/revision_file.rb, line 34
34:     def initialize(path=nil, status=nil, developer=nil, message=nil, native_revision_identifier=nil, time=nil)
35:       @path, @developer, @message, @native_revision_identifier, @time, @status = path, developer, message, native_revision_identifier, time, status
36:     end

Public Instance methods

[Source]

    # File lib/rscm/revision_file.rb, line 59
59:     def ==(other)
60:       return false if !other.is_a?(self.class)
61:       self.path == other.path &&
62:       self.developer == other.developer &&
63:       self.message == other.message &&
64:       self.native_revision_identifier == other.native_revision_identifier &&
65:       self.time == other.time
66:     end

Accepts a visitor that must respond to +visit_file(revision_file)+

[Source]

    # File lib/rscm/revision_file.rb, line 50
50:     def accept(visitor)
51:       visitor.visit_file(self)
52:     end

Yields the diff as an IO for this file

[Source]

    # File lib/rscm/revision_file.rb, line 45
45:     def diff(scm, &block)
46:       scm.diff(self, &block)
47:     end

Returns/yields an IO containing the contents of this file, using the scm this file lives in.

[Source]

    # File lib/rscm/revision_file.rb, line 40
40:     def open(scm, &block) #:yield: io
41:       scm.open(self, &block)
42:     end

A simple string representation. Useful for debugging.

[Source]

    # File lib/rscm/revision_file.rb, line 55
55:     def to_s
56:       "#{path} | #{native_revision_identifier}"
57:     end

[Validate]