class Guard::PluginUtil

def initialize_plugin(options)

Returns:
  • (Guard::Guard) - the initialized plugin. This return type is
  • (Guard::Plugin) - the initialized plugin

Other tags:
    See: https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 - How to
    See: Guard::Plugin -
def initialize_plugin(options)
  klass = plugin_class
  fail "Could not load class: #{_constant_name.inspect}" unless klass
  if klass.ancestors.include?(Guard)
    klass.new(options.delete(:watchers), options)
  else
    begin
      klass.new(**options)
    rescue ArgumentError => e
      fail "Failed to call #{klass}.new(options): #{e}"
    end
  end
end