pluginator 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pluginator.rb +1 -1
- data/lib/pluginator/version.rb +1 -1
- data/test/{autodetect_test.rb → pluginator/autodetect_test.rb} +1 -1
- data/test/{extendable_autodetect_test.rb → pluginator/extendable_autodetect_test.rb} +0 -0
- data/test/{group_test.rb → pluginator/group_test.rb} +0 -0
- data/test/{name_converter_test.rb → pluginator/name_converter_test.rb} +0 -0
- data/test/pluginator_test.rb +29 -0
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31df38c24119dd5089716ee8fc1edd0db9c191c6
|
4
|
+
data.tar.gz: bb973079ad24dbb9f3f2fcd6fb9366ed8c7ca907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cce30736f9a11ae892b3306d33cfe5677f9f5257ce4b209986b19256187fe475314f3b096f2f53f1df5071b14b76779df86e5f161989514ecc19c95eaa5b6b12
|
7
|
+
data.tar.gz: c27a85f3351e352069ed30b462fb4931fed5833f942f8f47562256c1949260dc496fe9c4e45442278f2e1ad7af5ebebd1a78acd8baf0c99df60c021453ed7328
|
data/lib/pluginator.rb
CHANGED
@@ -8,7 +8,7 @@ module Pluginator
|
|
8
8
|
# @param type [String] optional name of type to load
|
9
9
|
# @param extends optional list of extension to extend into pluginator instance
|
10
10
|
# @return instance of Pluginator
|
11
|
-
def self.
|
11
|
+
def self.find(group, type: nil, extends: [])
|
12
12
|
Pluginator::ExtendableAutodetect.new(group, type: type, extends: extends)
|
13
13
|
end
|
14
14
|
end
|
data/lib/pluginator/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'pluginator'
|
3
|
+
|
4
|
+
describe Pluginator do
|
5
|
+
it "loads plugins automatically for group" do
|
6
|
+
pluginator = Pluginator.find("something")
|
7
|
+
pluginator.types.must_include('stats')
|
8
|
+
pluginator.types.must_include('math')
|
9
|
+
pluginator.types.size.must_equal(2)
|
10
|
+
plugins = pluginator["math"].map(&:to_s)
|
11
|
+
plugins.size.must_equal(2)
|
12
|
+
plugins.must_include("Something::Math::Increase")
|
13
|
+
plugins.must_include("Something::Math::Decrease")
|
14
|
+
plugins.wont_include("Something::Math::Add")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "loads plugins automatically for group/type" do
|
18
|
+
pluginator = Pluginator.find("something", type: "stats")
|
19
|
+
pluginator.types.must_include('stats')
|
20
|
+
pluginator.types.size.must_equal(1)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "loads existing extensions - symbol" do
|
24
|
+
pluginator = Pluginator.find("something", extends: :conversions)
|
25
|
+
pluginator.public_methods.must_include(:class2string)
|
26
|
+
pluginator.public_methods.must_include(:string2class)
|
27
|
+
pluginator.public_methods.wont_include(:plugins_map)
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluginator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Papis
|
@@ -80,10 +80,11 @@ files:
|
|
80
80
|
- lib/plugins/pluginator/extensions/matching.rb
|
81
81
|
- lib/plugins/pluginator/extensions/plugins_map.rb
|
82
82
|
- pluginator.gemspec
|
83
|
-
- test/autodetect_test.rb
|
84
|
-
- test/extendable_autodetect_test.rb
|
85
|
-
- test/group_test.rb
|
86
|
-
- test/name_converter_test.rb
|
83
|
+
- test/pluginator/autodetect_test.rb
|
84
|
+
- test/pluginator/extendable_autodetect_test.rb
|
85
|
+
- test/pluginator/group_test.rb
|
86
|
+
- test/pluginator/name_converter_test.rb
|
87
|
+
- test/pluginator_test.rb
|
87
88
|
- test/plugins/extensions/conversions_test.rb
|
88
89
|
- test/plugins/extensions/first_ask_test.rb
|
89
90
|
- test/plugins/extensions/first_class_test.rb
|
@@ -114,10 +115,11 @@ signing_key:
|
|
114
115
|
specification_version: 4
|
115
116
|
summary: Rubygems plugin system using Gem.find_files.
|
116
117
|
test_files:
|
117
|
-
- test/autodetect_test.rb
|
118
|
-
- test/extendable_autodetect_test.rb
|
119
|
-
- test/group_test.rb
|
120
|
-
- test/name_converter_test.rb
|
118
|
+
- test/pluginator/autodetect_test.rb
|
119
|
+
- test/pluginator/extendable_autodetect_test.rb
|
120
|
+
- test/pluginator/group_test.rb
|
121
|
+
- test/pluginator/name_converter_test.rb
|
122
|
+
- test/pluginator_test.rb
|
121
123
|
- test/plugins/extensions/conversions_test.rb
|
122
124
|
- test/plugins/extensions/first_ask_test.rb
|
123
125
|
- test/plugins/extensions/first_class_test.rb
|