gem_plugin 0.2.2 → 0.2.3

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.
Files changed (36) hide show
  1. data.tar.gz.sig +4 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +15 -0
  4. data/gem_plugin.gemspec +53 -0
  5. data/resources/Rakefile +39 -15
  6. data/setup.rb +1360 -0
  7. metadata +79 -72
  8. metadata.gz.sig +0 -0
  9. data/Rakefile +0 -41
  10. data/doc/rdoc/classes/GemPlugin.html +0 -248
  11. data/doc/rdoc/classes/GemPlugin.src/M000001.html +0 -19
  12. data/doc/rdoc/classes/GemPlugin/Base.html +0 -194
  13. data/doc/rdoc/classes/GemPlugin/Base.src/M000002.html +0 -20
  14. data/doc/rdoc/classes/GemPlugin/Base.src/M000003.html +0 -18
  15. data/doc/rdoc/classes/GemPlugin/Base.src/M000004.html +0 -18
  16. data/doc/rdoc/classes/GemPlugin/Manager.html +0 -377
  17. data/doc/rdoc/classes/GemPlugin/Manager.src/M000005.html +0 -23
  18. data/doc/rdoc/classes/GemPlugin/Manager.src/M000006.html +0 -49
  19. data/doc/rdoc/classes/GemPlugin/Manager.src/M000007.html +0 -19
  20. data/doc/rdoc/classes/GemPlugin/Manager.src/M000008.html +0 -29
  21. data/doc/rdoc/classes/GemPlugin/Manager.src/M000009.html +0 -18
  22. data/doc/rdoc/classes/GemPlugin/Manager.src/M000010.html +0 -28
  23. data/doc/rdoc/classes/GemPlugin/Manager.src/M000011.html +0 -28
  24. data/doc/rdoc/classes/GemPlugin/PluginNotLoaded.html +0 -111
  25. data/doc/rdoc/created.rid +0 -1
  26. data/doc/rdoc/files/COPYING.html +0 -756
  27. data/doc/rdoc/files/LICENSE.html +0 -168
  28. data/doc/rdoc/files/README.html +0 -265
  29. data/doc/rdoc/files/lib/gem_plugin_rb.html +0 -109
  30. data/doc/rdoc/fr_class_index.html +0 -30
  31. data/doc/rdoc/fr_file_index.html +0 -30
  32. data/doc/rdoc/fr_method_index.html +0 -37
  33. data/doc/rdoc/index.html +0 -24
  34. data/doc/rdoc/rdoc-style.css +0 -208
  35. data/resources/tools/rakehelp.rb +0 -106
  36. data/tools/rakehelp.rb +0 -106
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>Plugin (GemPlugin)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
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
- </body>
19
- </html>
@@ -1,194 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: GemPlugin::Base</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">GemPlugin::Base</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/gem_plugin_rb.html">
59
- lib/gem_plugin.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
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.
86
- </p>
87
-
88
- </div>
89
-
90
-
91
- </div>
92
-
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000003">category=</a>&nbsp;&nbsp;
98
- <a href="#M000002">inherited</a>&nbsp;&nbsp;
99
- <a href="#M000004">new</a>&nbsp;&nbsp;
100
- </div>
101
- </div>
102
-
103
- </div>
104
-
105
-
106
- <!-- if includes -->
107
-
108
- <div id="section">
109
-
110
-
111
-
112
-
113
-
114
- <div id="attribute-list">
115
- <h3 class="section-bar">Attributes</h3>
116
-
117
- <div class="name-list">
118
- <table>
119
- <tr class="top-aligned-row context-row">
120
- <td class="context-item-name">options</td>
121
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
122
- <td class="context-item-desc"></td>
123
- </tr>
124
- </table>
125
- </div>
126
- </div>
127
-
128
-
129
-
130
- <!-- if method_list -->
131
- <div id="methods">
132
- <h3 class="section-bar">Public Class methods</h3>
133
-
134
- <div id="method-M000003" class="method-detail">
135
- <a name="M000003"></a>
136
-
137
- <div class="method-heading">
138
- <a href="Base.src/M000003.html" target="Code" class="method-signature"
139
- onclick="popupCode('Base.src/M000003.html');return false;">
140
- <span class="method-name">category=</span><span class="method-args">(category)</span>
141
- </a>
142
- </div>
143
-
144
- <div class="method-description">
145
- <p>
146
- See Mongrel::Plugin for an explanation.
147
- </p>
148
- </div>
149
- </div>
150
-
151
- <div id="method-M000002" class="method-detail">
152
- <a name="M000002"></a>
153
-
154
- <div class="method-heading">
155
- <a href="Base.src/M000002.html" target="Code" class="method-signature"
156
- onclick="popupCode('Base.src/M000002.html');return false;">
157
- <span class="method-name">inherited</span><span class="method-args">(klass)</span>
158
- </a>
159
- </div>
160
-
161
- <div class="method-description">
162
- <p>
163
- See Mongrel::Plugin for an explanation.
164
- </p>
165
- </div>
166
- </div>
167
-
168
- <div id="method-M000004" class="method-detail">
169
- <a name="M000004"></a>
170
-
171
- <div class="method-heading">
172
- <a href="Base.src/M000004.html" target="Code" class="method-signature"
173
- onclick="popupCode('Base.src/M000004.html');return false;">
174
- <span class="method-name">new</span><span class="method-args">(options = {})</span>
175
- </a>
176
- </div>
177
-
178
- <div class="method-description">
179
- </div>
180
- </div>
181
-
182
-
183
- </div>
184
-
185
-
186
- </div>
187
-
188
-
189
- <div id="validator-badges">
190
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
191
- </div>
192
-
193
- </body>
194
- </html>
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>inherited (GemPlugin::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
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
- </body>
20
- </html>
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>category= (GemPlugin::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
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-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
- </body>
18
- </html>
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (GemPlugin::Base)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
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
- </body>
18
- </html>
@@ -1,377 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: GemPlugin::Manager</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">GemPlugin::Manager</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/gem_plugin_rb.html">
59
- lib/gem_plugin.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- This class is used by people who use gem plugins (but don&#8216;t
84
- necessarily make them) to add plugins to their own systems. It provides a
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.
87
- </p>
88
- <p>
89
- It is a singleton so you use like this: GemPlugins::Manager.instance.<a
90
- href="Manager.html#M000006">load</a>
91
- </p>
92
-
93
- </div>
94
-
95
-
96
- </div>
97
-
98
- <div id="method-list">
99
- <h3 class="section-bar">Methods</h3>
100
-
101
- <div class="name-list">
102
- <a href="#M000011">config</a>&nbsp;&nbsp;
103
- <a href="#M000008">create</a>&nbsp;&nbsp;
104
- <a href="#M000006">load</a>&nbsp;&nbsp;
105
- <a href="#M000009">loaded?</a>&nbsp;&nbsp;
106
- <a href="#M000005">new</a>&nbsp;&nbsp;
107
- <a href="#M000007">register</a>&nbsp;&nbsp;
108
- <a href="#M000010">resource</a>&nbsp;&nbsp;
109
- </div>
110
- </div>
111
-
112
- </div>
113
-
114
-
115
- <!-- if includes -->
116
- <div id="includes">
117
- <h3 class="section-bar">Included Modules</h3>
118
-
119
- <div id="includes-list">
120
- <span class="include-name">Singleton</span>
121
- </div>
122
- </div>
123
-
124
- <div id="section">
125
-
126
-
127
-
128
-
129
-
130
- <div id="attribute-list">
131
- <h3 class="section-bar">Attributes</h3>
132
-
133
- <div class="name-list">
134
- <table>
135
- <tr class="top-aligned-row context-row">
136
- <td class="context-item-name">gems</td>
137
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
138
- <td class="context-item-desc"></td>
139
- </tr>
140
- <tr class="top-aligned-row context-row">
141
- <td class="context-item-name">plugins</td>
142
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143
- <td class="context-item-desc"></td>
144
- </tr>
145
- </table>
146
- </div>
147
- </div>
148
-
149
-
150
-
151
- <!-- if method_list -->
152
- <div id="methods">
153
- <h3 class="section-bar">Public Class methods</h3>
154
-
155
- <div id="method-M000005" class="method-detail">
156
- <a name="M000005"></a>
157
-
158
- <div class="method-heading">
159
- <a href="Manager.src/M000005.html" target="Code" class="method-signature"
160
- onclick="popupCode('Manager.src/M000005.html');return false;">
161
- <span class="method-name">new</span><span class="method-args">()</span>
162
- </a>
163
- </div>
164
-
165
- <div class="method-description">
166
- </div>
167
- </div>
168
-
169
- <h3 class="section-bar">Public Instance methods</h3>
170
-
171
- <div id="method-M000011" class="method-detail">
172
- <a name="M000011"></a>
173
-
174
- <div class="method-heading">
175
- <a href="Manager.src/M000011.html" target="Code" class="method-signature"
176
- onclick="popupCode('Manager.src/M000011.html');return false;">
177
- <span class="method-name">config</span><span class="method-args">(gem_name, options={})</span>
178
- </a>
179
- </div>
180
-
181
- <div class="method-description">
182
- <p>
183
- While <a href="Manager.html#M000010">Manager.resource</a> will find
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>.
190
- </p>
191
- <p>
192
- How you use the method is you get the options the user wants set, pass them
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.
196
- </p>
197
- <pre>
198
- opts = Manager.instance.config &quot;mygem&quot;, :age =&gt; 12, :max_load =&gt; .9
199
- </pre>
200
- <p>
201
- In the above case, if defaults had {:age =&gt; 14} then it would be changed
202
- to 12.
203
- </p>
204
- <p>
205
- This loads the .yaml file on the fly every time, so doing it a whole lot is
206
- very stupid. If you need to make frequent calls to this, call it once with
207
- no options (Manager.instance.<a href="Manager.html#M000011">config</a>)
208
- then use the returned defaults directly from then on.
209
- </p>
210
- </div>
211
- </div>
212
-
213
- <div id="method-M000008" class="method-detail">
214
- <a name="M000008"></a>
215
-
216
- <div class="method-heading">
217
- <a href="Manager.src/M000008.html" target="Code" class="method-signature"
218
- onclick="popupCode('Manager.src/M000008.html');return false;">
219
- <span class="method-name">create</span><span class="method-args">(name, options = {})</span>
220
- </a>
221
- </div>
222
-
223
- <div class="method-description">
224
- <p>
225
- Resolves the given name (should include /category/name) to find the plugin
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.
228
- </p>
229
- </div>
230
- </div>
231
-
232
- <div id="method-M000006" class="method-detail">
233
- <a name="M000006"></a>
234
-
235
- <div class="method-heading">
236
- <a href="Manager.src/M000006.html" target="Code" class="method-signature"
237
- onclick="popupCode('Manager.src/M000006.html');return false;">
238
- <span class="method-name">load</span><span class="method-args">(needs = {})</span>
239
- </a>
240
- </div>
241
-
242
- <div class="method-description">
243
- <p>
244
- Responsible for going through the list of available gems and loading any
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.
247
- </p>
248
- <p>
249
- It accepts one parameter which is a hash of gem depends that should include
250
- or exclude a gem from being loaded. A gem must depend on gem_plugin to be
251
- considered, but then each system has to add it&#8216;s own INCLUDE to make
252
- sure that only plugins related to it are loaded.
253
- </p>
254
- <p>
255
- An example again comes from Mongrel. In order to <a
256
- href="Manager.html#M000006">load</a> all Mongrel plugins:
257
- </p>
258
- <pre>
259
- GemPlugin::Manager.instance.load &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE
260
- </pre>
261
- <p>
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:
266
- </p>
267
- <p>
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.
275
- </p>
276
- <p>
277
- NOTE: Currently RubyGems will run autorequire on gems that get required AND
278
- on their dependencies. This really messes with people running edge rails
279
- since activerecord or other stuff gets loaded for just touching a gem
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.
283
- </p>
284
- </div>
285
- </div>
286
-
287
- <div id="method-M000009" class="method-detail">
288
- <a name="M000009"></a>
289
-
290
- <div class="method-heading">
291
- <a href="Manager.src/M000009.html" target="Code" class="method-signature"
292
- onclick="popupCode('Manager.src/M000009.html');return false;">
293
- <span class="method-name">loaded?</span><span class="method-args">(gem_name)</span>
294
- </a>
295
- </div>
296
-
297
- <div class="method-description">
298
- <p>
299
- Simply says whether the given gem has been loaded yet or not.
300
- </p>
301
- </div>
302
- </div>
303
-
304
- <div id="method-M000007" class="method-detail">
305
- <a name="M000007"></a>
306
-
307
- <div class="method-heading">
308
- <a href="Manager.src/M000007.html" target="Code" class="method-signature"
309
- onclick="popupCode('Manager.src/M000007.html');return false;">
310
- <span class="method-name">register</span><span class="method-args">(category, name, klass)</span>
311
- </a>
312
- </div>
313
-
314
- <div class="method-description">
315
- <p>
316
- Not necessary for you to call directly, but this is how <a
317
- href="Base.html#M000002">GemPlugin::Base.inherited</a> actually adds a
318
- plugin to a category.
319
- </p>
320
- </div>
321
- </div>
322
-
323
- <div id="method-M000010" class="method-detail">
324
- <a name="M000010"></a>
325
-
326
- <div class="method-heading">
327
- <a href="Manager.src/M000010.html" target="Code" class="method-signature"
328
- onclick="popupCode('Manager.src/M000010.html');return false;">
329
- <span class="method-name">resource</span><span class="method-args">(gem_name, path)</span>
330
- </a>
331
- </div>
332
-
333
- <div class="method-description">
334
- <p>
335
- GemPlugins can have a &#8216;resources&#8217; directory which is packaged
336
- with them and can hold any data resources the plugin may need. The main
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.
341
- </p>
342
- <p>
343
- Let&#8216;s say you have a &#8216;resources/stylesheets/default.css&#8217;
344
- file in your gem distribution, then finding where this file really is
345
- involves:
346
- </p>
347
- <pre>
348
- Manager.instance.resource(&quot;mygem&quot;, &quot;/stylesheets/default.css&quot;)
349
- </pre>
350
- <p>
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.
354
- </p>
355
- <p>
356
- If you request a path for a <a href="../GemPlugin.html">GemPlugin</a> that
357
- hasn&#8216;t been loaded yet then it will throw an <a
358
- href="PluginNotLoaded.html">PluginNotLoaded</a> exception. The gem may be
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.
361
- </p>
362
- </div>
363
- </div>
364
-
365
-
366
- </div>
367
-
368
-
369
- </div>
370
-
371
-
372
- <div id="validator-badges">
373
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
374
- </div>
375
-
376
- </body>
377
- </html>