Class: RSCM::RevisionFile

Inherits:
Object show all
Includes:
XMLRPC::Marshallable
Defined in:
lib/rscm/revision_file.rb

Overview

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

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil, status = nil, developer = nil, message = nil, native_revision_identifier = nil, time = nil) ⇒ RevisionFile

Returns a new instance of RevisionFile.



25
26
27
# File 'lib/rscm/revision_file.rb', line 25

def initialize(path=nil, status=nil, developer=nil, message=nil, native_revision_identifier=nil, time=nil)
  @path, @developer, @message, @native_revision_identifier, @time, @status = path, developer, message, native_revision_identifier, time, status
end

Instance Attribute Details

#developerObject

Returns the value of attribute developer.



19
20
21
# File 'lib/rscm/revision_file.rb', line 19

def developer
  @developer
end

#messageObject

Returns the value of attribute message.



20
21
22
# File 'lib/rscm/revision_file.rb', line 20

def message
  @message
end

#native_revision_identifierObject

The native SCM’s revision for this file. For non-transactional SCMs this is different from the parent Revision’s



17
18
19
# File 'lib/rscm/revision_file.rb', line 17

def native_revision_identifier
  @native_revision_identifier
end

#pathObject

Returns the value of attribute path.



13
14
15
# File 'lib/rscm/revision_file.rb', line 13

def path
  @path
end

#previous_native_revision_identifierObject

Returns the value of attribute previous_native_revision_identifier.



14
15
16
# File 'lib/rscm/revision_file.rb', line 14

def previous_native_revision_identifier
  @previous_native_revision_identifier
end

#scmObject

Returns the value of attribute scm.



23
24
25
# File 'lib/rscm/revision_file.rb', line 23

def scm
  @scm
end

#statusObject

Returns the value of attribute status.



12
13
14
# File 'lib/rscm/revision_file.rb', line 12

def status
  @status
end

#timeObject

This is a UTC ruby time



22
23
24
# File 'lib/rscm/revision_file.rb', line 22

def time
  @time
end

Instance Method Details

#==(other) ⇒ Object



68
69
70
71
72
73
74
75
# File 'lib/rscm/revision_file.rb', line 68

def ==(other)
  return false if !other.is_a?(self.class)
  self.path == other.path &&
  self.developer == other.developer &&
  self.message == other.message &&
  self.native_revision_identifier == other.native_revision_identifier &&
  self.time == other.time
end

#accept(visitor) ⇒ Object



35
36
37
# File 'lib/rscm/revision_file.rb', line 35

def accept(visitor)
  visitor.visit_file(self)
end

#open(scm, &block) ⇒ Object

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



31
32
33
# File 'lib/rscm/revision_file.rb', line 31

def open(scm, &block)
  scm.open(self, &block)
end

#to_sObject



39
40
41
# File 'lib/rscm/revision_file.rb', line 39

def to_s
  "#{path} | #{native_revision_identifier}"
end