Class: Vcs::StatusEntry
- Inherits:
-
Object
- Object
- Vcs::StatusEntry
- Defined in:
- lib/vcs/status.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#cpy ⇒ Object
Returns the value of attribute cpy.
-
#file ⇒ Object
Returns the value of attribute file.
-
#file_st ⇒ Object
Returns the value of attribute file_st.
-
#line ⇒ Object
Returns the value of attribute line.
-
#prop_st ⇒ Object
Returns the value of attribute prop_st.
Instance Method Summary collapse
- #colorize! ⇒ Object
-
#initialize(high_line, aString) ⇒ StatusEntry
constructor
A new instance of StatusEntry.
- #to_s ⇒ Object
Constructor Details
#initialize(high_line, aString) ⇒ StatusEntry
Returns a new instance of StatusEntry.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vcs/status.rb', line 13 def initialize ( high_line, aString ) @high_line = high_line m = /^(.)(.)(.)(.)(.\s*)(.*)$/.match(aString) line, file_st, bl1, prop_st, cpy, bl2, file = m.to_a @file = file.to_path @file_st, @prop_st, @cpy = file_st[0], prop_st[0], cpy[0] @category = Vcs.classify(@file, @file_st) if @file_st == ?? @file_st = @@category_symbol[@category] || @file_st end @line = "#{@file_st.chr}#{bl1}#{prop_st}#{cpy}#{bl2}#{file}" end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def category @category end |
#comment ⇒ Object
Returns the value of attribute comment.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def comment @comment end |
#cpy ⇒ Object
Returns the value of attribute cpy.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def cpy @cpy end |
#file ⇒ Object
Returns the value of attribute file.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def file @file end |
#file_st ⇒ Object
Returns the value of attribute file_st.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def file_st @file_st end |
#line ⇒ Object
Returns the value of attribute line.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def line @line end |
#prop_st ⇒ Object
Returns the value of attribute prop_st.
11 12 13 |
# File 'lib/vcs/status.rb', line 11 def prop_st @prop_st end |
Instance Method Details
#colorize! ⇒ Object
26 27 28 |
# File 'lib/vcs/status.rb', line 26 def colorize! @line[0] = @high_line.color(@file_st.chr, *@@style[@file_st]) end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/vcs/status.rb', line 30 def to_s @file.to_s end |