guard-compat 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f427877d1a7d6c838c4472d3ec9c0c89eb95371e
4
- data.tar.gz: a797c283daf477b9a4bd67784abb8f9e976f5326
3
+ metadata.gz: 2e97e53dd8b3d4582312361dd2c7742cd9435d88
4
+ data.tar.gz: 11c0eee7fc9a872e8b09ba65299088db5adf433e
5
5
  SHA512:
6
- metadata.gz: 626bce3667b1627b41a86cd2d8883d9cfb8e3dac9067cb012a8475d07e7ac9f8b4a81adabce90e984aa706e8d759af896718fc634bffde0653ea5d4bba6c49b0
7
- data.tar.gz: 7a2cbc0e873fe72ccc68daaceb19019ab67c29ad63b73de02f22c37296e9c63fb79b89d6d54b99911124618a649c6f4874e3cfe729111aa355079b47de5acd36
6
+ metadata.gz: 039ff7b7750fa578c7c485a8e13bb3c71e151d46959de17f2d8adacc6914dcf103370fab49c5f9c7b9f3dba39188dba0a118a9c625eae9512e98c6ab247c2025
7
+ data.tar.gz: 9fdbbee0c1ecdf32540a9aac987c5d46e0b7bd05e1d94038f3f8face35176af634e7f3bc60ca16da1dc09ada49fe42774f6aa8ecdf5e01045d6e33a44c222d38
data/README.md CHANGED
@@ -32,6 +32,13 @@ end
32
32
 
33
33
  ```
34
34
 
35
+ In your gemspec:
36
+
37
+ ```ruby
38
+ s.add_dependency('guard-compat', '~> 0.1')
39
+ ```
40
+
41
+
35
42
  ### IMPORTANT
36
43
 
37
44
  1) Do not include *any* files from Guard directly (if you need something from Guard which Guard::Compat doesn't provide, file an issue)
@@ -1,4 +1,9 @@
1
- unless Object.const_defined?('Guard::Plugin')
1
+ unless Object.const_defined?('Guard')
2
+ module Guard
3
+ end
4
+ end
5
+
6
+ unless Guard.const_defined?('Plugin')
2
7
  # Provided empty definition so requiring the plugin without Guard won't crash
3
8
  # (e.g. when added to a Gemfile without `require: false`)
4
9
  module Guard
@@ -11,31 +11,39 @@ module Guard
11
11
  end
12
12
  end
13
13
 
14
- class Notifier
15
- def self.notify(_msg, _options = {})
16
- fail NotImplementedError, 'stub this method in your tests'
14
+ # Stub, but allow real Notifier to be used, because e.g. guard-minitest uses
15
+ # is while guard-process is being tested
16
+ unless Guard.const_defined?('Notifier')
17
+ module Notifier
18
+ def self.notify(_msg, _options = {})
19
+ fail NotImplementedError, 'stub this method in your tests'
20
+ end
17
21
  end
18
22
  end
19
23
 
20
- class UI
21
- def self.info(_msg, _options = {})
22
- fail NotImplementedError, 'stub this method in your tests'
23
- end
24
-
25
- def self.warning(_msg, _options = {})
26
- fail NotImplementedError, 'stub this method in your tests'
27
- end
28
-
29
- def self.error(_msg, _options = {})
30
- fail NotImplementedError, 'stub this method in your tests'
31
- end
32
-
33
- def self.debug(_msg, _options = {})
34
- fail NotImplementedError, 'stub this method in your tests'
35
- end
36
-
37
- def self.deprecation(_msg, _options = {})
38
- fail NotImplementedError, 'stub this method in your tests'
24
+ # Stub, but allow real UI to be used, because e.g. guard-minitest uses it
25
+ # through using Guard::Notifier
26
+ unless Guard.const_defined?('UI')
27
+ module UI
28
+ def self.info(_msg, _options = {})
29
+ fail NotImplementedError, 'stub this method in your tests'
30
+ end
31
+
32
+ def self.warning(_msg, _options = {})
33
+ fail NotImplementedError, 'stub this method in your tests'
34
+ end
35
+
36
+ def self.error(_msg, _options = {})
37
+ fail NotImplementedError, 'stub this method in your tests'
38
+ end
39
+
40
+ def self.debug(_msg, _options = {})
41
+ fail NotImplementedError, 'stub this method in your tests'
42
+ end
43
+
44
+ def self.deprecation(_msg, _options = {})
45
+ fail NotImplementedError, 'stub this method in your tests'
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module Compat
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-compat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cezary Baginski