Upgrading to Guard 3.0
Guard 3.0 is a major update and removes a lot of API methods to reduce the API surface needed to be kept back-compatible over time. Most of what was possible with the removed APIs can still be done via CLI. Following is the exhaustive list of these changes (mostly useful for Guard plugins authors).
- Remove support for plugins that inherited from
Guard
:-
Guard.guards
,Guard.plugins
,Guard.plugin
,Guard.add_guard
,Guard.add_plugin
. -
Guard.groups
,Guard.group
,Guard.add_group
. -
Guard.scope
. -
Guard.state.session.plugins.all
,Guard.state.session.plugins.add
(internal API only). -
Guard.state.session.groups.all
,Guard.state.session.groups.add
(internal API only). -
Guard.state.scope
,Guard.state.scope=
(internal API only). -
Guard.get_guard_class
,Guard.locate_guard
,Guard.guard_gem_names
. -
Guard::PluginUtil#plugin_class
,Guard::PluginUtil#plugin_location
,Guard::PluginUtil.plugin_names
(internal API only). -
Guard.running
,Guard.lock
,Guard.listener=
,Guard.evaluator
,Guard.reset_evaluator
,Guard.runner
,Guard.evaluate_guardfile
,Guard.options
.
-
- Remove support for plugins that inherited from
Guard
. - Remove
Guard::Watcher#match_guardfile?
. - Remove
Guard::Guardfile::Evaluator#evaluate_guardfile
in favor ofGuard::Guardfile::Evaluator#evaluate
. - Remove
Guard::Guardfile::Evaluator#reevaluate_guardfile
. - Remove
Guard::Dsl.evaluate_guardfile(options)
in favor ofGuard::Guardfile::Evaluator.new(options).evaluate_guardfile
. - Remove
Guard::Dsl#filter
in favor ofGuard::Dsl#ignore
. - Remove
Guard::Dsl#filter!
in favor ofGuard::Dsl#ignore!
. - Remove support for Regexps as strings in `Guard::Dsl#watch.
- Remove
Guard::Guardfile.create_guardfile
in favor ofGuard::Guardfile::Generator#create_guardfile
. - Remove
Guard::Guardfile.initialize_template
in favor ofGuard::Guardfile::Generator#initialize_template
. - Remove
Guard::Guardfile.initialize_all_templates
in favor ofGuard::Guardfile::Generator#initialize_all_templates
.
- Drop support for Ruby 2.4 (support for it has ended on 2020-03-31: https://www.ruby-lang.org/en/news/2020/04/05/support-of-ruby-2-4-has-ended/). While Guard could have kept the support for this Ruby version, we think it's a good opportunity to move forward, and given how stable Guard has been in the last years, users can keep using Guard 2.x if they're using Ruby 2.4, since Guard 3.0 is mostly refactors and APIs removal.
- Introduce
Guard::Engine
and move away from the singleton approach (https://github.com/guard/guard/pull/982).
This wiki and the Guard README document contain a lot of information, please take your time and read these instructions carefully.
If you run into any trouble, you may start by understanding how Guard works.
We provide detailed changes for each Guard release.
Be sure to read the CONTRIBUTING guidelines before reporting a new Guard issue or open a pull request.
If you have any questions about the Guard usage or want to share some information with the Guard community, please go to one of the following places:
- Google+ community
- Google group
- StackOverflow
- IRC channel
#guard
(irc.freenode.net) for chatting