Class: RSCM::RevisionFile
- 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
-
#developer ⇒ Object
Returns the value of attribute developer.
-
#message ⇒ Object
Returns the value of attribute message.
-
#native_revision_identifier ⇒ Object
The native SCM’s revision for this file.
-
#path ⇒ Object
Returns the value of attribute path.
-
#previous_native_revision_identifier ⇒ Object
Returns the value of attribute previous_native_revision_identifier.
-
#scm ⇒ Object
Returns the value of attribute scm.
-
#status ⇒ Object
Returns the value of attribute status.
-
#time ⇒ Object
This is a UTC ruby time.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #accept(visitor) ⇒ Object
-
#initialize(path = nil, status = nil, developer = nil, message = nil, native_revision_identifier = nil, time = nil) ⇒ RevisionFile
constructor
A new instance of RevisionFile.
-
#open(scm, &block) ⇒ Object
Returns/yields an IO containing the contents of this file, using
scm
this file lives in. - #to_s ⇒ Object
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, =nil, native_revision_identifier=nil, time=nil) @path, @developer, @message, @native_revision_identifier, @time, @status = path, developer, , native_revision_identifier, time, status end |
Instance Attribute Details
#developer ⇒ Object
Returns the value of attribute developer.
19 20 21 |
# File 'lib/rscm/revision_file.rb', line 19 def developer @developer end |
#message ⇒ Object
Returns the value of attribute message.
20 21 22 |
# File 'lib/rscm/revision_file.rb', line 20 def @message end |
#native_revision_identifier ⇒ Object
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 |
#path ⇒ Object
Returns the value of attribute path.
13 14 15 |
# File 'lib/rscm/revision_file.rb', line 13 def path @path end |
#previous_native_revision_identifier ⇒ Object
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 |
#scm ⇒ Object
Returns the value of attribute scm.
23 24 25 |
# File 'lib/rscm/revision_file.rb', line 23 def scm @scm end |
#status ⇒ Object
Returns the value of attribute status.
12 13 14 |
# File 'lib/rscm/revision_file.rb', line 12 def status @status end |
#time ⇒ Object
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. == other. && 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_s ⇒ Object
39 40 41 |
# File 'lib/rscm/revision_file.rb', line 39 def to_s "#{path} | #{native_revision_identifier}" end |