gem_plugin 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,58 +1,55 @@
1
- Ruby is copyrighted free software by Zed A. Shaw <zedshaw at zedshaw dot com>
2
- You can redistribute it and/or modify it under either the terms of the GPL
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
- 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.
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
- 2. You may modify your copy of the software in any way, provided that
10
- you do at least ONE of the following:
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
- a) place your modifications in the Public Domain or otherwise
13
- make them Freely Available, such as by posting said
14
- modifications to Usenet or an equivalent medium, or by allowing
15
- the author to include your modifications in the software.
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
- b) use the modified software only within your corporation or
18
- organization.
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
19
 
20
- c) rename any non-standard executables so the names do not conflict
21
- with standard executables, which must also be provided.
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
- d) make other distribution arrangements with the author.
23
+ d) make other distribution arrangements with the author.
24
24
 
25
- 3. You may distribute the software in object code or executable
26
- form, provided that you do at least ONE of the following:
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
- a) distribute the executables and library files of the software,
29
- together with instructions (in the manual page or equivalent)
30
- on where to get the original distribution.
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
- b) accompany the distribution with the machine-readable source of
33
- the software.
32
+ b) accompany the distribution with the machine-readable source of the
33
+ software.
34
34
 
35
- c) give non-standard executables non-standard names, with
36
- instructions on where to get the original software distribution.
35
+ c) give non-standard executables non-standard names, with
36
+ instructions on where to get the original software distribution.
37
37
 
