File: example.rb

package info (click to toggle)
ruby-guard-compat 1.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 140 kB
  • sloc: ruby: 350; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 997 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# NOTE: Do NOT require "guard/plugin" - it will either be already required, or
# a stub will be supplied by the test class

module Guard
  class MyPlugin < Plugin
    def start
      Guard::Compat::UI.notify('foo')
      Guard::Compat::UI.color('foo')

      Guard::Compat::UI.info('foo')
      Guard::Compat::UI.warning('foo')
      Guard::Compat::UI.error('foo')
      Guard::Compat::UI.debug('foo')
      Guard::Compat::UI.deprecation('foo')
    end

    def run_all
      Guard::Compat::UI.notify('foo', bar: :baz)
      Guard::Compat::UI.color('foo', :white)

      Guard::Compat::UI.info('foo', bar: :baz)
      Guard::Compat::UI.warning('foo', bar: :baz)
      Guard::Compat::UI.error('foo', bar: :baz)
      Guard::Compat::UI.debug('foo', bar: :baz)
      Guard::Compat::UI.deprecation('foo', bar: :baz)
    end

    def run_on_modifications
      Guard::Compat::UI.color_enabled?
      Guard::Compat.matching_files(self, ['foo'])
      Guard::Compat.watched_directories
    end
  end
end