lib/guard/dsl_describer.rb in guard-2.8.2 vs lib/guard/dsl_describer.rb in guard-2.9.0
- old
+ new
@@ -1,10 +1,11 @@
# encoding: utf-8
require "formatador"
require "guard/guardfile/evaluator"
require "guard/ui"
+require "guard/metadata"
module Guard
# The DslDescriber evaluates the Guardfile and creates an internal structure
# of it that is used in some inspection utility methods like the CLI commands
# `show` and `list`.
@@ -111,16 +112,21 @@
# @see CLI#show
#
def notifiers
_evaluate_guardfile
- merged_notifiers = ::Guard::Notifier::NOTIFIERS.inject(:merge)
+ supported = ::Guard::Notifier::SUPPORTED
+ Notifier.connect(notify: false)
+ detected = Notifier.notifiers
+ Notifier.disconnect
+
+ merged_notifiers = supported.inject(:merge)
final_rows = merged_notifiers.each_with_object([]) do |definition, rows|
name = definition[0]
clazz = definition[1]
available = clazz.available?(silent: true) ? "✔" : "✘"
- notifier = ::Guard::Notifier.notifiers.detect { |n| n[:name] == name }
+ notifier = detected.detect { |n| n[:name] == name }
used = notifier ? "✔" : "✘"
options = _merge_options(clazz, notifier)
options.delete(:silent)