Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/svn-command/subversion_extensions.rb

Instance Method Summary collapse

Instance Method Details

#colorize_svn_addObject



16
# File 'lib/svn-command/subversion_extensions.rb', line 16

def colorize_svn_add;           self.green.bold; end

#colorize_svn_conflictObject



20
# File 'lib/svn-command/subversion_extensions.rb', line 20

def colorize_svn_conflict;      self.red.bold; end

#colorize_svn_deletedObject



19
# File 'lib/svn-command/subversion_extensions.rb', line 19

def colorize_svn_deleted;       self.magenta.bold; end

#colorize_svn_diffObject



55
56
57
58
59
60
61
62
# File 'lib/svn-command/subversion_extensions.rb', line 55

def colorize_svn_diff
  if Subversion.color
    self.gsub(/^(Index: )(.*)$/) { $2.ljust(100).black_on_white}.
         gsub(/^=+\n/, '') 
  else
    self
  end
end

#colorize_svn_exclamationObject



22
# File 'lib/svn-command/subversion_extensions.rb', line 22

def colorize_svn_exclamation;   self.red.bold; end

#colorize_svn_modifiedObject



17
# File 'lib/svn-command/subversion_extensions.rb', line 17

def colorize_svn_modified;      self.cyan.bold; end

#colorize_svn_question_markObject



15
# File 'lib/svn-command/subversion_extensions.rb', line 15

def colorize_svn_question_mark; self.yellow.bold; end

#colorize_svn_status_codeObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/svn-command/subversion_extensions.rb', line 24

def colorize_svn_status_code
  if Subversion.color
    self.gsub('?') { $&.colorize_svn_question_mark }.
         gsub('A') { $&.colorize_svn_add }.
         gsub('M') { $&.colorize_svn_modified }.
         gsub('D') { $&.colorize_svn_deleted }.
         gsub('C') { $&.colorize_svn_conflict }.
         gsub('~') { $&.colorize_svn_tilde }.
         gsub('!') { $&.colorize_svn_exclamation }
  else
    self
  end
end

#colorize_svn_status_linesObject



37
38
39
40
41
42
43
# File 'lib/svn-command/subversion_extensions.rb', line 37

def colorize_svn_status_lines
  if Subversion.color
    self.gsub(/^ *([^ ])\s/) { $&.colorize_svn_status_code }
  else
    self
  end
end

#colorize_svn_tildeObject



21
# File 'lib/svn-command/subversion_extensions.rb', line 21

def colorize_svn_tilde;         self.red.bold; end

#colorize_svn_update_linesObject



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/svn-command/subversion_extensions.rb', line 44

def colorize_svn_update_lines
  if Subversion.color
    self.gsub(/^ *U\s/)  { $&.colorize_svn_updated }.
         gsub(/^ *A\s/)  { $&.colorize_svn_add }.
         gsub(/^ *M\s/)  { $&.colorize_svn_modified }.
         gsub(/^ *D\s/)  { $&.colorize_svn_deleted }.
         gsub(/^ *C\s/)  { $&.colorize_svn_conflict }
  else
    self
  end
end

#colorize_svn_updatedObject



18
# File 'lib/svn-command/subversion_extensions.rb', line 18

def colorize_svn_updated;       self.yellow.bold; end