guard-compat 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -19
- data/lib/guard/compat/example.rb +2 -0
- data/lib/guard/compat/plugin.rb +3 -0
- data/lib/guard/compat/test/helper.rb +4 -0
- data/lib/guard/compat/version.rb +1 -1
- data/spec/guard/compat/example_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a717c9cc74638fef19735c7029e547853fd957d0
|
4
|
+
data.tar.gz: 4e2f952d70ce108ec8cf2b473f98499690a45285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 857bca959b9ffd37e30537cea11574dfb3d6c4a402f59375e435da8548ac43e9d22e1276e7c0aee5217634606906441807389d5b1548942e2b8c2eb7af782037
|
7
|
+
data.tar.gz: db48127d844b15360e34e787226e70b3cf4bac4f89a688373c3a38b4c184ad0a2bf6fa26de465530b453c72212bc974541213d4c72f356fbface2f8aaa363035
|
data/README.md
CHANGED
@@ -2,26 +2,18 @@
|
|
2
2
|
|
3
3
|
Currently, provides only a test helper for testing custom Guard plugins.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Usage (in a Guard plugin)
|
6
6
|
|
7
|
-
|
7
|
+
In your gemspec:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
|
11
|
-
gem 'guard-compat', '>= 0.0.2', require: false
|
12
|
-
end
|
10
|
+
s.add_dependency('guard-compat', '~> 0.3')
|
13
11
|
```
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
Put the following in your plugin files (e.g. `lib/guard/myplugin.rb`):
|
13
|
+
In all your plugin files (e.g. `lib/guard/myplugin.rb`):
|
22
14
|
|
23
15
|
```ruby
|
24
|
-
# Don't require "guard/plugin" in
|
16
|
+
# Don't require "guard/plugin" here or in any other plugin's files
|
25
17
|
require 'guard/compat/plugin'
|
26
18
|
|
27
19
|
module Guard
|
@@ -32,12 +24,6 @@ end
|
|
32
24
|
|
33
25
|
```
|
34
26
|
|
35
|
-
In your gemspec:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
s.add_dependency('guard-compat', '~> 0.1')
|
39
|
-
```
|
40
|
-
|
41
27
|
|
42
28
|
### IMPORTANT
|
43
29
|
|
data/lib/guard/compat/example.rb
CHANGED
data/lib/guard/compat/plugin.rb
CHANGED
data/lib/guard/compat/version.rb
CHANGED
@@ -11,12 +11,18 @@ RSpec.describe Guard::MyPlugin, exclude_stubs: [Guard::Plugin] do
|
|
11
11
|
%w(info warning error deprecation debug).each do |type|
|
12
12
|
allow(Guard::UI).to receive(type.to_sym)
|
13
13
|
end
|
14
|
+
|
15
|
+
allow(Guard::UI).to receive(:color_enabled?).and_return(false)
|
14
16
|
end
|
15
17
|
|
16
18
|
it 'passes options' do
|
17
19
|
expect(subject.options).to include(foo: :bar)
|
18
20
|
end
|
19
21
|
|
22
|
+
it 'works without options' do
|
23
|
+
expect { described_class.new }.to_not raise_error
|
24
|
+
end
|
25
|
+
|
20
26
|
it 'uses the notifier' do
|
21
27
|
expect(Guard::Notifier).to receive(:notify).with('foo')
|
22
28
|
subject.start
|
@@ -38,4 +44,10 @@ RSpec.describe Guard::MyPlugin, exclude_stubs: [Guard::Plugin] do
|
|
38
44
|
subject.run_all
|
39
45
|
end
|
40
46
|
end
|
47
|
+
|
48
|
+
it 'uses the UI color_enabled? method' do
|
49
|
+
expect(Guard::UI).to receive(:color_enabled?).and_return(true)
|
50
|
+
subject.run_all
|
51
|
+
end
|
52
|
+
|
41
53
|
end
|