ddplugin 1.0.0 → 1.0.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: 1cb5ed133200502a15fec93f8b2058ed7a01008b
4
- data.tar.gz: d24a3bb4dd0d7ebfda7b34ab5b41afc40d4afe28
3
+ metadata.gz: 19d0ae996f2999cccb30bc44777e07a1b0c04f1e
4
+ data.tar.gz: 8b0bda0c3d2bf442a8e1e8d49313c8b57ff44498
5
5
  SHA512:
6
- metadata.gz: c21e116c84b17e3d7f90e9b9f3115f19700da029f6d0a56236ab003f4c49e733488ca61f0a7039a1b8cb1176bbe5997e1b56ed2eae016528c75d87c4e793f1d9
7
- data.tar.gz: 18fe5cd2da62d2cfa01f28d3e1531356f077e5495abc20f2c9f8356752c48a06ffafa068330f10c6b2b6b862fef4753b31671a8f72b38bfd8043163ed7514cbe
6
+ metadata.gz: f4eb79aa5c0cd23076cf4b32fe37ee40357bf77cf2c6b72929999c1af65f48a44ca29cada37632cebeb53177b694bc9500b9c5dd3c0c9f0bb16a2da4d1334d51
7
+ data.tar.gz: 39fe5a9c5b28043cc0c218bed98a2125e100660511a86ddf68e95dfe57fce1cc0902413f3fd05e5660b9a09474bfd2503eb7878b269cef04b1311a56bd87dc61
data/Gemfile.lock CHANGED
@@ -1,28 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ddplugin (1.0.0)
4
+ ddplugin (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.3.0)
10
- coveralls (0.8.16)
10
+ coveralls (0.8.19)
11
11
  json (>= 1.8, < 3)
12
12
  simplecov (~> 0.12.0)
13
- term-ansicolor (~> 1.3.0)
13
+ term-ansicolor (~> 1.3)
14
14
  thor (~> 0.19.1)
15
- tins (>= 1.6.0, < 2)
15
+ tins (~> 1.6)
16
16
  docile (1.1.5)
17
- json (2.0.2)
18
- minitest (5.9.1)
19
- parser (2.3.2.0)
17
+ json (2.0.3)
18
+ minitest (5.10.1)
19
+ parser (2.4.0.0)
20
20
  ast (~> 2.2)
21
21
  powerpack (0.1.1)
22
- rainbow (2.1.0)
23
- rake (11.3.0)
24
- rubocop (0.45.0)
25
- parser (>= 2.3.1.1, < 3.0)
22
+ rainbow (2.2.1)
23
+ rake (12.0.0)
24
+ rubocop (0.47.1)
25
+ parser (>= 2.3.3.1, < 3.0)
26
26
  powerpack (~> 0.1)
27
27
  rainbow (>= 1.99.1, < 3.0)
28
28
  ruby-progressbar (~> 1.7)
@@ -33,11 +33,11 @@ GEM
33
33
  json (>= 1.8, < 3)
34
34
  simplecov-html (~> 0.10.0)
35
35
  simplecov-html (0.10.0)
36
- term-ansicolor (1.3.2)
36
+ term-ansicolor (1.4.0)
37
37
  tins (~> 1.0)
38
- thor (0.19.3)
39
- tins (1.13.0)
40
- unicode-display_width (1.1.1)
38
+ thor (0.19.4)
39
+ tins (1.13.2)
40
+ unicode-display_width (1.1.3)
41
41
 
42
42
  PLATFORMS
43
43
  ruby
@@ -51,4 +51,4 @@ DEPENDENCIES
51
51
  rubocop
52
52
 
53
53
  BUNDLED WITH
54
- 1.13.6
54
+ 1.14.5
data/NEWS.md CHANGED
@@ -0,0 +1,11 @@
1
+ # ddplugin release notes
2
+
3
+ ## 1.0.1 (2017-02-28)
4
+
5
+ Fixes:
6
+
7
+ * Made `.all` not return duplicates (#3)
8
+
9
+ ## 1.0 (2016-11-27)
10
+
11
+ Initial release.
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  Designing a library so that third parties can easily extend it greatly improves its usefulness. *ddplugin* helps solve this problem using *plugins*, which are classes of a certain type and with a given identifier (Ruby symbol).
11
11
 
12
- This code was extracted from nanoc, where it has been in production for years.
12
+ This code was extracted from Nanoc, where it has been in production for years.
13
13
 
14
14
  ## Use case
15
15
 
@@ -27,9 +27,9 @@ In *ddplugin*, the filters, connectors and data sources would be *plugin types*,
27
27
 
28
28
  A typical way to use plugins would be to store the plugin names in a configuration file, so that the actual plugin implementations can be discovered at runtime.
29
29
 
30
- ## Dependencies
30
+ ## Requirements
31
31
 
32
- *ddplugin* requires Ruby 1.9.3 or higher.
32
+ *ddplugin* requires Ruby 2.1 or higher.
33
33
 
34
34
  ## Versioning
35
35
 
@@ -37,8 +37,6 @@ A typical way to use plugins would be to store the plugin names in a configurati
37
37
 
38
38
  ## Installation
39
39
 
40
- **NOTE:** *ddplugin* has not been released as a gem yet, so these installation instructions are not usable yet.
41
-
42
40
  If your library where you want to use *ddplugin* has a gemspec, add *ddplugin* as a runtime dependency to the gemspec:
43
41
 
44
42
  ```ruby
@@ -132,7 +130,3 @@ To run the tests, execute `rake`:
132
130
  ```
133
131
  % rake
134
132
  ```
135
-
136
- ## Contact
137
-
138
- *ddplugin* is written by Denis Defreyne <denis.defreyne@stoneship.org>
@@ -64,7 +64,7 @@ module DDPlugin
64
64
  # @return [Enumerable<Class>] A collection of registered classes
65
65
  def find_all(root_class)
66
66
  @identifiers_to_classes[root_class] ||= {}
67
- @identifiers_to_classes[root_class].values
67
+ @identifiers_to_classes[root_class].values.uniq
68
68
  end
69
69
  end
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module DDPlugin
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
data/test/test_plugin.rb CHANGED
@@ -73,4 +73,17 @@ class DDPlugin::PluginTest < Minitest::Test
73
73
 
74
74
  assert_equal [klass1, klass2], AllSample.all
75
75
  end
76
+
77
+ def test_all_with_multiple_identifiers
78
+ parent_class = Class.new { extend DDPlugin::Plugin }
79
+
80
+ klass1 = Class.new(parent_class)
81
+ klass1.identifier :one_a
82
+ klass1.identifier :one_b
83
+
84
+ klass2 = Class.new(parent_class)
85
+ klass2.identifier :two
86
+
87
+ assert_equal [klass1, klass2], parent_class.all
88
+ end
76
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddplugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-27 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 2.6.8
71
+ rubygems_version: 2.6.10
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Plugins for Ruby apps