radiant-ray-extension 3.0.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -0
- data/README.markdown +30 -0
- data/Rakefile +26 -0
- data/bin/ray +5 -0
- data/doc/Extension.html +1189 -0
- data/doc/Ray.html +175 -0
- data/doc/Ray/CLI.html +585 -0
- data/doc/Ray/Cache.html +709 -0
- data/doc/Ray/Gem.html +760 -0
- data/doc/Ray/Git.html +278 -0
- data/doc/Ray/GitHub.html +553 -0
- data/doc/Ray/RubyGems.html +501 -0
- data/doc/Ray/Zip.html +300 -0
- data/doc/Search.html +433 -0
- data/doc/String.html +242 -0
- data/doc/_index.html +84 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.LICENSE.html +85 -0
- data/doc/file.README.html +97 -0
- data/doc/file_list.html +46 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +84 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +46 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/ray.rb +8 -0
- data/lib/ray/cli.rb +271 -0
- data/lib/ray/constants.rb +17 -0
- data/lib/ray/extension.rb +116 -0
- data/lib/ray/extension/gem.rb +96 -0
- data/lib/ray/extension/git.rb +30 -0
- data/lib/ray/extension/zip.rb +44 -0
- data/lib/ray/search.rb +62 -0
- data/lib/ray/search/cache.rb +61 -0
- data/lib/ray/search/github.rb +40 -0
- data/lib/ray/search/rubygems.rb +36 -0
- data/lib/ray/string.rb +18 -0
- data/ray.gemspec +31 -0
- data/spec/fixtures/Gemfile +4 -0
- data/spec/fixtures/cache_single.yml +8 -0
- data/spec/fixtures/cassettes/github_v2_api_no_matches.yml +38 -0
- data/spec/fixtures/cassettes/github_v2_api_search_no_matches.yml +38 -0
- data/spec/fixtures/cassettes/github_v2_api_search_reorder_children.yml +75 -0
- data/spec/fixtures/cassettes/github_v2_api_search_single.yml +74 -0
- data/spec/fixtures/cassettes/github_v3_api_owner_name.yml +75 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_gem_info.yml +36 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_no_matches.yml +34 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_search_no_matches.yml +34 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_search_reorder.yml +36 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_search_reorder_children.yml +36 -0
- data/spec/fixtures/cassettes/rubygems_v1_api_search_single.yml +41 -0
- data/spec/fixtures/cassettes/zip_file.yml +101 -0
- data/spec/fixtures/dummy.zip +0 -0
- data/spec/fixtures/dummy/README +1 -0
- data/spec/fixtures/dummy/Rakefile +109 -0
- data/spec/fixtures/dummy/config/initializers/radiant_config.rb +3 -0
- data/spec/fixtures/dummy/config/locales/en.yml +3 -0
- data/spec/fixtures/dummy/config/routes.rb +5 -0
- data/spec/fixtures/dummy/dummy_extension.rb +21 -0
- data/spec/fixtures/dummy/lib/radiant-dummy-extension.rb +8 -0
- data/spec/fixtures/dummy/lib/tasks/dummy_extension_tasks.rake +47 -0
- data/spec/fixtures/dummy/public/stylesheets/extensions/dummy/dummy.css +0 -0
- data/spec/fixtures/dummy/radiant-dummy-extension.gemspec +29 -0
- data/spec/ray/cli_spec.rb +56 -0
- data/spec/ray/extension/gem_spec.rb +214 -0
- data/spec/ray/extension/git_spec.rb +216 -0
- data/spec/ray/extension/zip_spec.rb +239 -0
- data/spec/ray/search/cache_spec.rb +74 -0
- data/spec/ray/search/github_spec.rb +137 -0
- data/spec/ray/search/rubygems_spec.rb +127 -0
- data/spec/ray/string_spec.rb +30 -0
- data/spec/spec_helper.rb +27 -0
- metadata +205 -0
data/doc/Ray/Zip.html
ADDED
@@ -0,0 +1,300 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Ray::Zip
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (Z)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../Ray.html" title="Ray (module)">Ray</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Zip</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: Ray::Zip
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">Ray::Zip</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<dt class="r2">Includes:</dt>
|
87
|
+
<dd class="r2"><span class='object_link'><a href="../Extension.html" title="Extension (module)">Extension</a></span></dd>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
94
|
+
<dd class="r1 last">lib/ray/extension/zip.rb</dd>
|
95
|
+
|
96
|
+
</dl>
|
97
|
+
<div class="clear"></div>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>Instance Attribute Summary</h2>
|
111
|
+
|
112
|
+
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Extension.html" title="Extension (module)">Extension</a></span></h3>
|
113
|
+
<p class="inherited"><span class='object_link'><a href="../Extension.html#author-instance_method" title="Extension#author (method)">author</a></span>, <span class='object_link'><a href="../Extension.html#description-instance_method" title="Extension#description (method)">description</a></span>, <span class='object_link'><a href="../Extension.html#homepage-instance_method" title="Extension#homepage (method)">homepage</a></span>, <span class='object_link'><a href="../Extension.html#name-instance_method" title="Extension#name (method)">name</a></span>, <span class='object_link'><a href="../Extension.html#uri-instance_method" title="Extension#uri (method)">uri</a></span>, <span class='object_link'><a href="../Extension.html#version-instance_method" title="Extension#version (method)">version</a></span></p>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<h2>
|
118
|
+
Instance Method Summary
|
119
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
120
|
+
</h2>
|
121
|
+
|
122
|
+
<ul class="summary">
|
123
|
+
|
124
|
+
<li class="public ">
|
125
|
+
<span class="summary_signature">
|
126
|
+
|
127
|
+
<a href="#extract-instance_method" title="#extract (instance method)">- (Object) <strong>extract</strong> </a>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</span>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<span class="summary_desc"><div class='inline'>
|
141
|
+
</div></span>
|
142
|
+
|
143
|
+
</li>
|
144
|
+
|
145
|
+
|
146
|
+
<li class="public ">
|
147
|
+
<span class="summary_signature">
|
148
|
+
|
149
|
+
<a href="#install-instance_method" title="#install (instance method)">- (Object) <strong>install</strong> </a>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
</span>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<span class="summary_desc"><div class='inline'>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
</ul>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Extension.html" title="Extension (module)">Extension</a></span></h3>
|
180
|
+
<p class="inherited"><span class='object_link'><a href="../Extension.html#cleanup-instance_method" title="Extension#cleanup (method)">#cleanup</a></span>, <span class='object_link'><a href="../Extension.html#disable-instance_method" title="Extension#disable (method)">#disable</a></span>, <span class='object_link'><a href="../Extension.html#download-instance_method" title="Extension#download (method)">#download</a></span>, <span class='object_link'><a href="../Extension.html#enable-instance_method" title="Extension#enable (method)">#enable</a></span>, <span class='object_link'><a href="../Extension.html#initialize-instance_method" title="Extension#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../Extension.html#load_tasks-instance_method" title="Extension#load_tasks (method)">#load_tasks</a></span>, <span class='object_link'><a href="../Extension.html#public_service_announcement-instance_method" title="Extension#public_service_announcement (method)">#public_service_announcement</a></span>, <span class='object_link'><a href="../Extension.html#run_task-instance_method" title="Extension#run_task (method)">#run_task</a></span>, <span class='object_link'><a href="../Extension.html#run_tasks-instance_method" title="Extension#run_tasks (method)">#run_tasks</a></span>, <span class='object_link'><a href="../Extension.html#uninstall-instance_method" title="Extension#uninstall (method)">#uninstall</a></span>, <span class='object_link'><a href="../Extension.html#vendor-instance_method" title="Extension#vendor (method)">#vendor</a></span></p>
|
181
|
+
<div id="constructor_details" class="method_details_list">
|
182
|
+
<h2>Constructor Details</h2>
|
183
|
+
|
184
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../Extension.html#initialize-instance_method" title="Extension#initialize (method)">Extension</a></span></p>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
<div id="instance_method_details" class="method_details_list">
|
190
|
+
<h2>Instance Method Details</h2>
|
191
|
+
|
192
|
+
|
193
|
+
<div class="method_details first">
|
194
|
+
<p class="signature first" id="extract-instance_method">
|
195
|
+
|
196
|
+
- (<tt>Object</tt>) <strong>extract</strong>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</p><table class="source_code">
|
201
|
+
<tr>
|
202
|
+
<td>
|
203
|
+
<pre class="lines">
|
204
|
+
|
205
|
+
|
206
|
+
26
|
207
|
+
27
|
208
|
+
28
|
209
|
+
29
|
210
|
+
30
|
211
|
+
31
|
212
|
+
32
|
213
|
+
33
|
214
|
+
34
|
215
|
+
35
|
216
|
+
36
|
217
|
+
37
|
218
|
+
38
|
219
|
+
39
|
220
|
+
40</pre>
|
221
|
+
</td>
|
222
|
+
<td>
|
223
|
+
<pre class="code"><span class="info file"># File 'lib/ray/extension/zip.rb', line 26</span>
|
224
|
+
|
225
|
+
<span class='kw'>def</span> <span class='id extract'>extract</span>
|
226
|
+
<span class='kw'>if</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id glob'>glob</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>Ray</span><span class='op'>::</span><span class='const'>TMP_DIR</span><span class='rbrace'>}</span><span class='tstring_content'>/*</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>!=</span> <span class='int'>1</span>
|
227
|
+
<span class='id raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The file does not exist</span><span class='tstring_end'>"</span></span>
|
228
|
+
<span class='kw'>end</span>
|
229
|
+
|
230
|
+
<span class='id archive'>archive</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id glob'>glob</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>Ray</span><span class='op'>::</span><span class='const'>TMP_DIR</span><span class='rbrace'>}</span><span class='tstring_content'>/*</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id first'>first</span>
|
231
|
+
<span class='op'>::</span><span class='const'>Zip</span><span class='op'>::</span><span class='const'>ZipFile</span><span class='period'>.</span><span class='id open'>open</span> <span class='id archive'>archive</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id zip_file'>zip_file</span><span class='op'>|</span>
|
232
|
+
<span class='id zip_file'>zip_file</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id f'>f</span><span class='op'>|</span>
|
233
|
+
<span class='id f_path'>f_path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id join'>join</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>Ray</span><span class='op'>::</span><span class='const'>TMP_DIR</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id f'>f</span><span class='period'>.</span><span class='id name'>name</span>
|
234
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id mkdir_p'>mkdir_p</span> <span class='const'>File</span><span class='period'>.</span><span class='id dirname'>dirname</span> <span class='id f_path'>f_path</span>
|
235
|
+
<span class='id zip_file'>zip_file</span><span class='period'>.</span><span class='id extract'>extract</span> <span class='id f'>f</span><span class='comma'>,</span> <span class='id f_path'>f_path</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id exist?'>exist?</span> <span class='id f_path'>f_path</span>
|
236
|
+
<span class='kw'>end</span>
|
237
|
+
<span class='kw'>end</span>
|
238
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id rm'>rm</span> <span class='id archive'>archive</span>
|
239
|
+
<span class='kw'>end</span></pre>
|
240
|
+
</td>
|
241
|
+
</tr>
|
242
|
+
</table>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div class="method_details ">
|
246
|
+
<p class="signature " id="install-instance_method">
|
247
|
+
|
248
|
+
- (<tt>Object</tt>) <strong>install</strong>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
</p><table class="source_code">
|
253
|
+
<tr>
|
254
|
+
<td>
|
255
|
+
<pre class="lines">
|
256
|
+
|
257
|
+
|
258
|
+
14
|
259
|
+
15
|
260
|
+
16
|
261
|
+
17
|
262
|
+
18
|
263
|
+
19
|
264
|
+
20
|
265
|
+
21
|
266
|
+
22
|
267
|
+
23
|
268
|
+
24</pre>
|
269
|
+
</td>
|
270
|
+
<td>
|
271
|
+
<pre class="code"><span class="info file"># File 'lib/ray/extension/zip.rb', line 14</span>
|
272
|
+
|
273
|
+
<span class='kw'>def</span> <span class='id install'>install</span>
|
274
|
+
<span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id exist?'>exist?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>Ray</span><span class='op'>::</span><span class='const'>EXT_DIR</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
275
|
+
<span class='id raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The </span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='rbrace'>}</span><span class='tstring_content'> extension is already installed</span><span class='tstring_end'>"</span></span>
|
276
|
+
<span class='kw'>end</span>
|
277
|
+
|
278
|
+
<span class='id download'>download</span>
|
279
|
+
<span class='id extract'>extract</span>
|
280
|
+
<span class='id vendor'>vendor</span>
|
281
|
+
<span class='id run_tasks'>run_tasks</span>
|
282
|
+
<span class='id cleanup'>cleanup</span>
|
283
|
+
<span class='kw'>end</span></pre>
|
284
|
+
</td>
|
285
|
+
</tr>
|
286
|
+
</table>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div id="footer">
|
294
|
+
Generated on Sun Nov 20 20:26:44 2011 by
|
295
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
296
|
+
0.7.3 (ruby-1.9.3).
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</body>
|
300
|
+
</html>
|
data/doc/Search.html
ADDED
@@ -0,0 +1,433 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Search
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="_index.html">Index (S)</a> »
|
37
|
+
|
38
|
+
|
39
|
+
<span class="title">Search</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Search
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<dt class="r1">Included in:</dt>
|
74
|
+
<dd class="r1"><span class='object_link'><a href="Ray/Cache.html" title="Ray::Cache (class)">Ray::Cache</a></span>, <span class='object_link'><a href="Ray/GitHub.html" title="Ray::GitHub (class)">Ray::GitHub</a></span>, <span class='object_link'><a href="Ray/RubyGems.html" title="Ray::RubyGems (class)">Ray::RubyGems</a></span></dd>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<dt class="r2 last">Defined in:</dt>
|
79
|
+
<dd class="r2 last">lib/ray/search.rb</dd>
|
80
|
+
|
81
|
+
</dl>
|
82
|
+
<div class="clear"></div>
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<h2>
|
91
|
+
Instance Method Summary
|
92
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
93
|
+
</h2>
|
94
|
+
|
95
|
+
<ul class="summary">
|
96
|
+
|
97
|
+
<li class="public ">
|
98
|
+
<span class="summary_signature">
|
99
|
+
|
100
|
+
<a href="#cache-instance_method" title="#cache (instance method)">- (Object) <strong>cache</strong> </a>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
</span>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<span class="summary_desc"><div class='inline'>
|
114
|
+
</div></span>
|
115
|
+
|
116
|
+
</li>
|
117
|
+
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#merge-instance_method" title="#merge (instance method)">- (Object) <strong>merge</strong>(other) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<span class="summary_desc"><div class='inline'>
|
136
|
+
</div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#multiple_choice-instance_method" title="#multiple_choice (instance method)">- (Object) <strong>multiple_choice</strong> </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<span class="summary_desc"><div class='inline'>
|
158
|
+
</div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
<li class="public ">
|
164
|
+
<span class="summary_signature">
|
165
|
+
|
166
|
+
<a href="#output-instance_method" title="#output (instance method)">- (Object) <strong>output</strong> </a>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</span>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#search-instance_method" title="#search (instance method)">- (Object) <strong>search</strong> </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<span class="summary_desc"><div class='inline'>
|
202
|
+
</div></span>
|
203
|
+
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
</ul>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<div id="instance_method_details" class="method_details_list">
|
213
|
+
<h2>Instance Method Details</h2>
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method_details first">
|
217
|
+
<p class="signature first" id="cache-instance_method">
|
218
|
+
|
219
|
+
- (<tt>Object</tt>) <strong>cache</strong>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</p><table class="source_code">
|
224
|
+
<tr>
|
225
|
+
<td>
|
226
|
+
<pre class="lines">
|
227
|
+
|
228
|
+
|
229
|
+
13
|
230
|
+
14
|
231
|
+
15
|
232
|
+
16
|
233
|
+
17
|
234
|
+
18
|
235
|
+
19
|
236
|
+
20
|
237
|
+
21
|
238
|
+
22
|
239
|
+
23
|
240
|
+
24
|
241
|
+
25</pre>
|
242
|
+
</td>
|
243
|
+
<td>
|
244
|
+
<pre class="code"><span class="info file"># File 'lib/ray/search.rb', line 13</span>
|
245
|
+
|
246
|
+
<span class='kw'>def</span> <span class='id cache'>cache</span>
|
247
|
+
<span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id exist?'>exist?</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>CACHE</span>
|
248
|
+
<span class='id cache'>cache</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id load_file'>load_file</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>CACHE</span>
|
249
|
+
<span class='kw'>else</span>
|
250
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id mkdir_p'>mkdir_p</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>RAY</span>
|
251
|
+
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id touch'>touch</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>CACHE</span>
|
252
|
+
<span class='id cache'>cache</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
253
|
+
<span class='kw'>end</span>
|
254
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id open'>open</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>CACHE</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>w</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id f'>f</span><span class='op'>|</span>
|
255
|
+
<span class='id f'>f</span><span class='period'>.</span><span class='id write'>write</span> <span class='id cache'>cache</span><span class='period'>.</span><span class='id merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@results</span><span class='rparen'>)</span><span class='period'>.</span><span class='id to_yaml'>to_yaml</span>
|
256
|
+
<span class='kw'>end</span>
|
257
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
258
|
+
<span class='kw'>end</span></pre>
|
259
|
+
</td>
|
260
|
+
</tr>
|
261
|
+
</table>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
<div class="method_details ">
|
265
|
+
<p class="signature " id="merge-instance_method">
|
266
|
+
|
267
|
+
- (<tt>Object</tt>) <strong>merge</strong>(other)
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
</p><table class="source_code">
|
272
|
+
<tr>
|
273
|
+
<td>
|
274
|
+
<pre class="lines">
|
275
|
+
|
276
|
+
|
277
|
+
57
|
278
|
+
58
|
279
|
+
59
|
280
|
+
60</pre>
|
281
|
+
</td>
|
282
|
+
<td>
|
283
|
+
<pre class="code"><span class="info file"># File 'lib/ray/search.rb', line 57</span>
|
284
|
+
|
285
|
+
<span class='kw'>def</span> <span class='id merge'>merge</span> <span class='id other'>other</span>
|
286
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id merge!'>merge!</span> <span class='id other'>other</span><span class='period'>.</span><span class='id results'>results</span>
|
287
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
288
|
+
<span class='kw'>end</span></pre>
|
289
|
+
</td>
|
290
|
+
</tr>
|
291
|
+
</table>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
<div class="method_details ">
|
295
|
+
<p class="signature " id="multiple_choice-instance_method">
|
296
|
+
|
297
|
+
- (<tt>Object</tt>) <strong>multiple_choice</strong>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</p><table class="source_code">
|
302
|
+
<tr>
|
303
|
+
<td>
|
304
|
+
<pre class="lines">
|
305
|
+
|
306
|
+
|
307
|
+
50
|
308
|
+
51
|
309
|
+
52
|
310
|
+
53
|
311
|
+
54
|
312
|
+
55</pre>
|
313
|
+
</td>
|
314
|
+
<td>
|
315
|
+
<pre class="code"><span class="info file"># File 'lib/ray/search.rb', line 50</span>
|
316
|
+
|
317
|
+
<span class='kw'>def</span> <span class='id multiple_choice'>multiple_choice</span>
|
318
|
+
<span class='id puts'>puts</span> <span class='id output'>output</span>
|
319
|
+
<span class='id print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Which extension do you want to install? </span><span class='tstring_end'>"</span></span>
|
320
|
+
<span class='id choice'>choice</span> <span class='op'>=</span> <span class='const'>STDIN</span><span class='period'>.</span><span class='id gets'>gets</span><span class='period'>.</span><span class='id chomp'>chomp</span>
|
321
|
+
<span class='ivar'>@results</span><span class='lbracket'>[</span><span class='id choice'>choice</span><span class='rbracket'>]</span>
|
322
|
+
<span class='kw'>end</span></pre>
|
323
|
+
</td>
|
324
|
+
</tr>
|
325
|
+
</table>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
<div class="method_details ">
|
329
|
+
<p class="signature " id="output-instance_method">
|
330
|
+
|
331
|
+
- (<tt>Object</tt>) <strong>output</strong>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</p><table class="source_code">
|
336
|
+
<tr>
|
337
|
+
<td>
|
338
|
+
<pre class="lines">
|
339
|
+
|
340
|
+
|
341
|
+
27
|
342
|
+
28
|
343
|
+
29
|
344
|
+
30
|
345
|
+
31
|
346
|
+
32
|
347
|
+
33
|
348
|
+
34
|
349
|
+
35
|
350
|
+
36
|
351
|
+
37
|
352
|
+
38
|
353
|
+
39
|
354
|
+
40
|
355
|
+
41
|
356
|
+
42
|
357
|
+
43
|
358
|
+
44
|
359
|
+
45
|
360
|
+
46
|
361
|
+
47
|
362
|
+
48</pre>
|
363
|
+
</td>
|
364
|
+
<td>
|
365
|
+
<pre class="code"><span class="info file"># File 'lib/ray/search.rb', line 27</span>
|
366
|
+
|
367
|
+
<span class='kw'>def</span> <span class='id output'>output</span>
|
368
|
+
<span class='id output'>output</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
369
|
+
<span class='kw'>if</span> <span class='ivar'>@results</span><span class='period'>.</span><span class='id empty?'>empty?</span>
|
370
|
+
<span class='id output'>output</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>%Q{</span><span class='tstring_content'>
|
371
|
+
No extensions matched: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@query</span><span class='rbrace'>}</span><span class='tstring_content'>
|
372
|
+
# URI: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@uri</span><span class='rbrace'>}</span><span class='tstring_content'>
|
373
|
+
</span><span class='tstring_end'>}</span></span><span class='period'>.</span><span class='id lstrip'>lstrip</span>
|
374
|
+
<span class='kw'>else</span>
|
375
|
+
<span class='ivar'>@results</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id extension'>extension</span><span class='op'>|</span>
|
376
|
+
<span class='id name'>name</span> <span class='op'>=</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id to_extension_name'>to_extension_name</span>
|
377
|
+
<span class='id info'>info</span> <span class='op'>=</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id last'>last</span>
|
378
|
+
<span class='id output'>output</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>%Q{</span><span class='tstring_content'>
|
379
|
+
</span><span class='embexpr_beg'>#{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-</span><span class='tstring_end'>"</span></span> <span class='op'>*</span> <span class='int'>80</span><span class='rbrace'>}</span><span class='tstring_content'>
|
380
|
+
</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:version</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>) by </span><span class='embexpr_beg'>#{</span><span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:author</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='lparen'>(</span><span class='int'>78</span> <span class='op'>-</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:version</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>) by </span><span class='tstring_end'>"</span></span><span class='period'>.</span><span class='id size'>size</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>
|
381
|
+
</span><span class='embexpr_beg'>#{</span><span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:description</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id wrap'>wrap</span><span class='lparen'>(</span><span class='int'>78</span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>
|
382
|
+
</span><span class='embexpr_beg'>#{</span><span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:homepage</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>
|
383
|
+
ray install </span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>\n
|
384
|
+
</span><span class='tstring_end'>}</span></span><span class='period'>.</span><span class='id lstrip'>lstrip</span>
|
385
|
+
<span class='kw'>end</span>
|
386
|
+
<span class='kw'>return</span> <span class='id output'>output</span>
|
387
|
+
<span class='kw'>end</span>
|
388
|
+
<span class='kw'>end</span></pre>
|
389
|
+
</td>
|
390
|
+
</tr>
|
391
|
+
</table>
|
392
|
+
</div>
|
393
|
+
|
394
|
+
<div class="method_details ">
|
395
|
+
<p class="signature " id="search-instance_method">
|
396
|
+
|
397
|
+
- (<tt>Object</tt>) <strong>search</strong>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
</p><table class="source_code">
|
402
|
+
<tr>
|
403
|
+
<td>
|
404
|
+
<pre class="lines">
|
405
|
+
|
406
|
+
|
407
|
+
9
|
408
|
+
10
|
409
|
+
11</pre>
|
410
|
+
</td>
|
411
|
+
<td>
|
412
|
+
<pre class="code"><span class="info file"># File 'lib/ray/search.rb', line 9</span>
|
413
|
+
|
414
|
+
<span class='kw'>def</span> <span class='id search'>search</span>
|
415
|
+
<span class='id normalize'>normalize</span> <span class='id open'>open</span><span class='lparen'>(</span><span class='ivar'>@uri</span><span class='rparen'>)</span><span class='period'>.</span><span class='id read'>read</span>
|
416
|
+
<span class='kw'>end</span></pre>
|
417
|
+
</td>
|
418
|
+
</tr>
|
419
|
+
</table>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</div>
|
423
|
+
|
424
|
+
</div>
|
425
|
+
|
426
|
+
<div id="footer">
|
427
|
+
Generated on Sun Nov 20 20:26:43 2011 by
|
428
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
429
|
+
0.7.3 (ruby-1.9.3).
|
430
|
+
</div>
|
431
|
+
|
432
|
+
</body>
|
433
|
+
</html>
|