guard-compat 0.0.2 → 0.1.0

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: a5c15f5a243693a6af0123db855199c6dd3ce1a0
4
- data.tar.gz: 2b4187ea85ba0bfa512d5298788c5c21f46a89cd
3
+ metadata.gz: f427877d1a7d6c838c4472d3ec9c0c89eb95371e
4
+ data.tar.gz: a797c283daf477b9a4bd67784abb8f9e976f5326
5
5
  SHA512:
6
- metadata.gz: d5c161fe3ef52a00aaca0a1c81ee30acda5febb69c642b9067ea8866ecfb4440f8d41da0ad5572fdd2ea2b7dde923b177dd6319b7c23b1a328d8db5f362806a3
7
- data.tar.gz: 7706bfba6558b2abf1642afc25280f5cbb6af15c83f59af5b5bb5f29b7e19e9764e4d4634c1e9dfff11ecfaa0c8d12bb3a26d25f7def96a6c80ad5ff5b864165
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 :development do
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 notes in your plugin file (e.g. `lib/guard/myplugin.rb`):
21
+ Put the following in your plugin files (e.g. `lib/guard/myplugin.rb`):
22
22
 
23
23
  ```ruby
24
- # Do NOT require "guard/plugin"
25
- # It will either be required or a stub will be supplied by the test class
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 `lib/guard/example.rb` for an example plugin implementation.
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
@@ -1,4 +1,7 @@
1
1
  # Minimal stub allowing a plugin to work
2
+
3
+ require 'guard/compat/plugin'
4
+
2
5
  module Guard
3
6
  class Plugin
4
7
  attr_reader :options
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module Compat
3
- VERSION = '0.0.2'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
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.2
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-05 00:00:00.000000000 Z
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