Class: Perforce2Svn::Perforce::PerforceCommit
- Inherits:
-
Object
- Object
- Perforce2Svn::Perforce::PerforceCommit
- Includes:
- Logging
- Defined in:
- lib/perforce2svn/perforce/commit_builder.rb
Overview
The standard commit message
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(revision, author, message, time, files) ⇒ PerforceCommit
constructor
A new instance of PerforceCommit.
- #log! ⇒ Object
- #to_s ⇒ Object
Methods included from Logging
Constructor Details
#initialize(revision, author, message, time, files) ⇒ PerforceCommit
Returns a new instance of PerforceCommit.
15 16 17 18 19 20 21 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 15 def initialize(revision, , , time, files) @author = @revision = revision @message = @time = time @files = files end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
13 14 15 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 13 def @author end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
13 14 15 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 13 def files @files end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 13 def @message end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
13 14 15 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 13 def revision @revision end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
13 14 15 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 13 def time @time end |
Instance Method Details
#log! ⇒ Object
23 24 25 26 27 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 23 def log! to_s.each_line do |line| log.info line.chomp end end |
#to_s ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/perforce2svn/perforce/commit_builder.rb', line 29 def to_s header = <<EOF ================================================================ Perforce Revision: #{revision} Time: #{time} User: #{} Message: EOF @message.each_line do |line| header << " #{line}" end header << "\nTotal Files: #{@files.length}\n" @files.each do |file| header << " #{file}\n" end header end |