pluginator 0.11.4 → 0.11.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a42be419608abc90291c8358a4f23b1e43165cec
4
- data.tar.gz: baa6ea7161c799f1455cc31fff04f4be8e594794
3
+ metadata.gz: 31df38c24119dd5089716ee8fc1edd0db9c191c6
4
+ data.tar.gz: bb973079ad24dbb9f3f2fcd6fb9366ed8c7ca907
5
5
  SHA512:
6
- metadata.gz: 8cf984f2cb328242a966ae4cd58b4e19d2314689c00bac2a08356149ef8ea98bea0ef4864f39af033f79f4031b573c59b6b97dd0199280c320bf6c25c2441414
7
- data.tar.gz: eea32d7a0e76329967ff1a9ef62d9cf3b92fc40433997148ccb5408c77d4f7956d829d3141daacd4428ca88d7a1640a2b5dc0046366fe01a9fd20d09ae54fb4a
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.group(group, type: nil, extends: [])
11
+ def self.find(group, type: nil, extends: [])
12
12
  Pluginator::ExtendableAutodetect.new(group, type: type, extends: extends)
13
13
  end
14
14
  end
@@ -1,4 +1,4 @@
1
1
  module Pluginator
2
2
  # Version of Pluginator
3
- VERSION = "0.11.4"
3
+ VERSION = "0.11.5"
4
4
  end
@@ -7,7 +7,7 @@ module Something
7
7
  end
8
8
 
9
9
  def demo_file(path)
10
- File.expand_path(File.join("..", "..", "demo", path), __FILE__)
10
+ File.expand_path(File.join("..", "..", "..", "demo", path), __FILE__)
11
11
  end
12
12
 
13
13
  def demo_files(*paths)
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
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