pluggability 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.md +20 -0
- data/README.md +14 -5
- data/lib/pluggability.rb +3 -3
- data/spec/helpers.rb +1 -0
- data/spec/pluggability_spec.rb +7 -1
- data.tar.gz.sig +0 -0
- metadata +49 -116
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -942
- data/Manifest.txt +0 -8
- data/Rakefile +0 -87
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4484023e3e262179c2c404956a61d7b2f45e39a4f35ec3a467ebb58487248a8c
|
4
|
+
data.tar.gz: 18c4dc97074347467326b56caaee97d198224179b5a2b927653999f3ef65cca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91ad9882dbe4106aeb597d48400a5e2ca9e83fb89ac3961f6cacbd20bd2fdeb437e4b3e1e16bcefe4822c468865c91b82ba12dbdb311f6add6728de95dd46b4
|
7
|
+
data.tar.gz: 74b488aee0aae9ff89b74631f1a412b27356a51f3e62653d61715226871bd685ae9051880d5f26c573049b9944fbc50b239b86becae8b185d19e7e373180d2d7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
|
+
# Release History for pluggability
|
2
|
+
|
3
|
+
---
|
4
|
+
## v0.8.0 [2022-12-01] Michael Granger <ged@faeriemud.org>
|
5
|
+
|
6
|
+
Improvements:
|
7
|
+
|
8
|
+
- Change default Ruby to 3.1
|
9
|
+
- Fix support for classes with number in their name
|
10
|
+
|
11
|
+
|
12
|
+
## v0.7.0 [2020-02-05] Michael Granger <ged@faeriemud.org>
|
13
|
+
|
14
|
+
Improvements:
|
15
|
+
|
16
|
+
- Updated for Ruby 2.7
|
17
|
+
|
18
|
+
|
1
19
|
## v0.6.0 [2018-03-12] Michael Granger <ged@FaerieMUD.org>
|
2
20
|
|
21
|
+
Bugfix:
|
22
|
+
|
3
23
|
- Switch back to require for loading derivatives
|
4
24
|
|
5
25
|
|
data/README.md
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
# pluggability
|
2
2
|
|
3
|
-
|
4
|
-
: https://
|
3
|
+
home
|
4
|
+
: https://hg.sr.ht/~ged/Pluggability
|
5
5
|
|
6
6
|
docs
|
7
|
-
:
|
7
|
+
: https://deveiate.org/code/pluggability
|
8
|
+
|
9
|
+
code
|
10
|
+
: https://hg.sr.ht/~ged/Pluggability/browse
|
8
11
|
|
9
12
|
github
|
10
|
-
:
|
13
|
+
: https://github.com/ged/pluggability
|
11
14
|
|
12
15
|
|
13
16
|
## Description
|
@@ -239,9 +242,15 @@ This task will install any missing dependencies, run the tests/specs,
|
|
239
242
|
and generate the API documentation.
|
240
243
|
|
241
244
|
|
245
|
+
## Authors
|
246
|
+
|
247
|
+
- Michael Granger <ged@faeriemud.org>
|
248
|
+
- Martin Chase <outofculture@gmail.com>
|
249
|
+
|
250
|
+
|
242
251
|
## License
|
243
252
|
|
244
|
-
Copyright (c) 2008-
|
253
|
+
Copyright (c) 2008-2020, Michael Granger and Martin Chase
|
245
254
|
All rights reserved.
|
246
255
|
|
247
256
|
Redistribution and use in source and binary forms, with or without
|
data/lib/pluggability.rb
CHANGED
@@ -12,7 +12,7 @@ module Pluggability
|
|
12
12
|
|
13
13
|
|
14
14
|
# Library version
|
15
|
-
VERSION = '0.
|
15
|
+
VERSION = '0.8.0'
|
16
16
|
|
17
17
|
|
18
18
|
# An exception class for Pluggability specific errors.
|
@@ -170,7 +170,7 @@ module Pluggability
|
|
170
170
|
|
171
171
|
simple_name = subclass.name.sub( /^.*::/i, '' ).sub( /\W+$/, '' )
|
172
172
|
keys << simple_name << simple_name.downcase
|
173
|
-
keys << simple_name.gsub( /([a-
|
173
|
+
keys << simple_name.gsub( /([a-z0-9])([A-Z])/, "\\1_\\2" ).downcase
|
174
174
|
|
175
175
|
# Handle class names like 'FooBar' for 'Bar' factories.
|
176
176
|
Pluggability.log.debug "Inherited %p for %p-type plugins" % [ subclass, self.plugin_type ]
|
@@ -346,7 +346,7 @@ module Pluggability
|
|
346
346
|
raise Pluggability::PluginError, errmsg
|
347
347
|
end
|
348
348
|
|
349
|
-
Kernel.require( plugin_path
|
349
|
+
Kernel.require( plugin_path )
|
350
350
|
|
351
351
|
return plugin_path
|
352
352
|
end
|
data/spec/helpers.rb
CHANGED
data/spec/pluggability_spec.rb
CHANGED
@@ -17,6 +17,7 @@ end
|
|
17
17
|
class SubPlugin < Plugin; end
|
18
18
|
class TestingPlugin < Plugin; end
|
19
19
|
class BlackSheep < Plugin; end
|
20
|
+
class Carbon14Robot < Plugin; end
|
20
21
|
module Test
|
21
22
|
class LoadablePlugin < Plugin; end
|
22
23
|
end
|
@@ -35,7 +36,6 @@ describe Pluggability do
|
|
35
36
|
end
|
36
37
|
|
37
38
|
|
38
|
-
|
39
39
|
it "allows extended objects to declare one or more prefixes to use when requiring derviatives" do
|
40
40
|
expect( Plugin.plugin_prefixes ).to eq( ['plugins', 'plugins/private'] )
|
41
41
|
end
|
@@ -179,6 +179,7 @@ describe Pluggability do
|
|
179
179
|
Plugin.load_all
|
180
180
|
end
|
181
181
|
|
182
|
+
|
182
183
|
it "doesn't preload derivatives whose path matches a Regexp exclusion" do
|
183
184
|
expect( Gem ).to receive( :find_latest_files ).with( 'plugins/*.rb' ).
|
184
185
|
and_return([ '/path/to/plugins/first.rb' ])
|
@@ -247,6 +248,11 @@ describe Pluggability do
|
|
247
248
|
end
|
248
249
|
|
249
250
|
|
251
|
+
it "works for classes with numbers in them too" do
|
252
|
+
expect( Plugin.create('carbon14_robot') ).to be_an_instance_of( Carbon14Robot )
|
253
|
+
end
|
254
|
+
|
255
|
+
|
250
256
|
it "knows what the simplest version of its plugin name is" do
|
251
257
|
expect( BlackSheep.plugin_name ).to eq( 'black_sheep' )
|
252
258
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,42 +1,40 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluggability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Martin Chase
|
8
7
|
- Michael Granger
|
9
|
-
|
8
|
+
- Martin Chase
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
+
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
X0qdrKi+2aZZ0NGuFj9AItBsVmAvkBGIpX4TEKQp5haEbPpmaqO5nIIhV26PXmyT
|
37
|
-
OMKv6pWsoS81vw5KAGBmfX8nht/Py90DQrbRvakATGI=
|
14
|
+
MIID+DCCAmCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
15
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMjAxMDcyMzU4MTRaFw0yMzAxMDcyMzU4
|
16
|
+
MTRaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
17
|
+
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
18
|
+
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
19
|
+
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm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RiWTTuhgHrdDnGdXg93N2M5KHn1ug8BtPLQwlcFwEpKnlLn
|
35
|
+
btEP+7EplFuoiMfd
|
38
36
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
37
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
40
38
|
dependencies:
|
41
39
|
- !ruby/object:Gem::Dependency
|
42
40
|
name: loggability
|
@@ -44,44 +42,30 @@ dependencies:
|
|
44
42
|
requirements:
|
45
43
|
- - "~>"
|
46
44
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
45
|
+
version: '0.15'
|
48
46
|
type: :runtime
|
49
47
|
prerelease: false
|
50
48
|
version_requirements: !ruby/object:Gem::Requirement
|
51
49
|
requirements:
|
52
50
|
- - "~>"
|
53
51
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: hoe-mercurial
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.4'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.4'
|
52
|
+
version: '0.15'
|
69
53
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
54
|
+
name: rake-deveiate
|
71
55
|
requirement: !ruby/object:Gem::Requirement
|
72
56
|
requirements:
|
73
57
|
- - "~>"
|
74
58
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
59
|
+
version: '0.21'
|
76
60
|
type: :development
|
77
61
|
prerelease: false
|
78
62
|
version_requirements: !ruby/object:Gem::Requirement
|
79
63
|
requirements:
|
80
64
|
- - "~>"
|
81
65
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
66
|
+
version: '0.21'
|
83
67
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
68
|
+
name: rdoc-generator-sixfish
|
85
69
|
requirement: !ruby/object:Gem::Requirement
|
86
70
|
requirements:
|
87
71
|
- - "~>"
|
@@ -94,96 +78,45 @@ dependencies:
|
|
94
78
|
- - "~>"
|
95
79
|
- !ruby/object:Gem::Version
|
96
80
|
version: '0.2'
|
97
|
-
|
98
|
-
name: rdoc
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '5.1'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '5.1'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: hoe
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.16'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '3.16'
|
125
|
-
description: "Pluggability is a toolkit for creating plugins.\n\nIt provides a mixin
|
126
|
-
that extends your class with methods to load and instantiate its subclasses by name.
|
127
|
-
So instead of:\n\n require 'acme/adapter/png'\n png_adapter = Acme::Adapter::PNG.new(
|
128
|
-
'file.png' )\n \nyou can do:\n\n require 'acme/adapter'\n png_adapter = Acme::Adapter.create(
|
129
|
-
:png, 'file.png' )\n\nA full example of where this might be useful is in a program
|
130
|
-
which generates\noutput with a 'driver' object, which provides a unified interface
|
131
|
-
but generates\ndifferent kinds of output.\n\nFirst the abstract base class, which
|
132
|
-
is extended with Pluggability:\n\n # in mygem/driver.rb:\n require 'pluggability'\n
|
133
|
-
\ require 'mygem' unless defined?( MyGem )\n \n class MyGem::Driver\n extend
|
134
|
-
Pluggability\n plugin_prefixes \"mygem/drivers\"\n end\n\nWe can have
|
135
|
-
one driver that outputs PDF documents:\n\n # mygem/drivers/pdf.rb:\n require
|
136
|
-
'mygem/driver' unless defined?( MyGem::Driver )\n \n class MyGem::Driver::PDF
|
137
|
-
< Driver\n ...implementation...\n end\n\nand another that outputs plain
|
138
|
-
ascii text:\n\n #mygem/drivers/ascii.rb:\n require 'mygem/driver' unless defined?(
|
139
|
-
MyGem::Driver )\n \n class MyGem::Driver::ASCII < Driver\n ...implementation...\n
|
140
|
-
\ end\n\nNow the driver is configurable by the end-user, who can just set\nit
|
141
|
-
by its short name:\n\n require 'mygem'\n \n config[:driver_type] #=> \"pdf\"\n
|
142
|
-
\ driver = MyGem::Driver.create( config[:driver_type] )\n driver.class #=>
|
143
|
-
MyGem::Driver::PDF\n\n # You can also pass arguments to the constructor, too:\n
|
144
|
-
\ ascii_driver = MyGem::Driver.create( :ascii, :columns => 80 )"
|
81
|
+
description: Pluggability is a toolkit for creating plugins.
|
145
82
|
email:
|
146
|
-
-
|
147
|
-
-
|
83
|
+
- ged@faeriemud.org
|
84
|
+
- outofculture@gmail.com
|
148
85
|
executables: []
|
149
86
|
extensions: []
|
150
|
-
extra_rdoc_files:
|
151
|
-
- History.md
|
152
|
-
- Manifest.txt
|
153
|
-
- README.md
|
87
|
+
extra_rdoc_files: []
|
154
88
|
files:
|
155
|
-
- ChangeLog
|
156
89
|
- History.md
|
157
|
-
- Manifest.txt
|
158
90
|
- README.md
|
159
|
-
- Rakefile
|
160
91
|
- lib/pluggability.rb
|
161
92
|
- spec/helpers.rb
|
162
93
|
- spec/pluggability_spec.rb
|
163
|
-
homepage:
|
94
|
+
homepage: https://hg.sr.ht/~ged/Pluggability
|
164
95
|
licenses:
|
165
96
|
- BSD-3-Clause
|
166
|
-
metadata:
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
97
|
+
metadata:
|
98
|
+
homepage_uri: https://hg.sr.ht/~ged/Pluggability
|
99
|
+
documentation_uri: https://deveiate.org/code/pluggability
|
100
|
+
changelog_uri: https://deveiate.org/code/pluggability/History_md.html
|
101
|
+
source_uri: https://hg.sr.ht/~ged/Pluggability/browse
|
102
|
+
bug_tracker_uri: https://todo.sr.ht/~ged/Pluggability/browse
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
171
105
|
require_paths:
|
172
106
|
- lib
|
173
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
174
108
|
requirements:
|
175
109
|
- - ">="
|
176
110
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
111
|
+
version: '0'
|
178
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
113
|
requirements:
|
180
114
|
- - ">="
|
181
115
|
- !ruby/object:Gem::Version
|
182
116
|
version: '0'
|
183
117
|
requirements: []
|
184
|
-
|
185
|
-
|
186
|
-
signing_key:
|
118
|
+
rubygems_version: 3.3.7
|
119
|
+
signing_key:
|
187
120
|
specification_version: 4
|
188
|
-
summary: Pluggability is a toolkit for creating plugins
|
121
|
+
summary: Pluggability is a toolkit for creating plugins.
|
189
122
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|