Class: PVN::Diff::Path
- Inherits:
-
Object
- Object
- PVN::Diff::Path
- Includes:
- Logue::Loggable
- Defined in:
- lib/pvn/diff/path.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #add_change(rev, action) ⇒ Object
-
#initialize(name, revision, action, url) ⇒ Path
constructor
that’s the root url.
- #run_diff(displaypath, fromlines, fromrev, tolines, torev, whitespace) ⇒ Object
- #to_revision(rev) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, revision, action, url) ⇒ Path
that’s the root url
18 19 20 21 22 23 |
# File 'lib/pvn/diff/path.rb', line 18 def initialize name, revision, action, url @name = name @changes = Array.new add_change revision, action @url = url end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
15 16 17 |
# File 'lib/pvn/diff/path.rb', line 15 def changes @changes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/pvn/diff/path.rb', line 13 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
14 15 16 |
# File 'lib/pvn/diff/path.rb', line 14 def url @url end |
Instance Method Details
#<=>(other) ⇒ Object
44 45 46 |
# File 'lib/pvn/diff/path.rb', line 44 def <=> other name <=> other.name end |
#add_change(rev, action) ⇒ Object
25 26 27 |
# File 'lib/pvn/diff/path.rb', line 25 def add_change rev, action @changes << Change.new(to_revision(rev), action) end |
#run_diff(displaypath, fromlines, fromrev, tolines, torev, whitespace) ⇒ Object
35 36 37 38 |
# File 'lib/pvn/diff/path.rb', line 35 def run_diff displaypath, fromlines, fromrev, tolines, torev, whitespace ds = DiffSet.new displaypath, fromlines, fromrev, tolines, torev, whitespace ds.run_diff end |
#to_revision(rev) ⇒ Object
29 30 31 32 33 |
# File 'lib/pvn/diff/path.rb', line 29 def to_revision rev # or should we convert this to Revision::Argument, and @revisions is # Revision::Range? rev.kind_of?(Fixnum) ? rev.to_s : rev end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/pvn/diff/path.rb', line 40 def to_s "#{name}; #{url}" end |