guard-compat 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -6
- data/lib/guard/compat/plugin.rb +11 -0
- data/lib/guard/compat/test/helper.rb +3 -0
- data/lib/guard/compat/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f427877d1a7d6c838c4472d3ec9c0c89eb95371e
|
4
|
+
data.tar.gz: a797c283daf477b9a4bd67784abb8f9e976f5326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626bce3667b1627b41a86cd2d8883d9cfb8e3dac9067cb012a8475d07e7ac9f8b4a81adabce90e984aa706e8d759af896718fc634bffde0653ea5d4bba6c49b0
|
7
|
+
data.tar.gz: 7a2cbc0e873fe72ccc68daaceb19019ab67c29ad63b73de02f22c37296e9c63fb79b89d6d54b99911124618a649c6f4874e3cfe729111aa355079b47de5acd36
|
data/README.md
CHANGED
@@ -7,8 +7,8 @@ Currently, provides only a test helper for testing custom Guard plugins.
|
|
7
7
|
Add this to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
group :
|
11
|
-
gem 'guard-compat', require: false
|
10
|
+
group :test do
|
11
|
+
gem 'guard-compat', '>= 0.0.2', require: false
|
12
12
|
end
|
13
13
|
```
|
14
14
|
|
@@ -18,13 +18,27 @@ And then execute:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
Put the following
|
21
|
+
Put the following in your plugin files (e.g. `lib/guard/myplugin.rb`):
|
22
22
|
|
23
23
|
```ruby
|
24
|
-
#
|
25
|
-
|
24
|
+
# Don't require "guard/plugin" in hits files
|
25
|
+
require 'guard/compat/plugin'
|
26
|
+
|
27
|
+
module Guard
|
28
|
+
class MyPlugin < Plugin
|
29
|
+
# (...)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
26
33
|
```
|
27
34
|
|
35
|
+
### IMPORTANT
|
36
|
+
|
37
|
+
1) Do not include *any* files from Guard directly (if you need something from Guard which Guard::Compat doesn't provide, file an issue)
|
38
|
+
2) include 'guard/compat/plugin' is *all* your files which use `Guard::Plugin`
|
39
|
+
3) make sure you include the `< Plugin` part in *every* file which add classes or methods to your plugin class (important if your plugin consists of multiple files/sub class)
|
40
|
+
|
41
|
+
|
28
42
|
And in your plugin tests (e.g. `spec/lib/guard/myplugin_spec.rb`):
|
29
43
|
|
30
44
|
```ruby
|
@@ -35,8 +49,9 @@ require 'guard/myplugin'
|
|
35
49
|
```
|
36
50
|
## Example
|
37
51
|
|
38
|
-
See
|
52
|
+
See [lib/guard/compat/example.rb](https://github.com/guard/guard-compat/blob/master/lib/guard/compat/example.rb ) for an example plugin implementation.
|
39
53
|
|
54
|
+
See [spec/guard/compat/example_spec.rb](https://github.com/guard/guard-compat/blob/master/spec/guard/compat/example_spec.rb) for an example on how to test plugins using Guard::Compat.
|
40
55
|
|
41
56
|
## Contributing
|
42
57
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
unless Object.const_defined?('Guard::Plugin')
|
2
|
+
# Provided empty definition so requiring the plugin without Guard won't crash
|
3
|
+
# (e.g. when added to a Gemfile without `require: false`)
|
4
|
+
module Guard
|
5
|
+
class Plugin
|
6
|
+
def initialize
|
7
|
+
fail NotImplementedError
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/guard/compat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-compat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cezary Baginski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- guard-compat.gemspec
|
57
57
|
- lib/guard/compat.rb
|
58
58
|
- lib/guard/compat/example.rb
|
59
|
+
- lib/guard/compat/plugin.rb
|
59
60
|
- lib/guard/compat/test/helper.rb
|
60
61
|
- lib/guard/compat/version.rb
|
61
62
|
- spec/guard/compat/example_spec.rb
|