Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/svn-command/subversion_extensions.rb
Instance Method Summary collapse
- #colorize_svn_add ⇒ Object
- #colorize_svn_conflict ⇒ Object
- #colorize_svn_deleted ⇒ Object
- #colorize_svn_diff ⇒ Object
- #colorize_svn_exclamation ⇒ Object
- #colorize_svn_modified ⇒ Object
- #colorize_svn_question_mark ⇒ Object
- #colorize_svn_status_code ⇒ Object
- #colorize_svn_status_lines ⇒ Object
- #colorize_svn_tilde ⇒ Object
- #colorize_svn_update_lines ⇒ Object
- #colorize_svn_updated ⇒ Object
Instance Method Details
#colorize_svn_add ⇒ Object
16 |
# File 'lib/svn-command/subversion_extensions.rb', line 16 def colorize_svn_add; self.green.bold; end |
#colorize_svn_conflict ⇒ Object
20 |
# File 'lib/svn-command/subversion_extensions.rb', line 20 def colorize_svn_conflict; self.red.bold; end |
#colorize_svn_deleted ⇒ Object
19 |
# File 'lib/svn-command/subversion_extensions.rb', line 19 def colorize_svn_deleted; self.magenta.bold; end |
#colorize_svn_diff ⇒ Object
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_exclamation ⇒ Object
22 |
# File 'lib/svn-command/subversion_extensions.rb', line 22 def colorize_svn_exclamation; self.red.bold; end |
#colorize_svn_modified ⇒ Object
17 |
# File 'lib/svn-command/subversion_extensions.rb', line 17 def colorize_svn_modified; self.cyan.bold; end |
#colorize_svn_question_mark ⇒ Object
15 |
# File 'lib/svn-command/subversion_extensions.rb', line 15 def colorize_svn_question_mark; self.yellow.bold; end |
#colorize_svn_status_code ⇒ Object
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_lines ⇒ Object
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_tilde ⇒ Object
21 |
# File 'lib/svn-command/subversion_extensions.rb', line 21 def colorize_svn_tilde; self.red.bold; end |
#colorize_svn_update_lines ⇒ Object
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_updated ⇒ Object
18 |
# File 'lib/svn-command/subversion_extensions.rb', line 18 def colorize_svn_updated; self.yellow.bold; end |