Class: Svnx::Status::Entry
- Inherits:
-
Base::Entry
- Object
- Base::Entry
- Svnx::Status::Entry
- Includes:
- Comparable
- Defined in:
- lib/svnx/status/entry.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#working_copy ⇒ Object
readonly
Returns the value of attribute working_copy.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(xmlelement, rootpath: nil) ⇒ Entry
constructor
A new instance of Entry.
- #set_from_element(elmt) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Base::Entry
#attribute_value, #element_text, #set_attr_var, #set_attr_vars, #set_elmt_var, #set_elmt_vars, #set_var
Constructor Details
#initialize(xmlelement, rootpath: nil) ⇒ Entry
Returns a new instance of Entry.
48 49 50 51 |
# File 'lib/svnx/status/entry.rb', line 48 def initialize xmlelement, rootpath: nil @rootpath = rootpath super xmlelement end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
44 45 46 |
# File 'lib/svnx/status/entry.rb', line 44 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
45 46 47 |
# File 'lib/svnx/status/entry.rb', line 45 def path @path end |
#working_copy ⇒ Object (readonly)
Returns the value of attribute working_copy.
46 47 48 |
# File 'lib/svnx/status/entry.rb', line 46 def working_copy @working_copy end |
Instance Method Details
#<=>(other) ⇒ Object
71 72 73 |
# File 'lib/svnx/status/entry.rb', line 71 def <=> other path <=> other.path end |
#set_from_element(elmt) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/svnx/status/entry.rb', line 53 def set_from_element elmt set_attr_var elmt, 'path' wcstatus = elmt.at_xpath 'wc-status' @name = @path.dup @working_copy = WorkingCopy.new wcstatus if @rootpath # name is prefixed with directory unless '.' is used as the argument @name.sub! Regexp.new('^' + @rootpath), '' end end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/svnx/status/entry.rb', line 67 def to_s " #{@path}: #{@status}" end |