38
- d) make other distribution arrangements with the author.
38
+ d) make other distribution arrangements with the author.
39
39
 
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.
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
- They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
45
- files under the ./missing directory. See each file for the copying
46
- condition.
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
- 5. The scripts and library files supplied as input to or produced as
49
- output from the software do not automatically fall under the
50
- copyright of the software, but belong to whomever generated them,
51
- and may be sold commercially, and may be aggregated with this
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.1"
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 %{sudo gem install pkg/#{name}-#{version}}
32
+ sh %{gem install pkg/#{name}-#{version}}
33
33
  end
34
34
 
35
35
  task :uninstall => [:clean] do
36
- sh %{sudo gem uninstall #{name}}
36
+ sh %{gem uninstall #{name}}
37
37
  end
38
38
 
39
39
  task :site => [:rerdoc] do
40
- sh %{ scp -r doc/rdoc/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/gem_plugin_rdoc/ }
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>(&quot;/thing
93
93
  and can also pass in options as a second parameter.
94
94
  </p>
95
95
  <p>
96
- This isn&#8217;t such a big deal, but the power is really from the <a
96
+ This isn&#8216;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&#8217;ll be the best example of using it.
105
+ that&#8216;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&#8216;d like people to be able to grab this plugin if they want and use
111
- it, because it&#8217;s snazzy.
111
+ it, because it&#8216;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 278</span>
14
- 278: <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
- 279: <span class="ruby-constant">Base</span>.<span class="ruby-identifier">category</span> = <span class="ruby-identifier">c</span>
16
- 280: <span class="ruby-constant">Base</span>
17
- 281: <span class="ruby-keyword kw">end</span></pre>
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 new
84
- class into the right category. It is not thread-safe yet but will be soon.
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 249</span>
14
- 249: <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
- 250: <span class="ruby-identifier">name</span> = <span class="ruby-value str">&quot;/&quot;</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
- 251: <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
- 252: <span class="ruby-ivar">@@category</span> = <span class="ruby-keyword kw">nil</span>
18
- 253: <span class="ruby-keyword kw">end</span></pre>
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">&quot;/&quot;</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 256</span>
14
- 256: <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
- 257: <span class="ruby-ivar">@@category</span> = <span class="ruby-identifier">category</span>
16
- 258: <span class="ruby-keyword kw">end</span></pre>
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 260</span>
14
- 260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
15
- 261: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
16
- 262: <span class="ruby-keyword kw">end</span></pre>
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&#8217;t
83
+ This class is used by people who use gem plugins (but don&#8216;t
84
84
  necessarily make them) to add plugins to their own systems. It provides a
85
- way to load plugins, list them, and create them as needed.
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.load
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 load a set of
183
- configuration defaults. <a href="../GemPlugin.html">GemPlugin</a>
184
- normalizes this to be if you have a file
185
- &quot;resources/defaults.yaml&quot; then you&#8217;ll be able to load them
186
- via <a href="Manager.html#M000011">Manager.config</a>.
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 &quot;resources/defaults.yaml&quot; then you&#8216;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, and what you get back is a new Hash with the
191
- user&#8217;s settings overriding the defaults.
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&#8216;s settings overriding the defaults.
192
196
  </p>
193
197
  <pre>
194
198
  opts = Manager.instance.config &quot;mygem&quot;, :age =&gt; 12, :max_load =&gt; .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) then use the returned defaults
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 pass a second hash option that is
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&#8217;s loaded already and
242
- won&#8217;t load them again.
245
+ plugins requested. It keeps track of what it&#8216;s loaded already and
246
+ won&#8216;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&#8217;s own INCLUDE to make
251
+ considered, but then each system has to add it&#8216;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 load all Mongrel plugins:
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 &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE
255
260
  </pre>
256
261
  <p>
257
- Which will load all plugins that depend on mongrel AND gem_plugin. Now, one
258
- extra thing we do is we delay loading Rails Mongrel plugins until after
259
- rails is configured. Do do this the mongrel_rails script has:
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 &quot;mongrel&quot; =&gt;
263
- GemPlugin::INCLUDE, &quot;rails&quot; =&gt; GemPlugin::EXCLUDE The only
264
- thing to remember is that this is saying &quot;include a plugin if it
265
- depends on gem_plugin, mongrel, but NOT rails&quot;. If a plugin also
266
- depends on other stuff then it&#8217;s loaded just fine. Only gem_plugin,
267
- mongrel, and rails are ever used to determine if it should be included.
268
+ GemPlugin::Manager.instance.<a href="Manager.html#M000006">load</a>
269
+ &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE, &quot;rails&quot; =&gt;
270
+ GemPlugin::EXCLUDE The only thing to remember is that this is saying
271
+ &quot;include a plugin if it depends on gem_plugin, mongrel, but NOT
272
+ rails&quot;. If a plugin also depends on other stuff then it&#8216;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 the full path to the
274
- &quot;init.rb&quot; file, which avoids the RubyGems autorequire magic.
280
+ plugin. To prevent this <a href="Manager.html#M000006">load</a> requires
281
+ the full path to the &quot;init.rb&quot; 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 &#8216;resources&#8217; 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&#8217;s difficult to figure out where these resources
330
- are actually located on the file system. The resource method tries to
331
- locate the real path for a given resource path.
337
+ problem is that it&#8216;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&#8217;s say you have a &#8216;resources/stylesheets/default.css&#8217;
343
+ Let&#8216;s say you have a &#8216;resources/stylesheets/default.css&#8217;
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(&quot;mygem&quot;, &quot;/stylesheets/default.css&quot;)
340
349
  </pre>
341
350
  <p>
342
- You either get back the full path to the resource or you get a nil if it
343
- doesn&#8217;t exist.
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&#8216;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&#8217;t been loaded yet then it will throw an <a
357
+ hasn&#8216;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&#8217;t loaded it
350
- with Manager.instance.load properly.
359
+ present on your system in this case, but you just haven&#8216;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: <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">&quot;gems&quot;</span>, <span class="ruby-node">&quot;#{gem.name}-#{gem.version}&quot;</span>)
37
- 130: <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">&quot;lib&quot;</span>, <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;init.rb&quot;</span>)
38
- 131: <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>
39
- 132: <span class="ruby-keyword kw">end</span>
40
- 133: <span class="ruby-keyword kw">end</span>
41
- 134:
42
- 135: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
43
- 136: <span class="ruby-keyword kw">end</span></pre>
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, &quot;gems&quot;, &quot;#{gem.name}-#{gem.version}&quot;)</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">&quot;gems&quot;</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">&quot;lib&quot;</span>, <span class="ruby-identifier">gem</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;init.rb&quot;</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 142</span>
14
- 142: <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
- 143: <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">category</span>] <span class="ruby-operator">||=</span> {}
16
- 144: <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
- 145: <span class="ruby-keyword kw">end</span></pre>
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 152</span>
14
- 152: <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
- 153: <span class="ruby-identifier">last_slash</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">&quot;/&quot;</span>)
16
- 154: <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
- 155: <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
- 156:
19
- 157: <span class="ruby-identifier">map</span> = <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">category</span>]
20
- 158: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">map</span>
21
- 159: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Plugin category #{category} does not exist&quot;</span>
22
- 160: <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
- 161: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Plugin #{plugin} does not exist in category #{category}&quot;</span>
24
- 162: <span class="ruby-keyword kw">else</span>
25
- 163: <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
- 164: <span class="ruby-keyword kw">end</span>
27
- 165: <span class="ruby-keyword kw">end</span></pre>
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">&quot;/&quot;</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">&quot;Plugin category #{category} does not exist&quot;</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">&quot;Plugin #{plugin} does not exist in category #{category}&quot;</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 169</span>
14
- 169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loaded?</span>(<span class="ruby-identifier">gem_name</span>)
15
- 170: <span class="ruby-ivar">@gems</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">gem_name</span>
16
- 171: <span class="ruby-keyword kw">end</span></pre>
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 192</span>
14
- 192: <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
- 193: <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
- 194: <span class="ruby-identifier">raise</span> <span class="ruby-constant">PluginNotLoaded</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Plugin #{gem_name} not loaded when getting resource #{path}&quot;</span>)
17
- 195: <span class="ruby-keyword kw">end</span>
18
- 196:
19
- 197: <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">&quot;resources&quot;</span>, <span class="ruby-identifier">path</span>)
20
- 198:
21
- 199: <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
- 200: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">file</span>
23
- 201: <span class="ruby-keyword kw">else</span>
24
- 202: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
25
- 203: <span class="ruby-keyword kw">end</span>
26
- 204: <span class="ruby-keyword kw">end</span></pre>
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">&quot;Plugin #{gem_name} not loaded when getting resource #{path}&quot;</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">&quot;resources&quot;</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 225</span>
14
- 225: <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
- 226: <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">&quot;/defaults.yaml&quot;</span>)
16
- 227: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config_file</span>
17
- 228: <span class="ruby-keyword kw">begin</span>
18
- 229: <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
- 230: <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
- 231: <span class="ruby-keyword kw">rescue</span>
21
- 232: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Error loading config #{config_file} for gem #{gem_name}&quot;</span>
22
- 233: <span class="ruby-keyword kw">end</span>
23
- 234: <span class="ruby-keyword kw">else</span>
24
- 235: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
25
- 236: <span class="ruby-keyword kw">end</span>
26
- 237: <span class="ruby-keyword kw">end</span></pre>
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">&quot;/defaults.yaml&quot;</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">&quot;Error loading config #{config_file} for gem #{gem_name}&quot;</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>
@@ -1 +1 @@
1
- Wed Mar 15 01:27:02 EST 2006
1
+ Fri Jan 19 19:16:26 -0800 2007
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sat Mar 04 16:42:18 EST 2006</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&#8217;s
149
+ have is not the original version, so that the original author&#8216;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 &quot;Lesser&quot; General Public License because it
185
185
  </pre>
186
186
  <p>
187
- does Less to protect the user&#8217;s freedom than the ordinary General
187
+ does Less to protect the user&#8216;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 &quot;work that uses the Library&quot; 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&#8217;s own use and reverse engineering for debugging
448
+ work for the customer&#8216;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&#8217;s all there is to it!
722
+ That&#8216;s all there is to it!
723
723
  </p>
724
724
 
725
725
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Mar 05 21:05:11 EST 2006</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
- Ruby is copyrighted free software by Zed A. Shaw &lt;zedshaw at zedshaw dot
74
- com&gt; You can redistribute it and/or modify it under either the terms of
75
- the GPL or the conditions below:
73
+ <a href="../classes/GemPlugin.html">GemPlugin</a> is copyrighted free
74
+ software by Zed A. Shaw &lt;zedshaw at zedshaw dot com&gt; 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
- <pre>
78
- 1. You may make and give away verbatim copies of the source form of the
79
- software without restriction, provided that you duplicate all of the
80
- original copyright notices and associated disclaimers.
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
- d) make other distribution arrangements with the author.
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
- 3. You may distribute the software in object code or executable
99
- form, provided that you do at least ONE of the following:
100
-
101
- a) distribute the executables and library files of the software,
102
- together with instructions (in the manual page or equivalent)
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
- b) accompany the distribution with the machine-readable source of
106
- the software.
93
+ b) use the modified software only within your corporation or
94
+ organization.
107
95
 
