autocode 0.9.3 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -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>autocreate (Autocreate)</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/autocreate.rb, line 20</span>
14
- 20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">autocreate</span>( <span class="ruby-identifier">key</span>, <span class="ruby-identifier">exemplar</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
15
- 21: ( <span class="ruby-ivar">@autocreate</span> <span class="ruby-operator">||=</span> [] ) <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">key</span>, <span class="ruby-identifier">exemplar</span>, <span class="ruby-identifier">block</span> ]
16
- 22: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
17
- 23: <span class="ruby-keyword kw">end</span></pre>
18
- </body>
19
- </html>
@@ -1,206 +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>Module: Autoload</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>Module</strong></td>
53
- <td class="class-name-in-header">Autoload</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/lib/autoload_rb.html">
59
- lib/autoload.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
- <div id="description">
76
- <p>
77
- <a href="Autoload.html">Autoload</a> allows you to specify which modules or
78
- classes to automatically load when they are referenced. This is somewhat
79
- more sophisticated than the <tt>autoinclude</tt> mechanism in the standard
80
- library. For one thing, you can cause code to be reloaded by using <a
81
- href="Reloadable.html">Reloadable</a> in conjunction with <a
82
- href="Autoload.html">Autoload</a>. For another, you can provide a search
83
- path using the <a href="Autoload.html#M000002">directories</a> method,
84
- thereby allowing you to &quot;autoinclude&quot; entire <a
85
- href="Autoload.html#M000002">directories</a> in one fell swoop.
86
- </p>
87
- <p>
88
- To use <a href="Autoload.html">Autoload</a>, you must mix it into your
89
- module or class via extend. That will provide the <a
90
- href="Autoload.html#M000001">autoload</a> and <a
91
- href="Autoload.html#M000002">directories</a> methods for you, as described
92
- below.
93
- </p>
94
- <p>
95
- A typical use case for <a href="Autoload.html">Autoload</a> looks like
96
- this:
97
- </p>
98
- <pre>
99
- require 'autocode'
100
-
101
- module Models
102
- extend Autoload; extend Reloadable
103
- autoload true; directories :models
104
- end
105
- </pre>
106
-
107
- </div>
108
-
109
-
110
- </div>
111
-
112
- <div id="method-list">
113
- <h3 class="section-bar">Methods</h3>
114
-
115
- <div class="name-list">
116
- <a href="#M000001">autoload</a>&nbsp;&nbsp;
117
- <a href="#M000003">autoload?</a>&nbsp;&nbsp;
118
- <a href="#M000002">directories</a>&nbsp;&nbsp;
119
- </div>
120
- </div>
121
-
122
- </div>
123
-
124
-
125
- <!-- if includes -->
126
-
127
- <div id="section">
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
- <!-- if method_list -->
137
- <div id="methods">
138
- <h3 class="section-bar">Public Instance methods</h3>
139
-
140
- <div id="method-M000001" class="method-detail">
141
- <a name="M000001"></a>
142
-
143
- <div class="method-heading">
144
- <a href="Autoload.src/M000001.html" target="Code" class="method-signature"
145
- onclick="popupCode('Autoload.src/M000001.html');return false;">
146
- <span class="method-name">autoload</span><span class="method-args">( *keys )</span>
147
- </a>
148
- </div>
149
-
150
- <div class="method-description">
151
- <p>
152
- Specifies that you want to <a href="Autoload.html#M000001">autoload</a>
153
- each of the constants referenced by keys. A key of true is basically a
154
- wild-card, meaning &quot;load anything&quot;.
155
- </p>
156
- </div>
157
- </div>
158
-
159
- <div id="method-M000003" class="method-detail">
160
- <a name="M000003"></a>
161
-
162
- <div class="method-heading">
163
- <a href="Autoload.src/M000003.html" target="Code" class="method-signature"
164
- onclick="popupCode('Autoload.src/M000003.html');return false;">
165
- <span class="method-name">autoload?</span><span class="method-args">( cname )</span>
166
- </a>
167
- </div>
168
-
169
- <div class="method-description">
170
- <p>
171
- Is a given constant being autoloaded?
172
- </p>
173
- </div>
174
- </div>
175
-
176
- <div id="method-M000002" class="method-detail">
177
- <a name="M000002"></a>
178
-
179
- <div class="method-heading">
180
- <a href="Autoload.src/M000002.html" target="Code" class="method-signature"
181
- onclick="popupCode('Autoload.src/M000002.html');return false;">
182
- <span class="method-name">directories</span><span class="method-args">( *dirs )</span>
183
- </a>
184
- </div>
185
-
186
- <div class="method-description">
187
- <p>
188
- Provide a list of <a href="Autoload.html#M000002">directories</a> from
189
- which a given constant might be loaded.
190
- </p>
191
- </div>
192
- </div>
193
-
194
-
195
- </div>
196
-
197
-
198
- </div>
199
-
200
-
201
- <div id="validator-badges">
202
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
203
- </div>
204
-
205
- </body>
206
- </html>
@@ -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>autoload (Autoload)</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/autoload.rb, line 26</span>
14
- 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">autoload</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">keys</span> )
15
- 27: ( <span class="ruby-ivar">@autoload</span> <span class="ruby-operator">||=</span> [] ).<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">keys</span>)
16
- 28: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
17
- 29: <span class="ruby-keyword kw">end</span></pre>
18
- </body>
19
- </html>
@@ -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>directories (Autoload)</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/autoload.rb, line 32</span>
14
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directories</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">dirs</span> )
15
- 33: ( <span class="ruby-ivar">@directories</span> <span class="ruby-operator">||=</span> [<span class="ruby-value str">'.'</span>] ).<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">dirs</span>)
16
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
17
- 35: <span class="ruby-keyword kw">end</span></pre>
18
- </body>
19
- </html>
@@ -1,25 +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>autoload? (Autoload)</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/autoload.rb, line 38</span>
14
- 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">autoload?</span>( <span class="ruby-identifier">cname</span> )
15
- 39:
16
- 40: <span class="ruby-identifier">cname</span> = <span class="ruby-identifier">cname</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z\d])([A-Z])/</span>){ <span class="ruby-node">&quot;#{$1}_#{$2.downcase}&quot;</span>}
17
- 41:
18
- 42: <span class="ruby-comment cmt"># is this name autoloadable?</span>
19
- 43: <span class="ruby-identifier">key</span> = ( <span class="ruby-ivar">@autoload</span> <span class="ruby-operator">||=</span> [] ).<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
20
- 44: <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">||</span> ( <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">cname</span> )
21
- 45: <span class="ruby-keyword kw">end</span>
22
- 46:
23
- 47: <span class="ruby-keyword kw">end</span></pre>
24
- </body>
25
- </html>
@@ -1,173 +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>Module: Reloadable</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>Module</strong></td>
53
- <td class="class-name-in-header">Reloadable</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/lib/reloadable_rb.html">
59
- lib/reloadable.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
- <div id="description">
76
- <p>
77
- <a href="Reloadable.html">Reloadable</a> simply makes it possible for a
78
- module&#8216;s code to be reloaded. <b>Important</b>: Only code loaded via
79
- <a href="Autoload.html">Autoload</a> or <a
80
- href="Autocreate.html">Autocreate</a> will be reloaded. Also, the module
81
- itself is not reloaded, only the modules and classes within it that were
82
- loaded via <b>Autocode</b>.
83
- </p>
84
- <p>
85
- To use <a href="Reloadable.html">Reloadable</a>, simply extend a given
86
- module with <a href="Reloadable.html">Reloadable</a>. This will add two
87
- methods to the module: <a href="Reloadable.html#M000005">reloadable</a> and
88
- <a href="Reloadable.html#M000006">reload</a>. These are described below.
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="#M000006">reload</a>&nbsp;&nbsp;
101
- <a href="#M000005">reloadable</a>&nbsp;&nbsp;
102
- </div>
103
- </div>
104
-
105
- </div>
106
-
107
-
108
- <!-- if includes -->
109
-
110
- <div id="section">
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <!-- if method_list -->
120
- <div id="methods">
121
- <h3 class="section-bar">Public Instance methods</h3>
122
-
123
- <div id="method-M000006" class="method-detail">
124
- <a name="M000006"></a>
125
-
126
- <div class="method-heading">
127
- <a href="Reloadable.src/M000006.html" target="Code" class="method-signature"
128
- onclick="popupCode('Reloadable.src/M000006.html');return false;">
129
- <span class="method-name">reload</span><span class="method-args">()</span>
130
- </a>
131
- </div>
132
-
133
- <div class="method-description">
134
- <p>
135
- Reloads all the constants that were loaded via <b>Autocode</b>.
136
- Technically, all <a href="Reloadable.html#M000006">reload</a> is doing is
137
- undefining them (by calling <tt>remove_const</tt> on each in turn); they
138
- won&#8216;t get reloaded until they are referenced.
139
- </p>
140
- </div>
141
- </div>
142
-
143
- <div id="method-M000005" class="method-detail">
144
- <a name="M000005"></a>
145
-
146
- <div class="method-heading">
147
- <a href="Reloadable.src/M000005.html" target="Code" class="method-signature"
148
- onclick="popupCode('Reloadable.src/M000005.html');return false;">
149
- <span class="method-name">reloadable</span><span class="method-args">( *names )</span>
150
- </a>
151
- </div>
152
-
153
- <div class="method-description">
154
- <p>
155
- Returns the list of constants that would be reloaded upon a call to <a
156
- href="Reloadable.html#M000006">reload</a>.
157
- </p>
158
- </div>
159
- </div>
160
-
161
-
162
- </div>
163
-
164
-
165
- </div>
166
-
167
-
168
- <div id="validator-badges">
169
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
170
- </div>
171
-
172
- </body>
173
- </html>