gem_plugin 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
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 195</span>
14
+ 195: <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
+ 196: <span class="ruby-constant">Base</span>.<span class="ruby-identifier">category</span> = <span class="ruby-identifier">c</span>
16
+ 197: <span class="ruby-constant">Base</span>
17
+ 198: <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,193 @@
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 reallys does nothing more than wire up the new
84
+ class into the right category. It is not thread-safe yet but will be soon.
85
+ </p>
86
+
87
+ </div>
88
+
89
+
90
+ </div>
91
+
92
+ <div id="method-list">
93
+ <h3 class="section-bar">Methods</h3>
94
+
95
+ <div class="name-list">
96
+ <a href="#M000003">category=</a>&nbsp;&nbsp;
97
+ <a href="#M000002">inherited</a>&nbsp;&nbsp;
98
+ <a href="#M000004">new</a>&nbsp;&nbsp;
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+ <!-- if includes -->
106
+
107
+ <div id="section">
108
+
109
+
110
+
111
+
112
+
113
+ <div id="attribute-list">
114
+ <h3 class="section-bar">Attributes</h3>
115
+
116
+ <div class="name-list">
117
+ <table>
118
+ <tr class="top-aligned-row context-row">
119
+ <td class="context-item-name">options</td>
120
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
121
+ <td class="context-item-desc"></td>
122
+ </tr>
123
+ </table>
124
+ </div>
125
+ </div>
126
+
127
+
128
+
129
+ <!-- if method_list -->
130
+ <div id="methods">
131
+ <h3 class="section-bar">Public Class methods</h3>
132
+
133
+ <div id="method-M000003" class="method-detail">
134
+ <a name="M000003"></a>
135
+
136
+ <div class="method-heading">
137
+ <a href="Base.src/M000003.html" target="Code" class="method-signature"
138
+ onclick="popupCode('Base.src/M000003.html');return false;">
139
+ <span class="method-name">category=</span><span class="method-args">(category)</span>
140
+ </a>
141
+ </div>
142
+
143
+ <div class="method-description">
144
+ <p>
145
+ See Mongrel::Plugin for an explanation.
146
+ </p>
147
+ </div>
148
+ </div>
149
+
150
+ <div id="method-M000002" class="method-detail">
151
+ <a name="M000002"></a>
152
+
153
+ <div class="method-heading">
154
+ <a href="Base.src/M000002.html" target="Code" class="method-signature"
155
+ onclick="popupCode('Base.src/M000002.html');return false;">
156
+ <span class="method-name">inherited</span><span class="method-args">(klass)</span>
157
+ </a>
158
+ </div>
159
+
160
+ <div class="method-description">
161
+ <p>
162
+ See Mongrel::Plugin for an explanation.
163
+ </p>
164
+ </div>
165
+ </div>
166
+
167
+ <div id="method-M000004" class="method-detail">
168
+ <a name="M000004"></a>
169
+
170
+ <div class="method-heading">
171
+ <a href="Base.src/M000004.html" target="Code" class="method-signature"
172
+ onclick="popupCode('Base.src/M000004.html');return false;">
173
+ <span class="method-name">new</span><span class="method-args">(options = {})</span>
174
+ </a>
175
+ </div>
176
+
177
+ <div class="method-description">
178
+ </div>
179
+ </div>
180
+
181
+
182
+ </div>
183
+
184
+
185
+ </div>
186
+
187
+
188
+ <div id="validator-badges">
189
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
190
+ </div>
191
+
192
+ </body>
193
+ </html>
@@ -0,0 +1,20 @@
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 166</span>
14
+ 166: <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
+ 167: <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
+ 168: <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
+ 169: <span class="ruby-ivar">@@category</span> = <span class="ruby-keyword kw">nil</span>
18
+ 170: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,18 @@
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 173</span>
14
+ 173: <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
+ 174: <span class="ruby-ivar">@@category</span> = <span class="ruby-identifier">category</span>
16
+ 175: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
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 177</span>
14
+ 177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
15
+ 178: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
16
+ 179: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,262 @@
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&#8217;t
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.
86
+ </p>
87
+ <p>
88
+ It is a singleton so you use like this: GemPlugins::Manager.instance.load
89
+ </p>
90
+
91
+ </div>
92
+
93
+
94
+ </div>
95
+
96
+ <div id="method-list">
97
+ <h3 class="section-bar">Methods</h3>
98
+
99
+ <div class="name-list">
100
+ <a href="#M000009">available</a>&nbsp;&nbsp;
101
+ <a href="#M000008">create</a>&nbsp;&nbsp;
102
+ <a href="#M000006">load</a>&nbsp;&nbsp;
103
+ <a href="#M000005">new</a>&nbsp;&nbsp;
104
+ <a href="#M000007">register</a>&nbsp;&nbsp;
105
+ </div>
106
+ </div>
107
+
108
+ </div>
109
+
110
+
111
+ <!-- if includes -->
112
+ <div id="includes">
113
+ <h3 class="section-bar">Included Modules</h3>
114
+
115
+ <div id="includes-list">
116
+ <span class="include-name">Singleton</span>
117
+ </div>
118
+ </div>
119
+
120
+ <div id="section">
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <!-- if method_list -->
130
+ <div id="methods">
131
+ <h3 class="section-bar">Public Class methods</h3>
132
+
133
+ <div id="method-M000005" class="method-detail">
134
+ <a name="M000005"></a>
135
+
136
+ <div class="method-heading">
137
+ <a href="Manager.src/M000005.html" target="Code" class="method-signature"
138
+ onclick="popupCode('Manager.src/M000005.html');return false;">
139
+ <span class="method-name">new</span><span class="method-args">()</span>
140
+ </a>
141
+ </div>
142
+
143
+ <div class="method-description">
144
+ </div>
145
+ </div>
146
+
147
+ <h3 class="section-bar">Public Instance methods</h3>
148
+
149
+ <div id="method-M000009" class="method-detail">
150
+ <a name="M000009"></a>
151
+
152
+ <div class="method-heading">
153
+ <a href="Manager.src/M000009.html" target="Code" class="method-signature"
154
+ onclick="popupCode('Manager.src/M000009.html');return false;">
155
+ <span class="method-name">available</span><span class="method-args">()</span>
156
+ </a>
157
+ </div>
158
+
159
+ <div class="method-description">
160
+ <p>
161
+ Returns a map of URIs-&gt;{&quot;name&quot; =&gt; Plugin} that you can use
162
+ to investigate available handlers.
163
+ </p>
164
+ </div>
165
+ </div>
166
+
167
+ <div id="method-M000008" class="method-detail">
168
+ <a name="M000008"></a>
169
+
170
+ <div class="method-heading">
171
+ <a href="Manager.src/M000008.html" target="Code" class="method-signature"
172
+ onclick="popupCode('Manager.src/M000008.html');return false;">
173
+ <span class="method-name">create</span><span class="method-args">(name, options = {})</span>
174
+ </a>
175
+ </div>
176
+
177
+ <div class="method-description">
178
+ <p>
179
+ Resolves the given name (should include /category/name) to find the plugin
180
+ class and create an instance. You can pass a second hash option that is
181
+ then given to the Plugin to configure it.
182
+ </p>
183
+ </div>
184
+ </div>
185
+
186
+ <div id="method-M000006" class="method-detail">
187
+ <a name="M000006"></a>
188
+
189
+ <div class="method-heading">
190
+ <a href="Manager.src/M000006.html" target="Code" class="method-signature"
191
+ onclick="popupCode('Manager.src/M000006.html');return false;">
192
+ <span class="method-name">load</span><span class="method-args">(needs = {})</span>
193
+ </a>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+ <p>
198
+ Responsible for going through the list of available gems and loading any
199
+ plugins requested. It keeps track of what it&#8217;s loaded already and
200
+ won&#8217;t load them again.
201
+ </p>
202
+ <p>
203
+ It accepts one parameter which is a hash of gem depends that should include
204
+ or exclude a gem from being loaded. A gem must depend on gem_plugin to be
205
+ considered, but then each system has to add it&#8217;s own INCLUDE to make
206
+ sure that only plugins related to it are loaded.
207
+ </p>
208
+ <p>
209
+ An example again comes from Mongrel. In order to load all Mongrel plugins:
210
+ </p>
211
+ <pre>
212
+ GemPlugin::Manager.instance.load &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE
213
+ </pre>
214
+ <p>
215
+ Which will load all plugins that depend on mongrel AND gem_plugin. Now, one
216
+ extra thing we do is we delay loading Rails Mongrel plugins until after
217
+ rails is configured. Do do this the mongrel_rails script has:
218
+ </p>
219
+ <pre>
220
+ GemPlugin::Manager.instance.load &quot;mongrel&quot; =&gt; GemPlugin::INCLUDE, &quot;rails&quot; =&gt; GemPlugin::EXCLUDE
221
+ </pre>
222
+ <p>
223
+ The only thing to remember is that this is saying &quot;include a plugin if
224
+ it depends on gem_plugin, mongrel, but NOT rails&quot;. If a plugin also
225
+ depends on other stuff then it&#8217;s loaded just fine. Only gem_plugin,
226
+ mongrel, and rails are ever used to determine if it should be included.
227
+ </p>
228
+ </div>
229
+ </div>
230
+
231
+ <div id="method-M000007" class="method-detail">
232
+ <a name="M000007"></a>
233
+
234
+ <div class="method-heading">
235
+ <a href="Manager.src/M000007.html" target="Code" class="method-signature"
236
+ onclick="popupCode('Manager.src/M000007.html');return false;">
237
+ <span class="method-name">register</span><span class="method-args">(category, name, klass)</span>
238
+ </a>
239
+ </div>
240
+
241
+ <div class="method-description">
242
+ <p>
243
+ Not necessary for you to call directly, but this is how <a
244
+ href="Base.html#M000002">GemPlugin::Base.inherited</a> actually adds a
245
+ plugin to a category.
246
+ </p>
247
+ </div>
248
+ </div>
249
+
250
+
251
+ </div>
252
+
253
+
254
+ </div>
255
+
256
+
257
+ <div id="validator-badges">
258
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
259
+ </div>
260
+
261
+ </body>
262
+ </html>