8000 make Guard::Motion class inherits Guard::Plugin, instead of deprecated class Guard::Guard by satoyos · Pull Request #11 · mordaroso/guard-motion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

make Guard::Motion class inherits Guard::Plugin, instead of deprecated class Guard::Guard #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

satoyos
Copy link
@satoyos satoyos commented Nov 16, 2014

I encontered some "Deprecated" Wargings from Guard gem, so I tried to fix warnings below;

16:47:20 - WARN - Starting with Guard 2.0, Guard::Motion should inherit from Guard::Plugin
> [#] instead of Guard::Guard.
> [#] Please note that the constructor signature has changed from
> [#] Guard::Guard#initialize(watchers = [], options = {}) to
> [#] Guard::Plugin#initialize(options = {}).
> [#] 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#changes-in-guardguard
> [#]
> [#] Deprecation backtrace: /Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-2.8.2/lib/guard/ui.rb:107:in `deprecation'
> [#]    >/Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-2.8.2/lib/guard/guard.rb:94:in `initialize'
> [#]    >/Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-motion-0.1.2/lib/guard/motion.rb:16:in `initialize'
16:47:20 - INFO - Guard is using TerminalTitle to send notifications.
16:47:20 - INFO - Guard::Motion is running
16:47:20 - INFO - Running all specs

******** BIG DEPRECATION WARNING !! ********

Hi, Guard here.

You're including lib/guard/guard.rb ...

... which contains code deprecated over a year ago!


This file will likely be removed in the next version, so make sure you're
not requiring it anywhere to ensure safe gem upgrades.

If this message is annoying and you can't quickly fix the issue (see below),
you have 2 options:

  1) Simply set the env variable "GUARD_GEM_SILENCE_DEPRECATIONS" to "1" to
  skip this message

  2) Freeze the gem to a previous version (not recommended because upgrades
  are cool and you might forget to unfreeze later!).

  E.g. in your Gemfile:

    if Time.now > Time.new(2014,11,10)
      gem 'guard', '~> 2.8'
    else
      # Freeze until 2014-11-10 - in case we forget to change back ;)
      gem 'guard', '= 2.7.3'
    end

If you don't know which gem or plugin is requiring this file, here's a
backtrace:

/Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-2.8.2/lib/guard/guard.rb:45:in `<module:Guard>'
 >> /Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-2.8.2/lib/guard/guard.rb:3:in `<top (required)>'
 >> /Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-motion-0.1.2/lib/guard/motion.rb:2:in `require'
 >> /Users/yoshi/src/motion/Shuffle100/vendor/bundle/ruby/2.0.0/gems/guard-motion-0.1.2/lib/guard/motion.rb:2:in `<top (required)>'
 >> /Users/yoshi/src/motion/Shuffle100/Rakefile:8:in `require'"

Here's how to quickly upgrade/fix this (given you are a maintainer of the
offending plugin or you want to prepare a pull request yourself):

  https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0#changes-in-guardguard

Have fun!

******** END OF DEPRECATION MESSAGE ********

@andrewhavens
Copy link

👍 This just solved my problem. Here's a line you can add to your gemfile until this is merged:

gem 'guard-motion', require: 'guard/motion', github: 'satoyos/guard-motion', branch: 'inherit_Plugin'

@andrewhavens
Copy link

@mordaroso Would you mind merging this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0