require"guard/config"fail"Deprecations disabled (strict mode)"ifGuard::Config.new.strict?require"forwardable"require"guard/ui"require"guard/internals/session"require"guard/internals/state"require"guard/guardfile/evaluator"moduleGuard# @deprecated Every method in this module is deprecatedmoduleDeprecatedmoduleGuarddefself.add_deprecated(klass)klass.send(:extend,ClassMethods)endmoduleClassMethodsMORE_INFO_ON_UPGRADING_TO_GUARD_2=<<-EOS.gsub(/^\s*/,"")
For more information on how to upgrade for Guard 2.0, please head
over to: https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0%s
EOS# @deprecated Use `Guard.plugins(filter)` instead.## @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How to# upgrade for Guard 2.0#GUARDS=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.0 'Guard.guards(filter)' is deprecated.
Please use 'Guard.plugins(filter)' instead.
#{MORE_INFO_ON_UPGRADING_TO_GUARD_2%'#deprecated-methods'} EOSdefguards(filter=nil)::Guard::UI.deprecation(GUARDS)::Guard.state.session.plugins.all(filter)end# @deprecated Use `Guard.add_plugin(name, options = {})` instead.## @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How to# upgrade for Guard 2.0#ADD_GUARD=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.0 'Guard.add_guard(name, options = {})' is
deprecated.
Please use 'Guard.add_plugin(name, options = {})' instead.
#{MORE_INFO_ON_UPGRADING_TO_GUARD_2%'#deprecated-methods'} EOSdefadd_guard(*args)::Guard::UI.deprecation(ADD_GUARD)add_plugin(*args)end# @deprecated Use# `Guard::PluginUtil.new(name).plugin_class(fail_gracefully:# fail_gracefully)` instead.## @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How to# upgrade for Guard 2.0#GET_GUARD_CLASS=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.0 'Guard.get_guard_class(name, fail_gracefully
= false)' is deprecated and is now always on.
Please use 'Guard::PluginUtil.new(name).plugin_class(fail_gracefully:
fail_gracefully)' instead.
#{MORE_INFO_ON_UPGRADING_TO_GUARD_2%'#deprecated-methods'} EOSdefget_guard_class(name,fail_gracefully=false)UI.deprecation(GET_GUARD_CLASS)PluginUtil.new(name).plugin_class(fail_gracefully: fail_gracefully)end# @deprecated Use `Guard::PluginUtil.new(name).plugin_location` instead.## @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How to# upgrade for Guard 2.0#LOCATE_GUARD=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.0 'Guard.locate_guard(name)' is deprecated.
Please use 'Guard::PluginUtil.new(name).plugin_location' instead.
#{MORE_INFO_ON_UPGRADING_TO_GUARD_2%'#deprecated-methods'} EOSdeflocate_guard(name)UI.deprecation(LOCATE_GUARD)PluginUtil.new(name).plugin_locationend# @deprecated Use `Guard::PluginUtil.plugin_names` instead.## @see https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0 How to# upgrade for Guard 2.0## Deprecator message for the `Guard.guard_gem_names` methodGUARD_GEM_NAMES=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.0 'Guard.guard_gem_names' is deprecated.
Please use 'Guard::PluginUtil.plugin_names' instead.
#{MORE_INFO_ON_UPGRADING_TO_GUARD_2%'#deprecated-methods'} EOSdefguard_gem_namesUI.deprecation(GUARD_GEM_NAMES)PluginUtil.plugin_namesendRUNNING=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.7.1 it was discovered that Guard.running was
never initialized or used internally.
EOSdefrunningUI.deprecation(RUNNING)nilendLOCK=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.7.1 it was discovered that this accessor was
never initialized or used internally.
EOSdeflockUI.deprecation(LOCK)endLISTENER_ASSIGN=<<-EOS.gsub(/^\s*/,"")
listener= should not be used
EOSdeflistener=(_)UI.deprecation(LISTENER_ASSIGN)::Guard.listenerendEVALUATOR=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.8.2 this method shouldn't be used
EOSdefevaluatorUI.deprecation(EVALUATOR)options=::Guard.state.session.evaluator_options::Guard::Guardfile::Evaluator.new(options)endRESET_EVALUATOR=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.8.2 this method shouldn't be used
EOSdefreset_evaluator(_options)UI.deprecation(RESET_EVALUATOR)endRUNNER=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.8.2 this method shouldn't be used
EOSdefrunnerUI.deprecation(RUNNER)::Guard::Runner.newendEVALUATE_GUARDFILE=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.8.2 this method shouldn't be used
EOSdefevaluate_guardfileUI.deprecation(EVALUATE_GUARDFILE)options=::Guard.state.session.evaluator_optionsevaluator=::Guard::Guardfile::Evaluator.new(options)evaluator.evaluatemsg="No plugins found in Guardfile, please add at least one."::Guard::UI.errormsgif_pluginless_guardfile?endOPTIONS=<<-EOS.gsub(/^\s*/,"")
Starting with Guard 2.9.0 Guard.options is deprecated and ideally you
should be able to set specific options through an API or a DSL
method. Feel free to add feature requests if there's something
missing.
EOSdefoptionsUI.deprecation(OPTIONS)Class.new(Hash)dodefinitializesuper(to_hash)enddefto_hashsession=::Guard.state.session{clear: session.clearing?,debug: session.debug?,watchdir: Array(session.watchdirs).map(&:to_s),notify: session.notify_options[:notify],no_interactions: (session.interactor_name==:sleep)}endextendForwardabledelegate[:to_a,:keys]=>:to_hashdelegate[:include?]=>:keysdeffetch(key,*args)hash=to_hashverify_key!(hash,key)hash.fetch(key,*args)enddef[]=(key,value)casekeywhen:clear::Guard.state.session.clearing(value)elsemsg="Oops! Guard.option[%s]= is unhandled or unsupported."\"Please file an issue if you rely on this option working."failNotImplementedError,format(msg,key)endendprivatedefverify_key!(hash,key)returnifhash.key?(key)msg="Oops! Guard.option[%s] is unhandled or unsupported."\"Please file an issue if you rely on this option working."failNotImplementedError,format(msg,key)endend.newendADD_GROUP=<<-EOS.gsub(/^\s*/,"")
add_group is deprecated since 2.10.0 in favor of
Guard.state.session.groups.add
EOSdefadd_group(name,options={})UI.deprecation(ADD_GROUP)::Guard.state.session.groups.add(name,options)endADD_PLUGIN=<<-EOS.gsub(/^\s*/,"")
add_plugin is deprecated since 2.10.0 in favor of
Guard.state.session.plugins.add
EOSdefadd_plugin(name,options={})UI.deprecation(ADD_PLUGIN)::Guard.state.session.plugins.add(name,options)endGROUP=<<-EOS.gsub(/^\s*/,"")
group is deprecated since 2.10.0 in favor of
Guard.state.session.group.add(filter).first
EOSdefgroup(filter)UI.deprecation(GROUP)::Guard.state.session.groups.all(filter).firstendPLUGIN=<<-EOS.gsub(/^\s*/,"")
plugin is deprecated since 2.10.0 in favor of
Guard.state.session.group.add(filter).first
EOSdefplugin(filter)UI.deprecation(PLUGIN)::Guard.state.session.plugins.all(filter).firstendGROUPS=<<-EOS.gsub(/^\s*/,"")
group is deprecated since 2.10.0 in favor of
Guard.state.session.groups.all(filter)
EOSdefgroups(filter)UI.deprecation(GROUPS)::Guard.state.session.groups.all(filter)endPLUGINS=<<-EOS.gsub(/^\s*/,"")
plugins is deprecated since 2.10.0 in favor of
Guard.state.session.plugins.all(filter)
EOSdefplugins(filter)UI.deprecation(PLUGINS)::Guard.state.session.plugins.all(filter)endSCOPE=<<-EOS.gsub(/^\s*/,"")
scope is deprecated since 2.10.0 in favor of
Guard.state.scope.to_hash
EOSdefscopeUI.deprecation(SCOPE)::Guard.state.scope.to_hashendSCOPE_ASSIGN=<<-EOS.gsub(/^\s*/,"")
scope= is deprecated since 2.10.0 in favor of
Guard.state.scope.to_hash
EOSdefscope=(scope)UI.deprecation(SCOPE_ASSIGN)::Guard.state.scope.from_interactor(scope)endendendendend