gem_plugin 0.2.1 → 0.2.2
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.
- data/LICENSE +39 -42
- data/Rakefile +4 -4
- data/doc/rdoc/classes/GemPlugin.html +3 -3
- data/doc/rdoc/classes/GemPlugin.src/M000001.html +5 -5
- data/doc/rdoc/classes/GemPlugin/Base.html +3 -2
- data/doc/rdoc/classes/GemPlugin/Base.src/M000002.html +6 -6
- data/doc/rdoc/classes/GemPlugin/Base.src/M000003.html +4 -4
- data/doc/rdoc/classes/GemPlugin/Base.src/M000004.html +4 -4
- data/doc/rdoc/classes/GemPlugin/Manager.html +48 -38
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000006.html +12 -8
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000007.html +5 -5
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000008.html +15 -15
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000009.html +4 -4
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000010.html +14 -14
- data/doc/rdoc/classes/GemPlugin/Manager.src/M000011.html +14 -14
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +5 -5
- data/doc/rdoc/files/LICENSE.html +53 -49
- data/doc/rdoc/files/README.html +18 -23
- data/doc/rdoc/files/lib/gem_plugin_rb.html +1 -1
- data/lib/gem_plugin.rb +5 -1
- data/resources/tools/rakehelp.rb +2 -1
- metadata +24 -25
data/LICENSE
CHANGED
@@ -1,58 +1,55 @@
|
|
1
|
-
|
2
|
-
You can redistribute it and/or modify it under
|
3
|
-
or the conditions below:
|
1
|
+
GemPlugin is copyrighted free software by Zed A. Shaw
|
2
|
+
<zedshaw at zedshaw dot com> You can redistribute it and/or modify it under
|
3
|
+
either the terms of the GPL or the conditions below:
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
a) place your modifications in the Public Domain or otherwise make them
|
13
|
+
Freely Available, such as by posting said modifications to Usenet or an
|
14
|
+
equivalent medium, or by allowing the author to include your
|
15
|
+
modifications in the software.
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
c) rename any non-standard executables so the names do not conflict with
|
21
|
+
standard executables, which must also be provided.
|
22
22
|
|
23
|
-
|
23
|
+
d) make other distribution arrangements with the author.
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
3. You may distribute the software in object code or executable
|
26
|
+
form, provided that you do at least ONE of the following:
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
a) distribute the executables and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent) on where
|
30
|
+
to get the original distribution.
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
b) accompany the distribution with the machine-readable source of the
|
33
|
+
software.
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
c) give non-standard executables non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
37
|
|
38
|
-
|
38
|
+
d) make other distribution arrangements with the author.
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under this terms.
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
5. The scripts and library files supplied as input to or produced as
|
45
|
+
output from the software do not automatically fall under the
|
46
|
+
copyright of the software, but belong to whomever generated them,
|
47
|
+
and may be sold commercially, and may be aggregated with this
|
48
|
+
software.
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
software.
|
50
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
51
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
52
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
53
|
+
PURPOSE.
|
53
54
|
|
54
|
-
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
55
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
56
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
57
|
-
PURPOSE.
|
58
55
|
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
|
|
15
15
|
desc "Does a full compile, test run"
|
16
16
|
task :default => [:test, :package]
|
17
17
|
|
18
|
-
version = "0.2.
|
18
|
+
version = "0.2.2"
|
19
19
|
name="gem_plugin"
|
20
20
|
|
21
21
|
setup_gem(name, version) do |spec|
|
@@ -29,13 +29,13 @@ setup_gem(name, version) do |spec|
|
|
29
29
|
end
|
30
30
|
|
31
31
|
task :install => [:test, :package] do
|
32
|
-
sh %{
|
32
|
+
sh %{gem install pkg/#{name}-#{version}}
|
33
33
|
end
|
34
34
|
|
35
35
|
task :uninstall => [:clean] do
|
36
|
-
sh %{
|
36
|
+
sh %{gem uninstall #{name}}
|
37
37
|
end
|
38
38
|
|
39
39
|
task :site => [:rerdoc] do
|
40
|
-
sh %{
|
40
|
+
sh %{ rsync -r doc/rdoc/* rubyforge.org:/var/www/gforge-projects/mongrel/gem_plugin_rdoc/ }
|
41
41
|
end
|
@@ -93,7 +93,7 @@ href="GemPlugin/Manager.html#M000008">GemPlugin::Manager.create</a>("/thing
|
|
93
93
|
and can also pass in options as a second parameter.
|
94
94
|
</p>
|
95
95
|
<p>
|
96
|
-
This isn&#
|
96
|
+
This isn‘t such a big deal, but the power is really from the <a
|
97
97
|
href="GemPlugin/Manager.html#M000006">GemPlugin::Manager.load</a> method.
|
98
98
|
This method will go through the installed gems and require_gem any that
|
99
99
|
depend on the gem_plugin RubyGem. You can arbitrarily include or exclude
|
@@ -102,13 +102,13 @@ when appropriate.
|
|
102
102
|
</p>
|
103
103
|
<p>
|
104
104
|
Since this system was written originally for the Mongrel project
|
105
|
-
that&#
|
105
|
+
that‘ll be the best example of using it.
|
106
106
|
</p>
|
107
107
|
<p>
|
108
108
|
Imagine you have a neat plugin for Mongrel called snazzy_command that gives
|
109
109
|
the mongrel_rails a new command snazzy (like: mongrel_rails snazzy).
|
110
110
|
You‘d like people to be able to grab this plugin if they want and use
|
111
|
-
it, because it&#
|
111
|
+
it, because it‘s snazzy.
|
112
112
|
</p>
|
113
113
|
<p>
|
114
114
|
First thing you do is create a gem of your project and make sure that it
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 282</span>
|
14
|
+
282: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">GemPlugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Plugin</span>(<span class="ruby-identifier">c</span>)
|
15
|
+
283: <span class="ruby-constant">Base</span>.<span class="ruby-identifier">category</span> = <span class="ruby-identifier">c</span>
|
16
|
+
284: <span class="ruby-constant">Base</span>
|
17
|
+
285: <span class="ruby-keyword kw">end</span></pre>
|
18
18
|
</body>
|
19
19
|
</html>
|
@@ -80,8 +80,9 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
-
This base class for plugins really does nothing more than wire up the
|
84
|
-
class into the right category. It is not
|
83
|
+
This base class for plugins really does nothing more than wire up the <a
|
84
|
+
href="Base.html#M000004">new</a> class into the right category. It is not
|
85
|
+
thread-safe yet but will be soon.
|
85
86
|
</p>
|
86
87
|
|
87
88
|
</div>
|
@@ -10,11 +10,11 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 253</span>
|
14
|
+
253: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Base</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
|
15
|
+
254: <span class="ruby-identifier">name</span> = <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
|
16
|
+
255: <span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">register</span>(<span class="ruby-ivar">@@category</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">klass</span>)
|
17
|
+
256: <span class="ruby-ivar">@@category</span> = <span class="ruby-keyword kw">nil</span>
|
18
|
+
257: <span class="ruby-keyword kw">end</span></pre>
|
19
19
|
</body>
|
20
20
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 260</span>
|
14
|
+
260: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Base</span>.<span class="ruby-identifier">category=</span>(<span class="ruby-identifier">category</span>)
|
15
|
+
261: <span class="ruby-ivar">@@category</span> = <span class="ruby-identifier">category</span>
|
16
|
+
262: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 264</span>
|
14
|
+
264: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
|
15
|
+
265: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
16
|
+
266: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -80,12 +80,14 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
-
This class is used by people who use gem plugins (but don&#
|
83
|
+
This class is used by people who use gem plugins (but don‘t
|
84
84
|
necessarily make them) to add plugins to their own systems. It provides a
|
85
|
-
way to load plugins, list them, and
|
85
|
+
way to <a href="Manager.html#M000006">load</a> plugins, list them, and <a
|
86
|
+
href="Manager.html#M000008">create</a> them as needed.
|
86
87
|
</p>
|
87
88
|
<p>
|
88
|
-
It is a singleton so you use like this: GemPlugins::Manager.instance
|
89
|
+
It is a singleton so you use like this: GemPlugins::Manager.instance.<a
|
90
|
+
href="Manager.html#M000006">load</a>
|
89
91
|
</p>
|
90
92
|
|
91
93
|
</div>
|
@@ -179,16 +181,18 @@ It is a singleton so you use like this: GemPlugins::Manager.instance.load
|
|
179
181
|
<div class="method-description">
|
180
182
|
<p>
|
181
183
|
While <a href="Manager.html#M000010">Manager.resource</a> will find
|
182
|
-
arbitrary resources, a special case is when you need to
|
183
|
-
|
184
|
-
normalizes this to be if you have a
|
185
|
-
"resources/defaults.yaml" then you&#
|
186
|
-
|
184
|
+
arbitrary resources, a special case is when you need to <a
|
185
|
+
href="Manager.html#M000006">load</a> a set of configuration defaults. <a
|
186
|
+
href="../GemPlugin.html">GemPlugin</a> normalizes this to be if you have a
|
187
|
+
file "resources/defaults.yaml" then you‘ll be able to <a
|
188
|
+
href="Manager.html#M000006">load</a> them via <a
|
189
|
+
href="Manager.html#M000011">Manager.config</a>.
|
187
190
|
</p>
|
188
191
|
<p>
|
189
192
|
How you use the method is you get the options the user wants set, pass them
|
190
|
-
to Manager.instance.config
|
191
|
-
|
193
|
+
to Manager.instance.<a href="Manager.html#M000011">config</a>, and what you
|
194
|
+
get back is a <a href="Manager.html#M000005">new</a> Hash with the
|
195
|
+
user‘s settings overriding the defaults.
|
192
196
|
</p>
|
193
197
|
<pre>
|
194
198
|
opts = Manager.instance.config "mygem", :age => 12, :max_load => .9
|
@@ -200,8 +204,8 @@ to 12.
|
|
200
204
|
<p>
|
201
205
|
This loads the .yaml file on the fly every time, so doing it a whole lot is
|
202
206
|
very stupid. If you need to make frequent calls to this, call it once with
|
203
|
-
no options (Manager.instance.config)
|
204
|
-
directly from then on.
|
207
|
+
no options (Manager.instance.<a href="Manager.html#M000011">config</a>)
|
208
|
+
then use the returned defaults directly from then on.
|
205
209
|
</p>
|
206
210
|
</div>
|
207
211
|
</div>
|
@@ -219,8 +223,8 @@ directly from then on.
|
|
219
223
|
<div class="method-description">
|
220
224
|
<p>
|
221
225
|
Resolves the given name (should include /category/name) to find the plugin
|
222
|
-
class and create an instance. You can
|
223
|
-
then given to the Plugin to configure it.
|
226
|
+
class and <a href="Manager.html#M000008">create</a> an instance. You can
|
227
|
+
pass a second hash option that is then given to the Plugin to configure it.
|
224
228
|
</p>
|
225
229
|
</div>
|
226
230
|
</div>
|
@@ -238,40 +242,44 @@ then given to the Plugin to configure it.
|
|
238
242
|
<div class="method-description">
|
239
243
|
<p>
|
240
244
|
Responsible for going through the list of available gems and loading any
|
241
|
-
plugins requested. It keeps track of what it&#
|
242
|
-
won&#
|
245
|
+
plugins requested. It keeps track of what it‘s loaded already and
|
246
|
+
won‘t <a href="Manager.html#M000006">load</a> them again.
|
243
247
|
</p>
|
244
248
|
<p>
|
245
249
|
It accepts one parameter which is a hash of gem depends that should include
|
246
250
|
or exclude a gem from being loaded. A gem must depend on gem_plugin to be
|
247
|
-
considered, but then each system has to add it&#
|
251
|
+
considered, but then each system has to add it‘s own INCLUDE to make
|
248
252
|
sure that only plugins related to it are loaded.
|
249
253
|
</p>
|
250
254
|
<p>
|
251
|
-
An example again comes from Mongrel. In order to
|
255
|
+
An example again comes from Mongrel. In order to <a
|
256
|
+
href="Manager.html#M000006">load</a> all Mongrel plugins:
|
252
257
|
</p>
|
253
258
|
<pre>
|
254
259
|
GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE
|
255
260
|
</pre>
|
256
261
|
<p>
|
257
|
-
Which will load all plugins that depend
|
258
|
-
extra thing we do is we delay loading
|
259
|
-
rails is configured. Do do this the
|
262
|
+
Which will <a href="Manager.html#M000006">load</a> all plugins that depend
|
263
|
+
on mongrel AND gem_plugin. Now, one extra thing we do is we delay loading
|
264
|
+
Rails Mongrel plugins until after rails is configured. Do do this the
|
265
|
+
mongrel_rails script has:
|
260
266
|
</p>
|
261
267
|
<p>
|
262
|
-
GemPlugin::Manager.instance.load
|
263
|
-
GemPlugin::INCLUDE, "rails" =>
|
264
|
-
thing to remember is that this is saying
|
265
|
-
depends on gem_plugin, mongrel, but NOT
|
266
|
-
depends on other stuff then it&#
|
267
|
-
mongrel, and rails are ever used to determine
|
268
|
+
GemPlugin::Manager.instance.<a href="Manager.html#M000006">load</a>
|
269
|
+
"mongrel" => GemPlugin::INCLUDE, "rails" =>
|
270
|
+
GemPlugin::EXCLUDE The only thing to remember is that this is saying
|
271
|
+
"include a plugin if it depends on gem_plugin, mongrel, but NOT
|
272
|
+
rails". If a plugin also depends on other stuff then it‘s loaded
|
273
|
+
just fine. Only gem_plugin, mongrel, and rails are ever used to determine
|
274
|
+
if it should be included.
|
268
275
|
</p>
|
269
276
|
<p>
|
270
277
|
NOTE: Currently RubyGems will run autorequire on gems that get required AND
|
271
278
|
on their dependencies. This really messes with people running edge rails
|
272
279
|
since activerecord or other stuff gets loaded for just touching a gem
|
273
|
-
plugin. To prevent this load requires
|
274
|
-
"init.rb" file, which avoids the RubyGems
|
280
|
+
plugin. To prevent this <a href="Manager.html#M000006">load</a> requires
|
281
|
+
the full path to the "init.rb" file, which avoids the RubyGems
|
282
|
+
autorequire magic.
|
275
283
|
</p>
|
276
284
|
</div>
|
277
285
|
</div>
|
@@ -326,12 +334,13 @@ plugin to a category.
|
|
326
334
|
<p>
|
327
335
|
GemPlugins can have a ‘resources’ directory which is packaged
|
328
336
|
with them and can hold any data resources the plugin may need. The main
|
329
|
-
problem is that it&#
|
330
|
-
are actually located on the file system. The
|
331
|
-
|
337
|
+
problem is that it‘s difficult to figure out where these resources
|
338
|
+
are actually located on the file system. The <a
|
339
|
+
href="Manager.html#M000010">resource</a> method tries to locate the real
|
340
|
+
path for a given <a href="Manager.html#M000010">resource</a> path.
|
332
341
|
</p>
|
333
342
|
<p>
|
334
|
-
Let&#
|
343
|
+
Let‘s say you have a ‘resources/stylesheets/default.css’
|
335
344
|
file in your gem distribution, then finding where this file really is
|
336
345
|
involves:
|
337
346
|
</p>
|
@@ -339,15 +348,16 @@ involves:
|
|
339
348
|
Manager.instance.resource("mygem", "/stylesheets/default.css")
|
340
349
|
</pre>
|
341
350
|
<p>
|
342
|
-
You either get back the full path to the
|
343
|
-
|
351
|
+
You either get back the full path to the <a
|
352
|
+
href="Manager.html#M000010">resource</a> or you get a nil if it
|
353
|
+
doesn‘t exist.
|
344
354
|
</p>
|
345
355
|
<p>
|
346
356
|
If you request a path for a <a href="../GemPlugin.html">GemPlugin</a> that
|
347
|
-
hasn&#
|
357
|
+
hasn‘t been loaded yet then it will throw an <a
|
348
358
|
href="PluginNotLoaded.html">PluginNotLoaded</a> exception. The gem may be
|
349
|
-
present on your system in this case, but you just haven&#
|
350
|
-
with Manager.instance.load properly.
|
359
|
+
present on your system in this case, but you just haven‘t loaded it
|
360
|
+
with Manager.instance.<a href="Manager.html#M000006">load</a> properly.
|
351
361
|
</p>
|
352
362
|
</div>
|
353
363
|
</div>
|
@@ -33,13 +33,17 @@
|
|
33
33
|
126: <span class="ruby-comment cmt"># makes them false so we'll skip this gem if any excludes are found</span>
|
34
34
|
127: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">check</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span>,<span class="ruby-identifier">test</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">test</span>}).<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
35
35
|
128: <span class="ruby-comment cmt"># looks like no needs were set to false, so it's good</span>
|
36
|
-
129:
|
37
|
-
130: <span class="ruby-
|
38
|
-
131: <span class="ruby-
|
39
|
-
132:
|
40
|
-
133:
|
41
|
-
134:
|
42
|
-
135:
|
43
|
-
136:
|
36
|
+
129:
|
37
|
+
130: <span class="ruby-comment cmt"># Previously was set wrong, we already have the correct gem path!</span>
|
38
|
+
131: <span class="ruby-comment cmt">#gem_dir = File.join(Gem.dir, "gems", "#{gem.name}-#{gem.version}")</span>
|
39
|
+
132: <span class="ruby-identifier">gem_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Gem</span>.<span class="ruby-identifier">dir</span>, <span class="ruby-value str">"gems"</span>, <span class="ruby-identifier">path</span>)
|
40
|
+
133:
|
41
|
+
134: <span class="ruby-identifier">require</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">gem_dir</span>, <span class="ruby-value str">"lib"</span>, <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value str">"init.rb"</span>)
|
42
|
+
135: <span class="ruby-ivar">@gems</span>[<span class="ruby-identifier">gem</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">gem_dir</span>
|
43
|
+
136: <span class="ruby-keyword kw">end</span>
|
44
|
+
137: <span class="ruby-keyword kw">end</span>
|
45
|
+
138:
|
46
|
+
139: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
47
|
+
140: <span class="ruby-keyword kw">end</span></pre>
|
44
48
|
</body>
|
45
49
|
</html>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 146</span>
|
14
|
+
146: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">category</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">klass</span>)
|
15
|
+
147: <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">category</span>] <span class="ruby-operator">||=</span> {}
|
16
|
+
148: <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">category</span>][<span class="ruby-identifier">name</span>.<span class="ruby-identifier">downcase</span>] = <span class="ruby-identifier">klass</span>
|
17
|
+
149: <span class="ruby-keyword kw">end</span></pre>
|
18
18
|
</body>
|
19
19
|
</html>
|
@@ -10,20 +10,20 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 156</span>
|
14
|
+
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
|
15
|
+
157: <span class="ruby-identifier">last_slash</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">"/"</span>)
|
16
|
+
158: <span class="ruby-identifier">category</span> = <span class="ruby-identifier">name</span>[<span class="ruby-value">0</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">last_slash</span>]
|
17
|
+
159: <span class="ruby-identifier">plugin</span> = <span class="ruby-identifier">name</span>[<span class="ruby-identifier">last_slash</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
|
18
|
+
160:
|
19
|
+
161: <span class="ruby-identifier">map</span> = <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">category</span>]
|
20
|
+
162: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">map</span>
|
21
|
+
163: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Plugin category #{category} does not exist"</span>
|
22
|
+
164: <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">map</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">plugin</span>
|
23
|
+
165: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Plugin #{plugin} does not exist in category #{category}"</span>
|
24
|
+
166: <span class="ruby-keyword kw">else</span>
|
25
|
+
167: <span class="ruby-identifier">map</span>[<span class="ruby-identifier">plugin</span>].<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
26
|
+
168: <span class="ruby-keyword kw">end</span>
|
27
|
+
169: <span class="ruby-keyword kw">end</span></pre>
|
28
28
|
</body>
|
29
29
|
</html>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 173</span>
|
14
|
+
173: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loaded?</span>(<span class="ruby-identifier">gem_name</span>)
|
15
|
+
174: <span class="ruby-ivar">@gems</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">gem_name</span>
|
16
|
+
175: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,19 +10,19 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 196</span>
|
14
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resource</span>(<span class="ruby-identifier">gem_name</span>, <span class="ruby-identifier">path</span>)
|
15
|
+
197: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">loaded?</span> <span class="ruby-identifier">gem_name</span>
|
16
|
+
198: <span class="ruby-identifier">raise</span> <span class="ruby-constant">PluginNotLoaded</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"Plugin #{gem_name} not loaded when getting resource #{path}"</span>)
|
17
|
+
199: <span class="ruby-keyword kw">end</span>
|
18
|
+
200:
|
19
|
+
201: <span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@gems</span>[<span class="ruby-identifier">gem_name</span>], <span class="ruby-value str">"resources"</span>, <span class="ruby-identifier">path</span>)
|
20
|
+
202:
|
21
|
+
203: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">file</span>
|
22
|
+
204: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">file</span>
|
23
|
+
205: <span class="ruby-keyword kw">else</span>
|
24
|
+
206: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
25
|
+
207: <span class="ruby-keyword kw">end</span>
|
26
|
+
208: <span class="ruby-keyword kw">end</span></pre>
|
27
27
|
</body>
|
28
28
|
</html>
|
@@ -10,19 +10,19 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/gem_plugin.rb, line 229</span>
|
14
|
+
229: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config</span>(<span class="ruby-identifier">gem_name</span>, <span class="ruby-identifier">options</span>={})
|
15
|
+
230: <span class="ruby-identifier">config_file</span> = <span class="ruby-constant">Manager</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">resource</span>(<span class="ruby-identifier">gem_name</span>, <span class="ruby-value str">"/defaults.yaml"</span>)
|
16
|
+
231: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config_file</span>
|
17
|
+
232: <span class="ruby-keyword kw">begin</span>
|
18
|
+
233: <span class="ruby-identifier">defaults</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">config_file</span>)
|
19
|
+
234: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
20
|
+
235: <span class="ruby-keyword kw">rescue</span>
|
21
|
+
236: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Error loading config #{config_file} for gem #{gem_name}"</span>
|
22
|
+
237: <span class="ruby-keyword kw">end</span>
|
23
|
+
238: <span class="ruby-keyword kw">else</span>
|
24
|
+
239: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
|
25
|
+
240: <span class="ruby-keyword kw">end</span>
|
26
|
+
241: <span class="ruby-keyword kw">end</span></pre>
|
27
27
|
</body>
|
28
28
|
</html>
|
data/doc/rdoc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Fri Jan 19 19:16:26 -0800 2007
|
data/doc/rdoc/files/COPYING.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Fri Jun 30 12:43:01 -0700 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -146,7 +146,7 @@ permission to copy, distribute and/or modify the library.
|
|
146
146
|
<p>
|
147
147
|
there is no warranty for the free library. Also, if the library is modified
|
148
148
|
by someone else and passed on, the recipients should know that what they
|
149
|
-
have is not the original version, so that the original author&#
|
149
|
+
have is not the original version, so that the original author‘s
|
150
150
|
reputation will not be affected by problems that might be introduced by
|
151
151
|
others.
|
152
152
|
</p>
|
@@ -184,7 +184,7 @@ criteria for linking other code with the library.
|
|
184
184
|
We call this license the "Lesser" General Public License because it
|
185
185
|
</pre>
|
186
186
|
<p>
|
187
|
-
does Less to protect the user&#
|
187
|
+
does Less to protect the user‘s freedom than the ordinary General
|
188
188
|
Public License. It also provides other free software developers Less of an
|
189
189
|
advantage over competing non-free programs. These disadvantages are the
|
190
190
|
reason we use the ordinary General Public License for many libraries.
|
@@ -445,7 +445,7 @@ they are linked directly with the Library itself.
|
|
445
445
|
link a "work that uses the Library" with the Library to produce a
|
446
446
|
work containing portions of the Library, and distribute that work under
|
447
447
|
terms of your choice, provided that the terms permit modification of the
|
448
|
-
work for the customer&#
|
448
|
+
work for the customer‘s own use and reverse engineering for debugging
|
449
449
|
such modifications.
|
450
450
|
</p>
|
451
451
|
<pre>
|
@@ -719,7 +719,7 @@ if necessary. Here is a sample; alter the names:
|
|
719
719
|
Ty Coon, President of Vice
|
720
720
|
</pre>
|
721
721
|
<p>
|
722
|
-
That&#
|
722
|
+
That‘s all there is to it!
|
723
723
|
</p>
|
724
724
|
|
725
725
|
</div>
|
data/doc/rdoc/files/LICENSE.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Fri Jun 30 13:10:48 -0700 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -70,65 +70,69 @@
|
|
70
70
|
|
71
71
|
<div id="description">
|
72
72
|
<p>
|
73
|
-
|
74
|
-
|
75
|
-
the GPL or the
|
73
|
+
<a href="../classes/GemPlugin.html">GemPlugin</a> is copyrighted free
|
74
|
+
software by Zed A. Shaw <zedshaw at zedshaw dot com> You can
|
75
|
+
redistribute it and/or modify it under either the terms of the GPL or the
|
76
|
+
conditions below:
|
76
77
|
</p>
|
77
|
-
<
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
2. You may modify your copy of the software in any way, provided that
|
83
|
-
you do at least ONE of the following:
|
84
|
-
|
85
|
-
a) place your modifications in the Public Domain or otherwise
|
86
|
-
make them Freely Available, such as by posting said
|
87
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
88
|
-
the author to include your modifications in the software.
|
89
|
-
|
90
|
-
b) use the modified software only within your corporation or
|
91
|
-
organization.
|
92
|
-
|
93
|
-
c) rename any non-standard executables so the names do not conflict
|
94
|
-
with standard executables, which must also be provided.
|
78
|
+
<ol>
|
79
|
+
<li>You may make and give away verbatim copies of the source form of the
|
80
|
+
software without restriction, provided that you duplicate all of the
|
81
|
+
original copyright notices and associated disclaimers.
|
95
82
|
|
96
|
-
|
83
|
+
</li>
|
84
|
+
<li>You may modify your copy of the software in any way, provided that you do
|
85
|
+
at least ONE of the following:
|
97
86
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
on where to get the original distribution.
|
87
|
+
<pre>
|
88
|
+
a) place your modifications in the Public Domain or otherwise make them
|
89
|
+
Freely Available, such as by posting said modifications to Usenet or an
|
90
|
+
equivalent medium, or by allowing the author to include your
|
91
|
+
modifications in the software.
|
104
92
|
|
105
|
-
|
106
|
-
|
93
|
+
b) use the modified software only within your corporation or
|
94
|
+
organization.
|
107
95
|
|
108
|
-
|
109
|
-
|
96
|
+
c) rename any non-standard executables so the names do not conflict with
|
97
|
+
standard executables, which must also be provided.
|
110
98
|
|
111
|
-
|
99
|
+
d) make other distribution arrangements with the author.
|
100
|
+
</pre>
|
101
|
+
</li>
|
102
|
+
<li>You may distribute the software in object code or executable form, provided
|
103
|
+
that you do at least ONE of the following:
|
112
104
|
|
113
|
-
|
114
|
-
|
115
|
-
|
105
|
+
<pre>
|
106
|
+
a) distribute the executables and library files of the software,
|
107
|
+
together with instructions (in the manual page or equivalent) on where
|
108
|
+
to get the original distribution.
|
116
109
|
|
117
|
-
|
118
|
-
|
119
|
-
condition.
|
110
|
+
b) accompany the distribution with the machine-readable source of the
|
111
|
+
software.
|
120
112
|
|
121
|
-
|
122
|
-
|
123
|
-
copyright of the software, but belong to whomever generated them,
|
124
|
-
and may be sold commercially, and may be aggregated with this
|
125
|
-
software.
|
113
|
+
c) give non-standard executables non-standard names, with
|
114
|
+
instructions on where to get the original software distribution.
|
126
115
|
|
127
|
-
|
128
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
129
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
130
|
-
PURPOSE.
|
116
|
+
d) make other distribution arrangements with the author.
|
131
117
|
</pre>
|
118
|
+
</li>
|
119
|
+
<li>You may modify and include the part of the software into any other software
|
120
|
+
(possibly commercial). But some files in the distribution are not written
|
121
|
+
by the author, so that they are not under this terms.
|
122
|
+
|
123
|
+
</li>
|
124
|
+
<li>The scripts and library files supplied as input to or produced as output
|
125
|
+
from the software do not automatically fall under the copyright of the
|
126
|
+
software, but belong to whomever generated them, and may be sold
|
127
|
+
commercially, and may be aggregated with this software.
|
128
|
+
|
129
|
+
</li>
|
130
|
+
<li>THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
131
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
|
132
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
133
|
+
|
134
|
+
</li>
|
135
|
+
</ol>
|
132
136
|
|
133
137
|
</div>
|
134
138
|
|
data/doc/rdoc/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Fri Jun 30 12:43:01 -0700 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -81,29 +81,24 @@ proved useful enough to break out into a separate project.
|
|
81
81
|
<a href="../classes/GemPlugin.html">GemPlugin</a> works by listing the gems
|
82
82
|
installed, and doing a require_gem on any that have the right dependencies.
|
83
83
|
For example, if a gem depends on "gem_plugin" and
|
84
|
-
"mongrel" then it&#
|
84
|
+
"mongrel" then it‘ll load as a Mongrel plugin. This makes
|
85
85
|
it so that users of the plugins only need to gem install (and maybe config
|
86
86
|
a bit), and plugin authors only need to make gems.
|
87
87
|
</p>
|
88
88
|
<h2>Implementers</h2>
|
89
89
|
<p>
|
90
90
|
To use <a href="../classes/GemPlugin.html">GemPlugin</a> in your system you
|
91
|
-
only have to require ‘gem_plugin’ and then use the
|
92
|
-
|
93
|
-
|
94
|
-
href="../classes/GemPlugin/Manager.html#M000006">GemPlugin::Manager.load</a>,
|
95
|
-
and GemPlugin::Manager.available methods to work with them.
|
91
|
+
only have to require ‘gem_plugin’ and then use the
|
92
|
+
GemPlugin::Manager.create, GemPlugin::Manager.load, and
|
93
|
+
GemPlugin::Manager.available methods to work with them.
|
96
94
|
</p>
|
97
95
|
<ul>
|
98
|
-
<li
|
99
|
-
|
100
|
-
— Takes a "depend include/exclude map" and loads plugins
|
101
|
-
based on it.
|
96
|
+
<li>GemPlugin::Manager.load — Takes a "depend include/exclude
|
97
|
+
map" and loads plugins based on it.
|
102
98
|
|
103
99
|
</li>
|
104
|
-
<li
|
105
|
-
|
106
|
-
— Takes a URI style name and some options then creates one for you.
|
100
|
+
<li>GemPlugin::Manager.create — Takes a URI style name and some options
|
101
|
+
then creates one for you.
|
107
102
|
|
108
103
|
</li>
|
109
104
|
<li>GemPlugin::Manager.available — Lets you inspect and mess with the
|
@@ -113,7 +108,7 @@ internal plugin registry.
|
|
113
108
|
</ul>
|
114
109
|
<h3>Loading Plugins</h3>
|
115
110
|
<p>
|
116
|
-
As an example from Mongrel it&#
|
111
|
+
As an example from Mongrel it‘s necessary to load plugins that depend
|
117
112
|
on rails after the Rails system is configured, but load other plugins right
|
118
113
|
when Mongrel is ready. To do this we very first do:
|
119
114
|
</p>
|
@@ -121,7 +116,7 @@ when Mongrel is ready. To do this we very first do:
|
|
121
116
|
GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE, "rails" => GemPlugin::EXCLUDE
|
122
117
|
</pre>
|
123
118
|
<p>
|
124
|
-
Later, when it&#
|
119
|
+
Later, when it‘s ready to load Rails plugins as well we do this:
|
125
120
|
</p>
|
126
121
|
<pre>
|
127
122
|
GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE
|
@@ -137,7 +132,7 @@ Creating a plugin is cake:
|
|
137
132
|
plug = GemPlugin::Manager.instance.create("/commands/snazzy", "something" => "yeah")
|
138
133
|
</pre>
|
139
134
|
<p>
|
140
|
-
In this case we&#
|
135
|
+
In this case we‘re making the snazzy command and passing a couple
|
141
136
|
fake options.
|
142
137
|
</p>
|
143
138
|
<h3>Finding Available Plugins</h3>
|
@@ -145,7 +140,7 @@ fake options.
|
|
145
140
|
Finding plugins is also very easy, you just call
|
146
141
|
GemPlugin::Manager.instance.available and you get a Hash that maps
|
147
142
|
categories to name => class. For example, if I had the
|
148
|
-
"/commands/snazzy" plugin registered above, then I&#
|
143
|
+
"/commands/snazzy" plugin registered above, then I‘d get
|
149
144
|
the following:
|
150
145
|
</p>
|
151
146
|
<pre>
|
@@ -156,13 +151,13 @@ the following:
|
|
156
151
|
<p>
|
157
152
|
Plugins that are placed in modules are also lowercased when registered but
|
158
153
|
still retain their module. So, if Snazzy was actually MyModule::Snazzy,
|
159
|
-
then it&#
|
154
|
+
then it‘d be registered as "/commands/mymodule::snazzy".
|
160
155
|
</p>
|
161
156
|
<h2>Plugin Authors</h2>
|
162
157
|
<p>
|
163
158
|
People who wish to write gem plugins have a faily easy time of it, but need
|
164
159
|
to know the particular rules for the target system. To keep this example
|
165
|
-
concrete we&#
|
160
|
+
concrete we‘ll assume you want to write a Mongrel command plugin.
|
166
161
|
</p>
|
167
162
|
<p>
|
168
163
|
First thing is create your project like normal and setup Rake to make your
|
@@ -210,7 +205,7 @@ they get the plugin automagically.
|
|
210
205
|
<p>
|
211
206
|
People writing GemPlugins for other systems would have to check the
|
212
207
|
documentation from that project to get an idea of what extra requirements
|
213
|
-
might be needed. For example, you&#
|
208
|
+
might be needed. For example, you‘d probably have to depend on
|
214
209
|
another project other that <b>mongrel</b> and most likely have a few more
|
215
210
|
things to configure in your init.rb.
|
216
211
|
</p>
|
@@ -222,7 +217,7 @@ Plugin users have it the easiest of all. They simply do:
|
|
222
217
|
gem install mongrel_command_snazzy
|
223
218
|
</pre>
|
224
219
|
<p>
|
225
|
-
And that&#
|
220
|
+
And that‘s it. When they run mongrel_rails (given the above example)
|
226
221
|
this snazzy command get loaded automatically without any intervention.
|
227
222
|
</p>
|
228
223
|
<p>
|
@@ -232,7 +227,7 @@ define.
|
|
232
227
|
</p>
|
233
228
|
<h2>Contact</h2>
|
234
229
|
<p>
|
235
|
-
E-mail zedshaw at zedshaw.com and I&#
|
230
|
+
E-mail zedshaw at zedshaw.com and I‘ll help. Comments about the API
|
236
231
|
are welcome.
|
237
232
|
</p>
|
238
233
|
|
data/lib/gem_plugin.rb
CHANGED
@@ -126,7 +126,11 @@ module GemPlugin
|
|
126
126
|
# makes them false so we'll skip this gem if any excludes are found
|
127
127
|
if (check.select {|name,test| !test}).length == 0
|
128
128
|
# looks like no needs were set to false, so it's good
|
129
|
-
|
129
|
+
|
130
|
+
# Previously was set wrong, we already have the correct gem path!
|
131
|
+
#gem_dir = File.join(Gem.dir, "gems", "#{gem.name}-#{gem.version}")
|
132
|
+
gem_dir = File.join(Gem.dir, "gems", path)
|
133
|
+
|
130
134
|
require File.join(gem_dir, "lib", gem.name, "init.rb")
|
131
135
|
@gems[gem.name] = gem_dir
|
132
136
|
end
|
data/resources/tools/rakehelp.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: gem_plugin
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date:
|
6
|
+
version: 0.2.2
|
7
|
+
date: 2007-01-19 00:00:00 -08:00
|
8
8
|
summary: A plugin system based only on rubygems that uses dependencies only
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- Zed A. Shaw
|
30
31
|
files:
|
@@ -33,54 +34,52 @@ files:
|
|
33
34
|
- README
|
34
35
|
- Rakefile
|
35
36
|
- bin/gpgen
|
36
|
-
- doc/rdoc/classes
|
37
|
-
- doc/rdoc/created.rid
|
38
37
|
- doc/rdoc/files
|
39
|
-
- doc/rdoc/fr_class_index.html
|
40
|
-
- doc/rdoc/fr_file_index.html
|
41
|
-
- doc/rdoc/fr_method_index.html
|
42
38
|
- doc/rdoc/index.html
|
43
39
|
- doc/rdoc/rdoc-style.css
|
44
|
-
- doc/rdoc/
|
40
|
+
- doc/rdoc/fr_method_index.html
|
41
|
+
- doc/rdoc/fr_class_index.html
|
42
|
+
- doc/rdoc/fr_file_index.html
|
43
|
+
- doc/rdoc/created.rid
|
44
|
+
- doc/rdoc/classes
|
45
|
+
- doc/rdoc/files/lib
|
46
|
+
- doc/rdoc/files/LICENSE.html
|
47
|
+
- doc/rdoc/files/README.html
|
48
|
+
- doc/rdoc/files/COPYING.html
|
49
|
+
- doc/rdoc/files/lib/gem_plugin_rb.html
|
45
50
|
- doc/rdoc/classes/GemPlugin.html
|
46
51
|
- doc/rdoc/classes/GemPlugin.src
|
52
|
+
- doc/rdoc/classes/GemPlugin
|
53
|
+
- doc/rdoc/classes/GemPlugin.src/M000001.html
|
54
|
+
- doc/rdoc/classes/GemPlugin/Manager.html
|
55
|
+
- doc/rdoc/classes/GemPlugin/PluginNotLoaded.html
|
47
56
|
- doc/rdoc/classes/GemPlugin/Base.html
|
48
57
|
- doc/rdoc/classes/GemPlugin/Base.src
|
49
|
-
- doc/rdoc/classes/GemPlugin/Manager.html
|
50
58
|
- doc/rdoc/classes/GemPlugin/Manager.src
|
51
|
-
- doc/rdoc/classes/GemPlugin/PluginNotLoaded.html
|
52
59
|
- doc/rdoc/classes/GemPlugin/Base.src/M000002.html
|
53
60
|
- doc/rdoc/classes/GemPlugin/Base.src/M000003.html
|
54
61
|
- doc/rdoc/classes/GemPlugin/Base.src/M000004.html
|
55
|
-
- doc/rdoc/classes/GemPlugin/Manager.src/M000005.html
|
56
|
-
- doc/rdoc/classes/GemPlugin/Manager.src/M000006.html
|
57
|
-
- doc/rdoc/classes/GemPlugin/Manager.src/M000007.html
|
58
62
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000008.html
|
59
63
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000009.html
|
60
64
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000010.html
|
61
65
|
- doc/rdoc/classes/GemPlugin/Manager.src/M000011.html
|
62
|
-
- doc/rdoc/classes/GemPlugin.src/
|
63
|
-
- doc/rdoc/
|
64
|
-
- doc/rdoc/
|
65
|
-
- doc/rdoc/files/LICENSE.html
|
66
|
-
- doc/rdoc/files/README.html
|
67
|
-
- doc/rdoc/files/lib/gem_plugin_rb.html
|
66
|
+
- doc/rdoc/classes/GemPlugin/Manager.src/M000005.html
|
67
|
+
- doc/rdoc/classes/GemPlugin/Manager.src/M000006.html
|
68
|
+
- doc/rdoc/classes/GemPlugin/Manager.src/M000007.html
|
68
69
|
- test/test_plugins.rb
|
69
70
|
- lib/gem_plugin.rb
|
70
71
|
- tools/rakehelp.rb
|
71
|
-
- resources/COPYING
|
72
|
-
- resources/doc
|
73
72
|
- resources/lib
|
74
73
|
- resources/LICENSE
|
75
74
|
- resources/Rakefile
|
75
|
+
- resources/tools
|
76
76
|
- resources/README
|
77
77
|
- resources/resources
|
78
|
-
- resources/
|
79
|
-
- resources/tools
|
78
|
+
- resources/COPYING
|
80
79
|
- resources/lib/project
|
81
80
|
- resources/lib/project/init.rb
|
82
|
-
- resources/resources/defaults.yaml
|
83
81
|
- resources/tools/rakehelp.rb
|
82
|
+
- resources/resources/defaults.yaml
|
84
83
|
test_files:
|
85
84
|
- test/test_plugins.rb
|
86
85
|
rdoc_options: []
|