Class: Guard::RSpec::Notifier
- Inherits:
-
Object
- Object
- Guard::RSpec::Notifier
- Defined in:
- lib/guard/rspec/notifier.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Notifier
constructor
A new instance of Notifier.
- #notify(summary) ⇒ Object
- #notify_failure ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Notifier
Returns a new instance of Notifier.
6 7 8 |
# File 'lib/guard/rspec/notifier.rb', line 6 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/guard/rspec/notifier.rb', line 4 def @options end |
Instance Method Details
#notify(summary) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/guard/rspec/notifier.rb', line 10 def notify(summary) return unless [:notification] failure_count, pending_count = _parse_summary(summary) image = _image(failure_count, pending_count) priority = _priority(image) Guard::Compat::UI.notify(summary, title: @options[:title], image: image, priority: priority) end |
#notify_failure ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/guard/rspec/notifier.rb', line 21 def notify_failure return unless [:notification] Guard::Compat::UI.notify("Failed", title: @options[:title], image: :failed, priority: 2) end |