Class: Vcs::StatusEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/vcs/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoryObject

Returns the value of attribute category.



11
12
13
# File 'lib/vcs/status.rb', line 11

def category
  @category
end

#commentObject

Returns the value of attribute comment.



11
12
13
# File 'lib/vcs/status.rb', line 11

def comment
  @comment
end

#cpyObject

Returns the value of attribute cpy.



11
12
13
# File 'lib/vcs/status.rb', line 11

def cpy
  @cpy
end

#fileObject

Returns the value of attribute file.



11
12
13
# File 'lib/vcs/status.rb', line 11

def file
  @file
end

#file_stObject

Returns the value of attribute file_st.



11
12
13
# File 'lib/vcs/status.rb', line 11

def file_st
  @file_st
end

#lineObject

Returns the value of attribute line.



11
12
13
# File 'lib/vcs/status.rb', line 11

def line
  @line
end

#prop_stObject

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_sObject



30
31
32
# File 'lib/vcs/status.rb', line 30

def to_s
  @file.to_s
end