108
- c) give non-standard executables non-standard names, with
109
- instructions on where to get the original software distribution.
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
- d) make other distribution arrangements with the author.
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
- 4. You may modify and include the part of the software into any other
114
- software (possibly commercial). But some files in the distribution
115
- are not written by the author, so that they are not under this terms.
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
- They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
118
- files under the ./missing directory. See each file for the copying
119
- condition.
110
+ b) accompany the distribution with the machine-readable source of the
111
+ software.
120
112
 
121
- 5. The scripts and library files supplied as input to or produced as
122
- output from the software do not automatically fall under the
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
- 6. THIS SOFTWARE IS PROVIDED &quot;AS IS&quot; AND WITHOUT ANY EXPRESS OR
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 &quot;AS IS&quot; 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
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Mar 06 00:33:03 EST 2006</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 &quot;gem_plugin&quot; and
84
- &quot;mongrel&quot; then it&#8217;ll load as a Mongrel plugin. This makes
84
+ &quot;mongrel&quot; then it&#8216;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 &#8216;gem_plugin&#8217; and then use the <a
92
- href="../classes/GemPlugin/Manager.html#M000008">GemPlugin::Manager.create</a>,
93
- <a
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 &#8216;gem_plugin&#8217; 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><a
99
- href="../classes/GemPlugin/Manager.html#M000006">GemPlugin::Manager.load</a>
100
- &#8212; Takes a &quot;depend include/exclude map&quot; and loads plugins
101
- based on it.
96
+ <li>GemPlugin::Manager.load &#8212; Takes a &quot;depend include/exclude
97
+ map&quot; and loads plugins based on it.
102
98
 
