pluggability 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e540538307554e6530b3aceb32cdcc5943819fb5
4
+ data.tar.gz: 7c1548aa2c9959d938bcfebfd62896727a9f02f0
5
+ SHA512:
6
+ metadata.gz: b2a7beb87ff1f941522f4467db3caf61bac30f3d520962bce63c2a029f97f3d04ab6d4294e315f6c6349899afa3f766ef7b905d41564514ba08d38c807ff5c0a
7
+ data.tar.gz: 3a717ceb7a3d075691c36e0a520d8de3ca416bb25e2e13f59d560aa852a904fbe34392bd4e1ed3d685ff8d90e8fe833771fbe4b9d6e72666636cc62fb0906938
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ �Şۉ� C��R�j��
2
+ BG��2[r�(�⁵��~�glQ3R�]u����p�X6k)M�w3n�Cέ.��}F ����Nl�:Կc�x#�]��uZ�[�U(\�k/�m g>�:��f�Fe�i��Y�ӏt����<���n%���0��iCNF�=�;Q!�W�00t���s��|+*�~�F�S)�Q���_�*
3
+ %�7���%���#�kɷ�a�~@�Y.S�6���D)��
data/ChangeLog CHANGED
@@ -1,13 +1,40 @@
1
+ 2013-03-01 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .rvmrc, History.rdoc, lib/pluggability.rb:
4
+ Bump patch version, update history.
5
+ [41c55c0e6830] [tip]
6
+
7
+ 2012-08-13 Michael Granger <ged@FaerieMUD.org>
8
+
9
+ * lib/pluggability.rb, spec/pluggability_spec.rb:
10
+ Simplify Pluggability#derivatives.
11
+ [7feffaf62b71]
12
+
13
+ 2012-08-06 Michael Granger <ged@FaerieMUD.org>
14
+
15
+ * README.rdoc, Rakefile, experiments/logger_output.rb:
16
+ Update docs.
17
+ [2ae57144e2df]
18
+
1
19
  2012-08-03 Michael Granger <ged@FaerieMUD.org>
2
20
 
21
+ * .hgtags:
22
+ Added tag v0.0.1 for changeset 379015772893
23
+ [f66a50774525]
24
+
25
+ * lib/pluggability.rb, spec/pluggability_spec.rb:
26
+ Fix specs for FactoryError changes; add backward-compatibility
27
+ constant.
28
+ [379015772893] [v0.0.1]
29
+
3
30
  * .rvm.gems, History.rdoc, Rakefile, lib/pluggability.rb,
4
31
  spec/pluggability_spec.rb:
5
32
  Finish up conversion to Pluggability
6
- [712f06e0174e] [pluggability.patch, qbase, qtip, tip]
33
+ [a5ca03df63cf]
7
34
 
8
35
  * .hgtags:
9
36
  Removed tag release
10
- [71aae8059784] [qparent]
37
+ [71aae8059784]
11
38
 
12
39
  * .hgtags:
13
40
  Removed tag RELEASE_0_01
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == v0.0.2 [2012-08-13] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Simplify Pluggability#derivatives.
4
+
5
+
1
6
  == v0.0.1 [2012-08-03] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  First release after renaming from PluginFactory.
data/README.rdoc CHANGED
@@ -1,187 +1,197 @@
1
1
  = pluggability
2
2
 
3
- * http://deveiate.org/projects/Pluggability
3
+ project:: https://bitbucket.org/ged/pluggability
4
+ docs :: http://deveiate.org/code/pluggability
5
+ github :: http://github.com/ged/pluggability
4
6
 
5
7
 
6
8
  == Description
7
9
 
