Module: Guard::Jasmine::Formatter
- Defined in:
- lib/guard/jasmine/formatter.rb
Overview
The Guard::Jasmine formatter collects console and system notification methods and enhances them with some color information.
Class Method Summary (collapse)
-
+ (Object) color(text, color_code)
private
Print a info message to the console.
-
+ (Object) debug(message, options = { })
Print a debug message to the console.
-
+ (Object) error(message, options = { })
Print a red error message to the console.
-
+ (Object) info(message, options = { })
Print an info message to the console.
-
+ (Object) notify(message, options = { })
Outputs a system notification.
-
+ (Object) spec_failed(message, options = { })
Print a red spec failed message to the console.
-
+ (Object) success(message, options = { })
Print a green success message to the console.
-
+ (Object) suite_name(message, options = { })
Print a red spec failed message to the console.
Class Method Details
+ (Object) color(text, color_code) (private)
Print a info message to the console.
87 88 89 |
# File 'lib/guard/jasmine/formatter.rb', line 87 def color(text, color_code) ::Guard::UI.send(:color_enabled?) ? "\e[0#{ color_code }m#{ text }\e[0m" : text end |
+ (Object) debug(message, options = { })
Print a debug message to the console.
27 28 29 |
# File 'lib/guard/jasmine/formatter.rb', line 27 def debug(, = { }) ::Guard::UI.debug(, ) end |
+ (Object) error(message, options = { })
Print a red error message to the console.
37 38 39 |
# File 'lib/guard/jasmine/formatter.rb', line 37 def error(, = { }) ::Guard::UI.error(color(, ';31'), ) end |
+ (Object) info(message, options = { })
Print an info message to the console.
17 18 19 |
# File 'lib/guard/jasmine/formatter.rb', line 17 def info(, = { }) ::Guard::UI.info(, ) end |
+ (Object) notify(message, options = { })
Outputs a system notification.
76 77 78 |
# File 'lib/guard/jasmine/formatter.rb', line 76 def notify(, = { }) ::Guard::Notifier.notify(, ) end |
+ (Object) spec_failed(message, options = { })
Print a red spec failed message to the console.
56 57 58 |
# File 'lib/guard/jasmine/formatter.rb', line 56 def spec_failed(, = { }) ::Guard::UI.info(color(, ';31'), ) end |
+ (Object) success(message, options = { })
Print a green success message to the console.
47 48 49 |
# File 'lib/guard/jasmine/formatter.rb', line 47 def success(, = { }) ::Guard::UI.info(color(, ';32'), ) end |
+ (Object) suite_name(message, options = { })
Print a red spec failed message to the console.
65 66 67 |
# File 'lib/guard/jasmine/formatter.rb', line 65 def suite_name(, = { }) ::Guard::UI.info(color(, ';33'), ) end |