Class: GitReviewer::Printer
- Inherits:
-
Object
- Object
- GitReviewer::Printer
- Defined in:
- lib/gitreviewer/utils/printer.rb
Constant Summary collapse
- @@verbose =
false
Class Method Summary collapse
- .bold(content) ⇒ Object
- .green(content) ⇒ Object
- .put(content) ⇒ Object
- .red(content) ⇒ Object
-
.verbose ⇒ Object
类方法,用于访问类变量.
-
.verbose=(value) ⇒ Object
(可选)类方法,用于设置类变量.
- .verbose_bold(content) ⇒ Object
- .verbose_green(content) ⇒ Object
- .verbose_put(content) ⇒ Object
- .verbose_red(content) ⇒ Object
- .verbose_yellow(content) ⇒ Object
- .yellow(content) ⇒ Object
Class Method Details
.bold(content) ⇒ Object
31 32 33 |
# File 'lib/gitreviewer/utils/printer.rb', line 31 def self.bold(content) puts "\033[0;1m#{content} \033[0m" end |
.green(content) ⇒ Object
23 24 25 |
# File 'lib/gitreviewer/utils/printer.rb', line 23 def self.green(content) puts "\033[0;32m#{content}\033[0m" end |
.put(content) ⇒ Object
15 16 17 |
# File 'lib/gitreviewer/utils/printer.rb', line 15 def self.put(content) puts content end |
.red(content) ⇒ Object
19 20 21 |
# File 'lib/gitreviewer/utils/printer.rb', line 19 def self.red(content) puts "\033[0;31m#{content}\033[0m" end |
.verbose ⇒ Object
类方法,用于访问类变量
6 7 8 |
# File 'lib/gitreviewer/utils/printer.rb', line 6 def self.verbose @@verbose end |
.verbose=(value) ⇒ Object
(可选)类方法,用于设置类变量
11 12 13 |
# File 'lib/gitreviewer/utils/printer.rb', line 11 def self.verbose=(value) @@verbose = value end |
.verbose_bold(content) ⇒ Object
57 58 59 60 61 |
# File 'lib/gitreviewer/utils/printer.rb', line 57 def self.verbose_bold(content) if @@verbose puts "\033[0;1m#{content} \033[0m" end end |
.verbose_green(content) ⇒ Object
45 46 47 48 49 |
# File 'lib/gitreviewer/utils/printer.rb', line 45 def self.verbose_green(content) if @@verbose puts "\033[0;32m#{content}\033[0m" end end |
.verbose_put(content) ⇒ Object
35 36 37 38 39 |
# File 'lib/gitreviewer/utils/printer.rb', line 35 def self.verbose_put(content) if @@verbose puts content end end |
.verbose_red(content) ⇒ Object
41 42 43 |
# File 'lib/gitreviewer/utils/printer.rb', line 41 def self.verbose_red(content) puts "\033[0;31m#{content}\033[0m" end |
.verbose_yellow(content) ⇒ Object
51 52 53 54 55 |
# File 'lib/gitreviewer/utils/printer.rb', line 51 def self.verbose_yellow(content) if @@verbose puts "\033[0;33m#{content}\033[0m" end end |
.yellow(content) ⇒ Object
27 28 29 |
# File 'lib/gitreviewer/utils/printer.rb', line 27 def self.yellow(content) puts "\033[0;33m#{content}\033[0m" end |