8
- Pluggability is a mixin module that turns an including class into a factory for
9
- its derivatives, capable of searching for and loading them by name. This is
10
- useful when you have an abstract base class which defines an interface and basic
11
- functionality for a part of a larger system, and a collection of subclasses
12
- which implement the interface for different underlying functionality.
13
-
14
- An example of where this might be useful is in a program which talks to a
15
- database. To avoid coupling it to a specific database, you use a Driver class
16
- which encapsulates your program's interaction with the database behind a useful
17
- interface. Now you can create a concrete implementation of the Driver class for
18
- each kind of database you wish to talk to. If you make the base Driver class a
19
- Pluggability, too, you can add new drivers simply by dropping them in a
20
- directory and using the Driver's `create` method to instantiate them:
21
-
22
- === Synopsis
23
-
24
- in driver.rb:
25
-
26
- require "Pluggability"
27
-
28
- class Driver
29
- include Pluggability
30
- def self::derivative_dirs
31
- ["drivers"]
32
- end
33
- end
34
-
35
- in drivers/mysql.rb:
36
-
37
- require 'driver'
38
-
39
- class MysqlDriver < Driver
40
- ...implementation...
41
- end
42
-
43
- in /usr/lib/ruby/1.8/PostgresDriver.rb:
44
-
45
- require 'driver'
46
-
47
- class PostgresDriver < Driver
48
- ...implementation...
49
- end
50
-
51
- elsewhere
52
-
53
- require 'driver'
54
-
55
- config[:driver_type] #=> "mysql"
56
- driver = Driver.create( config[:driver_type] )
57
- driver.class #=> MysqlDriver
58
- pgdriver = Driver.create( "PostGresDriver" )
10
+ Pluggability is a mixin module that turns an including class into a
11
+ factory for its derivatives, capable of searching for and loading them
12
+ by name. This is useful when you have an abstract base class which
13
+ defines an interface and basic functionality for a part of a larger
14
+ system, and a collection of subclasses which implement the interface for
15
+ different underlying functionality.
16
+
17
+ An example of where this might be useful is in a program which generates
18
+ output with a 'driver' object, which provides a unified interface but
19
+ generates different kinds of output.
20
+
21
+ First the abstract base class, which is extended with Pluggability:
22
+
23
+ # in mygem/driver.rb:
24
+ require 'pluggability'
25
+ require 'mygem' unless defined?( MyGem )
26
+
27
+ class MyGem::Driver
28
+ extend Pluggability
29
+ plugin_prefixes "drivers", "drivers/compat"
30
+ end
31
+
32
+ We can have one driver that outputs PDF documents:
33
+
34
+ # mygem/drivers/pdf.rb:
35
+ require 'mygem/driver' unless defined?( MyGem::Driver )
36
+
37
+ class MyGem::Driver::PDF < Driver
38
+ ...implementation...
39
+ end
40
+
41
+ and another that outputs plain ascii text:
42
+
43
+ #mygem/drivers/ascii.rb:
44
+ require 'mygem/driver' unless defined?( MyGem::Driver )
45
+
46
+ class MyGem::Driver::ASCII < Driver
47
+ ...implementation...
48
+ end
49
+
50
+ Now the driver is configurable by the end-user, who can just set
51
+ it by its short name:
52
+
53
+ require 'mygem'
54
+
55
+ config[:driver_type] #=> "pdf"
56
+ driver = MyGem::Driver.create( config[:driver_type] )
57
+ driver.class #=> MyGem::Driver::PDF
58
+
59
+ # You can also pass arguments to the constructor, too:
60
+ ascii_driver = MyGem::Driver.create( :ascii, :columns => 80 )
61
+
59
62
 
60
63
  === How Plugins Are Loaded
61
64
 
62
- The +create+ class method added to your class by Pluggability searches for your
63
- module using several different strategies. It tries various permutations of the
64
- base class's name in combination with the derivative requested. For example,
65
- assume we want to make a +DataDriver+ base class, and then use plugins to define
66
- drivers for different kinds of data sources:
65
+ The +create+ class method added to your class by Pluggability searches
66
+ for your module using several different strategies. It tries various
67
+ permutations of the base class's name in combination with the derivative
68
+ requested. For example, assume we want to make a +LogReader+ base
69
+ class, and then use plugins to define readers for different log
70
+ formats:
71
+
72
+ require 'pluggability'
73
+
74
+ class LogReader
75
+ extend Pluggability
67
76
 