103
99
  </li>
104
- <li><a
105
- href="../classes/GemPlugin/Manager.html#M000008">GemPlugin::Manager.create</a>
106
- &#8212; Takes a URI style name and some options then creates one for you.
100
+ <li>GemPlugin::Manager.create &#8212; 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 &#8212; 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&#8217;s necessary to load plugins that depend
111
+ As an example from Mongrel it&#8216;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 &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE, &quot;rails&quot; =&gt; GemPlugin::EXCLUDE
122
117
  </pre>
123
118
  <p>
124
- Later, when it&#8217;s ready to load Rails plugins as well we do this:
119
+ Later, when it&#8216;s ready to load Rails plugins as well we do this:
125
120
  </p>
126
121
  <pre>
127
122
  GemPlugin::Manager.instance.load &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE
@@ -137,7 +132,7 @@ Creating a plugin is cake:
137
132
  plug = GemPlugin::Manager.instance.create(&quot;/commands/snazzy&quot;, &quot;something&quot; =&gt; &quot;yeah&quot;)
138
133
  </pre>
139
134
  <p>
140
- In this case we&#8217;re making the snazzy command and passing a couple
135
+ In this case we&#8216;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 =&gt; class. For example, if I had the
148
- &quot;/commands/snazzy&quot; plugin registered above, then I&#8217;d get
143
+ &quot;/commands/snazzy&quot; plugin registered above, then I&#8216;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&#8217;d be registered as &quot;/commands/mymodule::snazzy&quot;.
154
+ then it&#8216;d be registered as &quot;/commands/mymodule::snazzy&quot;.
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&#8217;ll assume you want to write a Mongrel command plugin.
160
+ concrete we&#8216;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&#8217;d probably have to depend on
208
+ might be needed. For example, you&#8216;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&#8217;s it. When they run mongrel_rails (given the above example)
220
+ And that&#8216;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&#8217;ll help. Comments about the API
230
+ E-mail zedshaw at zedshaw.com and I&#8216;ll help. Comments about the API
236
231
  are welcome.
237
232
  </p>
238
233
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Mar 15 01:26:56 EST 2006</td>
59
+ <td>Sun Sep 03 12:52:42 -0700 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -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
- gem_dir = File.join(Gem.dir, "gems", "#{gem.name}-#{gem.version}")
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
@@ -93,7 +93,8 @@ def setup_gem(pkg_name, pkg_version)
93
93
 
94
94
  Rake::GemPackageTask.new(spec) do |p|
95
95
  p.gem_spec = spec
96
- p.need_tar = true
96
+ # win32 chokes on this
97
+ p.need_tar = true if RUBY_PLATFORM !~ /mswin/
97
98
  end
98
99
  end
99
100
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
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.1
7
- date: 2006-03-15 00:00:00 -05:00
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/classes/GemPlugin
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/M000001.html
63
- - doc/rdoc/files/COPYING.html
64
- - doc/rdoc/files/lib
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/test
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: []