68
- require 'pluggability'
69
-
70
- class DataDriver
71
- include Pluggability
72
- end
77
+ def read_from_file( path ); end
78
+ end
73
79
 
74
- When you attempt to load the 'socket' data-driver class like so:
80
+ When you attempt to load the 'apache' data-driver class like so:
75
81
 
76
- DataDriver.create( 'socket' )
82
+ LogReader.create( 'apache' )
77
83
 
78
84
  Pluggability searches for modules with the following names:
79
85
 
80
- 'socketdatadriver'
81
- 'socket_datadriver'
82
- 'socketDataDriver'
83
- 'socket_DataDriver'
84
- 'SocketDataDriver'
85
- 'Socket_DataDriver'
86
- 'socket'
87
- 'Socket'
88
-
89
- Obviously the last one will load something other than what is intended, so you
90
- can also tell Pluggability that plugins should be loaded from a subdirectory by
91
- declaring a class method called `derivative_dirs` in the base class. It should
92
- return an Array that contains a list of subdirectories to try:
93
-
94
- class DataDriver
95
- include Pluggability
96
-
97
- def self::derivative_dirs
98
- ['drivers']
99
- end
100
- end
86
+ 'apachedatadriver'
87
+ 'apache_datadriver'
88
+ 'apacheLogReader'
89
+ 'apache_LogReader'
90
+ 'ApacheLogReader'
91
+ 'Apache_LogReader'
92
+ 'apache'
93
+ 'Apache'
94
+
95
+ Obviously the last one will load something other than what is intended,
96
+ so you can also tell Pluggability that plugins should be loaded from a
97
+ subdirectory by declaring one or more +plugin_prefixes+ in the base
98
+ class. Each prefix will be tried (in the order they're declared) when
99
+ searching for a subclass:
100
+
101
+ class LogReader
102
+ extend Pluggability
103
+ plugin_prefixes 'drivers'
104
+ end
101
105
 
102
106
  This will change the list that is required to:
103
107
 
104
- 'drivers/socketdatadriver'
105
- 'drivers/socket_datadriver'
106
- 'drivers/socketDataDriver'
107
- 'drivers/socket_DataDriver'
108
- 'drivers/SocketDataDriver'
109
- 'drivers/Socket_DataDriver'
110
- 'drivers/socket'
111
- 'drivers/Socket'
112
-
113
- If you return more than one subdirectory, each of them will be tried in turn:
114
-
115
- class DataDriver
116
- include Pluggability
117
-
118
- def self::derivative_dirs
119
- ['drivers', 'datadriver']
120
- end
121
- end
108
+ 'drivers/apachedatadriver'
109
+ 'drivers/apache_datadriver'
110
+ 'drivers/apacheLogReader'
111
+ 'drivers/apache_LogReader'
112
+ 'drivers/ApacheLogReader'
113
+ 'drivers/Apache_LogReader'
114
+ 'drivers/apache'
115
+ 'drivers/Apache'
116
+
117
+ If you return more than one subdirectory, each of them will be tried in
118
+ turn:
119
+
120
+ class LogReader
121
+ extend Pluggability
122
+ plugin_prefixes 'drivers', 'datadriver'
123
+ end
122
124
 
123
125
  will change the search to include:
124
126
 
125
- 'drivers/socketdatadriver'
126
- 'drivers/socket_datadriver'
127
- 'drivers/socketDataDriver'
128
- 'drivers/socket_DataDriver'
129
- 'drivers/SocketDataDriver'
130
- 'drivers/Socket_DataDriver'
131
- 'drivers/socket'
132
- 'drivers/Socket'
133
- 'datadriver/socketdatadriver'
134
- 'datadriver/socket_datadriver'
135
- 'datadriver/socketDataDriver'
136
- 'datadriver/socket_DataDriver'
137
- 'datadriver/SocketDataDriver'
138
- 'datadriver/Socket_DataDriver'
139
- 'datadriver/socket'
140
- 'datadriver/Socket'
141
-
142
- If the plugin is not found, a FactoryError is raised, and the message will list
143
- all the permutations that were tried.
127
+ 'drivers/apachedatadriver'
128
+ 'drivers/apache_datadriver'
129
+ 'drivers/apacheLogReader'
130
+ 'drivers/apache_LogReader'
131
+ 'drivers/ApacheLogReader'
132
+ 'drivers/Apache_LogReader'
133
+ 'drivers/apache'
134
+ 'drivers/Apache'
135
+ 'datadriver/apachedatadriver'
136
+ 'datadriver/apache_datadriver'
137
+ 'datadriver/apacheLogReader'
138
+ 'datadriver/apache_LogReader'
139
+ 'datadriver/ApacheLogReader'
140
+ 'datadriver/Apache_LogReader'
141
+ 'datadriver/apache'
142
+ 'datadriver/Apache'
143
+
144
+ If the plugin is not found, a Pluggability::FactoryError is raised, and
145
+ the message will list all the permutations that were tried.
146
+
144
147
 
145
148
  === Logging
146
149
 
147
- If you need a little more insight into what's going on, Pluggability uses
148
- 'Logger' from the standard library. Just set its logger to your own to include
149
- log messages about plugins being loaded:
150
-
151
-
152
- require 'pluggability'
153
- require 'logger'
154
-
155
- class DataDriver
156
- include Pluggability
157
-
158
- end
159
-
160
- $logger = Logger.new( $stderr )
161
- $logger.level = Logger::DEBUG
162
- Pluggability.logger = $logger
163
-
164
- DataDriver.create( 'ringbuffer' )
150
+ If you need a little more insight into what's going on, Pluggability
151
+ uses the "Loggability":https://rubygems.org/gems/loggability library.
152
+ Just set the log level to 'debug' and it'll explain what's going on:
153
+
154
+ require 'pluggability'
155
+ require 'loggability'
156
+
157
+ class LogReader
158
+ extend Pluggability
159
+ end
160
+
161
+ # Global level
162
+ Loggability.level = :debug
163
+
164
+ # Or just Pluggability's level:
165
+ Pluggability.logger.level = :debug
166
+
167
+ LogReader.create( 'ringbuffer' )
165
168
 
166
169
  this might generate a log that looks like:
167
170
 
168
- D, [...] DEBUG -- : Loading derivative ringbuffer
169
- D, [...] DEBUG -- : Subdirs are: [""]
170
- D, [...] DEBUG -- : Path is: ["ringbufferdatadriver", "ringbufferDataDriver",
171
- "ringbuffer"]...
172
- D, [...] DEBUG -- : Trying ringbufferdatadriver...
173
- D, [...] DEBUG -- : No module at 'ringbufferdatadriver', trying the next
174
- alternative: 'no such file to load -- ringbufferdatadriver'
175
- D, [...] DEBUG -- : Trying ringbufferDataDriver...
176
- D, [...] DEBUG -- : No module at 'ringbufferDataDriver', trying the next
177
- alternative: 'no such file to load -- ringbufferDataDriver'
178
- D, [...] DEBUG -- : Trying ringbuffer...
179
- D, [...] DEBUG -- : No module at 'ringbuffer', trying the next alternative:
180
- 'no such file to load -- ringbuffer'
181
- D, [...] DEBUG -- : fatals = []
182
- E, [...] ERROR -- : Couldn't find a DataDriver named 'ringbuffer':
183
- tried ["ringbufferdatadriver", "ringbufferDataDriver", "ringbuffer"]
184
-
171
+ [...] debug {} -- Loading derivative ringbuffer
172
+ [...] debug {} -- Subdirs are: [""]
173
+ [...] debug {} -- Path is: ["ringbuffer_datadriver",
174
+ "ringbuffer_LogReader", "ringbufferdatadriver",
175
+ "ringbufferLogReader", "ringbuffer"]...
176
+ [...] debug {} -- Trying ringbuffer_datadriver...
177
+ [...] debug {} -- No module at 'ringbuffer_datadriver', trying the
178
+ next alternative: 'cannot load such file -- ringbuffer_datadriver'
179
+ [...] debug {} -- Trying ringbuffer_LogReader...
180
+ [...] debug {} -- No module at 'ringbuffer_LogReader', trying the
181
+ next alternative: 'cannot load such file -- ringbuffer_LogReader'
182
+ [...] debug {} -- Trying ringbufferdatadriver...
183
+ [...] debug {} -- No module at 'ringbufferdatadriver', trying the
184
+ next alternative: 'cannot load such file -- ringbufferdatadriver'
185
+ [...] debug {} -- Trying ringbufferLogReader...
186
+ [...] debug {} -- No module at 'ringbufferLogReader', trying the
187
+ next alternative: 'cannot load such file -- ringbufferLogReader'
188
+ [...] debug {} -- Trying ringbuffer...
189
+ [...] debug {} -- No module at 'ringbuffer', trying the next
190
+ alternative: 'cannot load such file -- ringbuffer'
191
+ [...] debug {} -- fatals = []
192
+ [...] error {} -- Couldn't find a LogReader named 'ringbuffer':
193
+ tried ["ringbuffer_datadriver", "ringbuffer_LogReader",
194
+ "ringbufferdatadriver", "ringbufferLogReader", "ringbuffer"]
185
195
 
186
196
 
187
197
  == Installation
@@ -192,8 +202,8 @@ this might generate a log that looks like:
192
202
  == Contributing
193
203
 
194
204
  You can check out the current development source with Mercurial via its
195
- {Mercurial repo}[http://repo.deveiate.org/Pluggability]. Or if you prefer
196
- Git, via {its Github mirror}[https://github.com/ged/pluggability].
205
+ {Mercurial repo}[https://bitbucket.org/ged/pluggability]. Or if you
206
+ prefer Git, via {its Github mirror}[https://github.com/ged/pluggability].
197
207
 
198
208
  After checking out the source, run:
199
209
 
data/Rakefile CHANGED
@@ -22,6 +22,8 @@ hoespec = Hoe.spec 'pluggability' do
22
22
  self.dependency 'hoe-deveiate', '~> 0.1', :development
23
23
 
24
24
  self.spec_extras[:licenses] = ["BSD"]
25
+ self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
26
+ self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
25
27
  self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
26
28
  end
27
29
 
data/lib/pluggability.rb CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env ruby -w
1
+ # -*- ruby -*-
2
+ #encoding: utf-8
2
3
 
3
4
  require 'loggability' unless defined?( Loggability )
4
5
 
5
-
6
6
  # The Pluggability module
7
7
  module Pluggability
8
8
  extend Loggability
@@ -12,7 +12,7 @@ module Pluggability
12
12
 
13
13
 
14
14
  # Library version
15
- VERSION = '0.0.1'
15
+ VERSION = '0.0.2'
16
16
 
17
17
 
18
18
  ### An exception class for Pluggability specific errors.
@@ -49,12 +49,8 @@ module Pluggability
49
49
  ### Return the Hash of derivative classes, keyed by various versions of
50
50
  ### the class name.
51
51
  def derivatives
52
- ancestors.each do |klass|
53
- if klass.instance_variables.include?( :@derivatives ) ||
54
- klass.instance_variables.include?( "@derivatives" )
55
- return klass.instance_variable_get( :@derivatives )
56
- end
57
- end
52
+ return super unless defined?( @derivatives )
53
+ return @derivatives
58
54
  end
59
55
 
60
56
 
@@ -83,6 +79,7 @@ module Pluggability
83
79
  ### Inheritance callback -- Register subclasses in the derivatives hash
84
80
  ### so that ::create knows about them.
85
81
  def inherited( subclass )
82
+ Pluggability.logger.debug "%p inherited by %p" % [ self, subclass ]
86
83
  keys = [ subclass ]
87
84
 
88
85
  # If it's not an anonymous class, make some keys out of variants of its name
@@ -11,11 +11,14 @@ BEGIN {
11
11
  }
12
12
 
13
13
  require 'rspec'
14
- require 'logger'
15
14
  require 'pluggability'
16
-
17
15
  require 'spec/lib/helpers'
18
16
 
17
+
18
+ #
19
+ # Testing classes
20
+ #
21
+
19
22
  class Plugin
20
23
  extend Pluggability
21
24
  plugin_prefixes 'plugins', 'plugins/private'
@@ -29,6 +32,9 @@ module Test
29
32
  end
30
33
 
31
34
 
35
+ #
36
+ # Examples
37
+ #
32
38
  describe Pluggability do
33
39
 
34
40
  before( :each ) do
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluggability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Martin Chase
@@ -10,39 +9,33 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain:
13
- - !binary |-
14
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMRENDQWhTZ0F3SUJB
15
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE4TVF3d0NnWURWUVFEREFOblpX
16
- UXgKRnpBVkJnb0praWFKay9Jc1pBRVpGZ2RmWVdWeWFXVmZNUk13RVFZS0Na
17
- SW1pWlB5TEdRQkdSWURiM0puTUI0WApEVEV3TURreE5qRTBORGcxTVZvWERU
18
- RXhNRGt4TmpFME5EZzFNVm93UERFTU1Bb0dBMVVFQXd3RFoyVmtNUmN3CkZR
19
- WUtDWkltaVpQeUxHUUJHUllIWDJGbGNtbGxYekVUTUJFR0NnbVNKb21UOGl4
20
- a0FSa1dBMjl5WnpDQ0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WRARmFlcmllTVVELm9yZzAc
26
+ BgNVHRIEFTATgRFnZWRARmFlcmllTVVELm9yZzANBgkqhkiG9w0BAQUFAAOCAQEA
27
+ Vlcfyq6GwyE8i0QuFPCeVOwJaneSvcwx316DApjy9/tt2YD2HomLbtpXtji5QXor
28
+ ON6oln4tWBIB3Klbr3szq5oR3Rc1D02SaBTalxSndp4M6UkW9hRFu5jn98pDB4fq
29
+ 5l8wMMU0Xdmqx1VYvysVAjVFVC/W4NNvlmg+2mEgSVZP5K6Tc9qDh3eMQInoYw6h
30
+ t1YA6RsUJHp5vGQyhP1x34YpLAaly8icbns/8PqOf7Osn9ztmg8bOMJCeb32eQLj
31
+ 6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
32
+ /YSusaiDXHKU2O3Akc3htA==
33
+ -----END CERTIFICATE-----
34
+ date: 2013-03-01 00:00:00.000000000 Z
41
35
  dependencies:
42
36
  - !ruby/object:Gem::Dependency
43
37
  name: loggability
44
38
  requirement: !ruby/object:Gem::Requirement
45
- none: false
46
39
  requirements:
47
40
  - - ~>
48
41
  - !ruby/object:Gem::Version
@@ -50,7 +43,6 @@ dependencies:
50
43
  type: :runtime
51
44
  prerelease: false
52
45
  version_requirements: !ruby/object:Gem::Requirement
53
- none: false
54
46
  requirements:
55
47
  - - ~>
56
48
  - !ruby/object:Gem::Version
@@ -58,7 +50,6 @@ dependencies:
58
50
  - !ruby/object:Gem::Dependency
59
51
  name: hoe-mercurial
60
52
  requirement: !ruby/object:Gem::Requirement
61
- none: false
62
53
  requirements:
63
54
  - - ~>
64
55
  - !ruby/object:Gem::Version
@@ -66,7 +57,6 @@ dependencies:
66
57
  type: :development
67
58
  prerelease: false
68
59
  version_requirements: !ruby/object:Gem::Requirement
69
- none: false
70
60
  requirements:
71
61
  - - ~>
72
62
  - !ruby/object:Gem::Version
@@ -74,7 +64,6 @@ dependencies:
74
64
  - !ruby/object:Gem::Dependency
75
65
  name: hoe-highline
76
66
  requirement: !ruby/object:Gem::Requirement
77
- none: false
78
67
  requirements:
79
68
  - - ~>
80
69
  - !ruby/object:Gem::Version
@@ -82,7 +71,6 @@ dependencies:
82
71
  type: :development
83
72
  prerelease: false
84
73
  version_requirements: !ruby/object:Gem::Requirement
85
- none: false
86
74
  requirements:
87
75
  - - ~>
88
76
  - !ruby/object:Gem::Version
@@ -90,7 +78,6 @@ dependencies:
90
78
  - !ruby/object:Gem::Dependency
91
79
  name: rdoc
92
80
  requirement: !ruby/object:Gem::Requirement
93
- none: false
94
81
  requirements:
95
82
  - - ~>
96
83
  - !ruby/object:Gem::Version
@@ -98,7 +85,6 @@ dependencies:
98
85
  type: :development
99
86
  prerelease: false
100
87
  version_requirements: !ruby/object:Gem::Requirement
101
- none: false
102
88
  requirements:
103
89
  - - ~>
104
90
  - !ruby/object:Gem::Version
@@ -106,7 +92,6 @@ dependencies:
106
92
  - !ruby/object:Gem::Dependency
107
93
  name: hoe-deveiate
108
94
  requirement: !ruby/object:Gem::Requirement
109
- none: false
110
95
  requirements:
111
96
  - - ~>
112
97
  - !ruby/object:Gem::Version
@@ -114,7 +99,6 @@ dependencies:
114
99
  type: :development
115
100
  prerelease: false
116
101
  version_requirements: !ruby/object:Gem::Requirement
117
- none: false
118
102
  requirements:
119
103
  - - ~>
120
104
  - !ruby/object:Gem::Version
@@ -122,44 +106,38 @@ dependencies:
122
106
  - !ruby/object:Gem::Dependency
123
107
  name: hoe
124
108
  requirement: !ruby/object:Gem::Requirement
125
- none: false
126
109
  requirements:
127
110
  - - ~>
128
111
  - !ruby/object:Gem::Version
129
- version: '3.0'
112
+ version: '3.5'
130
113
  type: :development
131
114
  prerelease: false
132
115
  version_requirements: !ruby/object:Gem::Requirement
133
- none: false
134
116
  requirements:
135
117
  - - ~>
136
118
  - !ruby/object:Gem::Version
137
- version: '3.0'
138
- description: ! 'Pluggability is a mixin module that turns an including class into
139
- a factory for
140
-
141
- its derivatives, capable of searching for and loading them by name. This is
142
-
143
- useful when you have an abstract base class which defines an interface and basic
144
-
145
- functionality for a part of a larger system, and a collection of subclasses
146
-
147
- which implement the interface for different underlying functionality.
148
-
149
-
150
- An example of where this might be useful is in a program which talks to a
151
-
152
- database. To avoid coupling it to a specific database, you use a Driver class
153
-
154
- which encapsulates your program''s interaction with the database behind a useful
155
-
156
- interface. Now you can create a concrete implementation of the Driver class for
157
-
158
- each kind of database you wish to talk to. If you make the base Driver class a
159
-
160
- Pluggability, too, you can add new drivers simply by dropping them in a
161
-
162
- directory and using the Driver''s `create` method to instantiate them:'
119
+ version: '3.5'
120
+ description: "Pluggability is a mixin module that turns an including class into a\nfactory
121
+ for its derivatives, capable of searching for and loading them\nby name. This is
122
+ useful when you have an abstract base class which\ndefines an interface and basic
123
+ functionality for a part of a larger\nsystem, and a collection of subclasses which
124
+ implement the interface for\ndifferent underlying functionality.\n\nAn example of
125
+ where this might be useful is in a program which generates\noutput with a 'driver'
126
+ object, which provides a unified interface but\ngenerates different kinds of output.\n\nFirst
127
+ the abstract base class, which is extended with Pluggability:\n\n # in mygem/driver.rb:\n
128
+ \ require 'pluggability'\n require 'mygem' unless defined?( MyGem )\n \n
129
+ \ class MyGem::Driver\n extend Pluggability\n plugin_prefixes \"drivers\",
130
+ \"drivers/compat\"\n end\n\nWe can have one driver that outputs PDF documents:\n\n
131
+ \ # mygem/drivers/pdf.rb:\n require 'mygem/driver' unless defined?( MyGem::Driver
132
+ )\n \n class MyGem::Driver::PDF < Driver\n ...implementation...\n end\n\nand
133
+ another that outputs plain ascii text:\n\n #mygem/drivers/ascii.rb:\n require
134
+ 'mygem/driver' unless defined?( MyGem::Driver )\n \n class MyGem::Driver::ASCII
135
+ < Driver\n ...implementation...\n end\n\nNow the driver is configurable
136
+ by the end-user, who can just set\nit by its short name:\n\n require 'mygem'\n
137
+ \ \n config[:driver_type] #=> \"pdf\"\n driver = MyGem::Driver.create( config[:driver_type]
138
+ )\n driver.class #=> MyGem::Driver::PDF\n\n # You can also pass arguments
139
+ to the constructor, too:\n ascii_driver = MyGem::Driver.create( :ascii, :columns
140
+ => 80 )"
163
141
  email:
164
142
  - stillflame@FaerieMUD.org
165
143
  - ged@FaerieMUD.org
@@ -179,9 +157,10 @@ files:
179
157
  - spec/lib/helpers.rb
180
158
  - spec/pluggability_spec.rb
181
159
  - .gemtest
182
- homepage: http://deveiate.org/projects/Pluggability
160
+ homepage: https://bitbucket.org/ged/pluggability
183
161
  licenses:
184
162
  - BSD
163
+ metadata: {}
185
164
  post_install_message:
186
165
  rdoc_options:
187
166
  - -f
@@ -191,22 +170,20 @@ rdoc_options:
191
170
  require_paths:
192
171
  - lib
193
172
  required_ruby_version: !ruby/object:Gem::Requirement
194
- none: false
195
173
  requirements:
196
- - - ! '>='
174
+ - - '>='
197
175
  - !ruby/object:Gem::Version
198
176
  version: '0'
199
177
  required_rubygems_version: !ruby/object:Gem::Requirement
200
- none: false
201
178
  requirements:
202
- - - ! '>='
179
+ - - '>='
203
180
  - !ruby/object:Gem::Version
204
181
  version: '0'
205
182
  requirements: []
206
183
  rubyforge_project: pluggability
207
- rubygems_version: 1.8.24
184
+ rubygems_version: 2.0.0
208
185
  signing_key:
209
- specification_version: 3
186
+ specification_version: 4
210
187
  summary: Pluggability is a mixin module that turns an including class into a factory
211
188
  for its derivatives, capable of searching for and loading them by name
212
189
  test_files: []
metadata.gz.sig CHANGED
Binary file