radiant-ray-extension 3.0.0.alpha → 3.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.markdown +1 -1
  2. data/Rakefile +2 -0
  3. data/doc/NilClass.html +178 -0
  4. data/doc/Ray/CLI.html +211 -197
  5. data/doc/Ray/Extension/Git.html +435 -0
  6. data/doc/Ray/Extension/RubyGem.html +858 -0
  7. data/doc/Ray/Extension/Zip.html +453 -0
  8. data/doc/Ray/Extension.html +755 -0
  9. data/doc/Ray/{Cache.html → Search/Cache.html} +108 -256
  10. data/doc/Ray/{GitHub.html → Search/GitHub.html} +167 -81
  11. data/doc/Ray/{RubyGems.html → Search/RubyGems.html} +118 -68
  12. data/doc/Ray/Search.html +822 -0
  13. data/doc/Ray.html +89 -34
  14. data/doc/String.html +99 -29
  15. data/doc/_index.html +1 -1
  16. data/doc/file.LICENSE.html +1 -1
  17. data/doc/file.README.html +2 -4
  18. data/doc/index.html +1 -1
  19. data/doc/top-level-namespace.html +3 -3
  20. data/lib/ray/cli.rb +146 -193
  21. data/lib/ray/constants.rb +7 -12
  22. data/lib/ray/extension.rb +203 -89
  23. data/lib/ray/search.rb +198 -43
  24. data/lib/ray/utility.rb +31 -0
  25. data/lib/ray.rb +2 -7
  26. data/spec/fixtures/cache_single.yml +2 -1
  27. data/spec/fixtures/cassettes/combined_search_empty.yml +71 -0
  28. data/spec/fixtures/cassettes/combined_search_multiple.yml +264 -0
  29. data/spec/fixtures/cassettes/combined_search_single.yml +108 -0
  30. data/spec/fixtures/cassettes/github_reorder_children_zip_file.yml +487 -0
  31. data/spec/fixtures/cassettes/github_sitemap_xml_zip_file.yml +553 -0
  32. data/spec/fixtures/cassettes/{github_v2_api_no_matches.yml → github_v2_search_empty.yml} +3 -3
  33. data/spec/fixtures/cassettes/github_v2_search_multiple.yml +225 -0
  34. data/spec/fixtures/cassettes/github_v2_search_single.yml +76 -0
  35. data/spec/fixtures/cassettes/{zip_file.yml → github_zip_file.yml} +3 -3
  36. data/spec/fixtures/cassettes/{rubygems_v1_api_gem_info.yml → rubygems_v1_gem_info.yml} +5 -5
  37. data/spec/fixtures/cassettes/{rubygems_v1_api_no_matches.yml → rubygems_v1_search_empty.yml} +3 -3
  38. data/spec/fixtures/cassettes/rubygems_v1_search_multiple.yml +40 -0
  39. data/spec/fixtures/cassettes/{rubygems_v1_api_search_reorder_children.yml → rubygems_v1_search_single.yml} +6 -6
  40. data/spec/fixtures/dummy.zip +0 -0
  41. data/spec/ray/extension_spec.rb +172 -0
  42. data/spec/ray/search_spec.rb +300 -0
  43. data/spec/spec_helper.rb +36 -9
  44. metadata +50 -85
  45. data/doc/Extension.html +0 -1189
  46. data/doc/Ray/Gem.html +0 -760
  47. data/doc/Ray/Git.html +0 -278
  48. data/doc/Ray/Zip.html +0 -300
  49. data/doc/Search.html +0 -433
  50. data/lib/ray/extension/gem.rb +0 -96
  51. data/lib/ray/extension/git.rb +0 -30
  52. data/lib/ray/extension/zip.rb +0 -44
  53. data/lib/ray/search/cache.rb +0 -61
  54. data/lib/ray/search/github.rb +0 -40
  55. data/lib/ray/search/rubygems.rb +0 -36
  56. data/lib/ray/string.rb +0 -18
  57. data/spec/fixtures/Gemfile +0 -4
  58. data/spec/fixtures/cassettes/github_v2_api_search_no_matches.yml +0 -38
  59. data/spec/fixtures/cassettes/github_v2_api_search_reorder_children.yml +0 -75
  60. data/spec/fixtures/cassettes/github_v2_api_search_single.yml +0 -74
  61. data/spec/fixtures/cassettes/github_v3_api_owner_name.yml +0 -75
  62. data/spec/fixtures/cassettes/rubygems_v1_api_search_no_matches.yml +0 -34
  63. data/spec/fixtures/cassettes/rubygems_v1_api_search_reorder.yml +0 -36
  64. data/spec/fixtures/cassettes/rubygems_v1_api_search_single.yml +0 -41
  65. data/spec/fixtures/dummy/README +0 -1
  66. data/spec/fixtures/dummy/Rakefile +0 -109
  67. data/spec/fixtures/dummy/config/initializers/radiant_config.rb +0 -3
  68. data/spec/fixtures/dummy/config/locales/en.yml +0 -3
  69. data/spec/fixtures/dummy/config/routes.rb +0 -5
  70. data/spec/fixtures/dummy/dummy_extension.rb +0 -21
  71. data/spec/fixtures/dummy/lib/radiant-dummy-extension.rb +0 -8
  72. data/spec/fixtures/dummy/lib/tasks/dummy_extension_tasks.rake +0 -47
  73. data/spec/fixtures/dummy/public/stylesheets/extensions/dummy/dummy.css +0 -0
  74. data/spec/fixtures/dummy/radiant-dummy-extension.gemspec +0 -29
  75. data/spec/ray/extension/gem_spec.rb +0 -214
  76. data/spec/ray/extension/git_spec.rb +0 -216
  77. data/spec/ray/extension/zip_spec.rb +0 -239
  78. data/spec/ray/search/cache_spec.rb +0 -74
  79. data/spec/ray/search/github_spec.rb +0 -137
  80. data/spec/ray/search/rubygems_spec.rb +0 -127
  81. data/spec/ray/string_spec.rb +0 -30
data/doc/Ray/CLI.html CHANGED
@@ -100,9 +100,9 @@
100
100
 
101
101
  <h2>Overview</h2><div class="docstring">
102
102
  <div class="discussion">
103
- <p>This is the CLI for Ray.
104
- If you&rsquo;re trying to figure out how to use the Ray CLI
105
- refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
103
+ <p>Ray&rsquo;s command line interface.
104
+ See the <a href="http://johnmuhl.github.com/radiant-ray-extension/">User Manual</a>
105
+ for complete command line usage.</p>
106
106
 
107
107
 
108
108
  </div>
@@ -132,28 +132,6 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
132
132
  <li class="public ">
133
133
  <span class="summary_signature">
134
134
 
135
- <a href="#cache-instance_method" title="#cache (instance method)">- (Object) <strong>cache</strong> </a>
136
-
137
-
138
-
139
- </span>
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
- <span class="summary_desc"><div class='inline'>
149
- </div></span>
150
-
151
- </li>
152
-
153
-
154
- <li class="public ">
155
- <span class="summary_signature">
156
-
157
135
  <a href="#install-instance_method" title="#install (instance method)">- (Object) <strong>install</strong>(*extensions) </a>
158
136
 
159
137
 
@@ -167,7 +145,7 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
167
145
 
168
146
 
169
147
 
170
- <span class="summary_desc"><div class='inline'>
148
+ <span class="summary_desc"><div class='inline'><p>Install extensions.</p>
171
149
  </div></span>
172
150
 
173
151
  </li>
@@ -176,7 +154,7 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
176
154
  <li class="public ">
177
155
  <span class="summary_signature">
178
156
 
179
- <a href="#search-instance_method" title="#search (instance method)">- (Object) <strong>search</strong>(query) </a>
157
+ <a href="#search-instance_method" title="#search (instance method)">- (Object) <strong>search</strong>(query = nil) </a>
180
158
 
181
159
 
182
160
 
@@ -189,7 +167,7 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
189
167
 
190
168
 
191
169
 
192
- <span class="summary_desc"><div class='inline'>
170
+ <span class="summary_desc"><div class='inline'><p>Search for extensions.</p>
193
171
  </div></span>
194
172
 
195
173
  </li>
@@ -230,56 +208,70 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
230
208
 
231
209
 
232
210
  <div class="method_details first">
233
- <p class="signature first" id="cache-instance_method">
211
+ <p class="signature first" id="install-instance_method">
234
212
 
235
- - (<tt>Object</tt>) <strong>cache</strong>
213
+ - (<tt>Object</tt>) <strong>install</strong>(*extensions)
236
214
 
237
215
 
238
216
 
239
- </p><table class="source_code">
240
- <tr>
241
- <td>
242
- <pre class="lines">
217
+ </p><div class="docstring">
218
+ <div class="discussion">
219
+ <p>Install extensions</p>
243
220
 
244
221
 
245
- 191
246
- 192
247
- 193
248
- 194
249
- 195
250
- 196
251
- 197
252
- 198</pre>
253
- </td>
254
- <td>
255
- <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 191</span>
256
-
257
- <span class='kw'>def</span> <span class='id cache'>cache</span>
258
- <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>clear</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
259
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id clear'>clear</span>
260
- <span class='kw'>else</span>
261
- <span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>pp</span><span class='tstring_end'>&quot;</span></span>
262
- <span class='id say'>say</span> <span class='const'>File</span><span class='period'>.</span><span class='id read'>read</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>CACHE</span>
263
- <span class='kw'>end</span>
264
- <span class='kw'>end</span></pre>
265
- </td>
266
- </tr>
267
- </table>
222
+ </div>
268
223
  </div>
269
-
270
- <div class="method_details ">
271
- <p class="signature " id="install-instance_method">
272
-
273
- - (<tt>Object</tt>) <strong>install</strong>(*extensions)
224
+ <div class="tags">
274
225
 
226
+ <div class="examples">
227
+ <h3>Examples:</h3>
228
+
229
+ <h4><div class='inline'>
230
+ </div></h4>
231
+ <pre class="example code">ray install reorder-children
232
+ ray install reorder-children --git
233
+ ray install reorder-children --rubygem
234
+ ray install reorder-children --zip</pre>
235
+
236
+ </div>
275
237
 
276
-
277
- </p><table class="source_code">
238
+
239
+ </div><table class="source_code">
278
240
  <tr>
279
241
  <td>
280
242
  <pre class="lines">
281
243
 
282
244
 
245
+ 62
246
+ 63
247
+ 64
248
+ 65
249
+ 66
250
+ 67
251
+ 68
252
+ 69
253
+ 70
254
+ 71
255
+ 72
256
+ 73
257
+ 74
258
+ 75
259
+ 76
260
+ 77
261
+ 78
262
+ 79
263
+ 80
264
+ 81
265
+ 82
266
+ 83
267
+ 84
268
+ 85
269
+ 86
270
+ 87
271
+ 88
272
+ 89
273
+ 90
274
+ 91
283
275
  92
284
276
  93
285
277
  94
@@ -366,114 +358,126 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
366
358
  175
367
359
  176
368
360
  177
369
- 178
370
- 179
371
- 180
372
- 181
373
- 182
374
- 183
375
- 184
376
- 185
377
- 186
378
- 187</pre>
361
+ 178</pre>
379
362
  </td>
380
363
  <td>
381
- <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 92</span>
364
+ <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 62</span>
382
365
 
383
366
  <span class='kw'>def</span> <span class='id install'>install</span> <span class='op'>*</span><span class='id extensions'>extensions</span>
384
- <span class='kw'>if</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id empty?'>empty?</span>
385
- <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You didn't list any extensions to install</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:red</span>
386
- <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Try: ray help install</span><span class='tstring_end'>&quot;</span></span>
387
- <span class='id exit'>exit</span> <span class='int'>1</span>
388
- <span class='kw'>end</span>
389
-
390
367
  <span class='kw'>case</span>
391
- <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>gem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='comment'># --gem
392
- </span> <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>gem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>gem</span><span class='tstring_end'>&quot;</span></span> <span class='comment'># no uri was passed to --gem
393
- </span> <span class='id extensions'>extensions</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>
394
- <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># first we search the cache
395
- </span> <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id empty?'>empty?</span> <span class='comment'># when there are no cache hits
396
- </span> <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># then search rubygems
397
- </span> <span class='kw'>else</span> <span class='comment'># when there are cache hits
398
- </span> <span class='id results'>results</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
399
- <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id name'>name</span><span class='comma'>,</span> <span class='id info'>info</span><span class='op'>|</span> <span class='comment'># filter out non-gem extensions
400
- </span> <span class='id info'>info</span><span class='lbracket'>[</span><span class='symbol'>:uri</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>rubygems</span><span class='regexp_end'>/</span></span>
401
- <span class='kw'>end</span><span class='period'>.</span><span class='id map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id extension'>extension</span><span class='op'>|</span>
402
- <span class='id results'>results</span><span class='lbracket'>[</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id first'>first</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id last'>last</span> <span class='comment'># rebuild the results hash
403
- </span> <span class='kw'>end</span>
404
- <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span> <span class='op'>=</span> <span class='id results'>results</span> <span class='comment'># reset the results hash
405
- </span> <span class='kw'>end</span>
406
- <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># when there is just one match
407
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Gem</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span> <span class='comment'># that's our extension
408
- </span> <span class='kw'>else</span> <span class='comment'># when there is more than one match
409
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Gem</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span> <span class='comment'># make the user pick
410
- </span> <span class='kw'>end</span>
411
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id install'>install</span> <span class='comment'># install the extension
412
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
368
+ <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
369
+ <span class='kw'>if</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>&gt;</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span>
370
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You can only list one extension at a time</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:red</span>
371
+ <span class='id exit'>exit</span> <span class='int'>1</span>
372
+ <span class='kw'>end</span>
373
+ <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span>
374
+ <span class='id extensions'>extensions</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>
375
+ <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id to_extension_name'>to_extension_name</span>
376
+ <span class='id search'>search</span><span class='period'>.</span><span class='id cache'>cache</span>
377
+ <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
378
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span>
379
+ <span class='kw'>else</span>
380
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span>
381
+ <span class='kw'>end</span>
382
+ <span class='id zip'>zip</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>Zip</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:uri</span><span class='rbracket'>]</span>
383
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Downloading...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
384
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id download'>download</span>
385
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Extracting...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
386
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id extract'>extract</span>
387
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
388
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id install'>install</span>
389
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
413
390
  <span class='kw'>end</span>
414
- <span class='kw'>else</span> <span class='comment'># a uri was passed to --gem
415
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Gem</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='comment'># instantiate with minimal info
416
- </span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id first'>first</span><span class='comma'>,</span> <span class='comment'># nothing works without a name
417
- </span> <span class='symbol'>:uri</span> <span class='op'>=&gt;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>gem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='comment'># uri should be a git repo
418
- </span> <span class='rbrace'>}</span><span class='rparen'>)</span>
419
- <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Adding to Gemfile...</span><span class='tstring_end'>&quot;</span></span>
420
- <span class='id name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>radiant-</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>-extension</span><span class='tstring_end'>&quot;</span></span>
421
- <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'>GEMFILE</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>a</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id gemfile'>gemfile</span><span class='op'>|</span>
422
- <span class='id gemfile'>gemfile</span><span class='period'>.</span><span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>gem \&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;, :git =&gt; \&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id uri'>uri</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='comment'># add it to the gemfile
423
- </span> <span class='kw'>end</span>
424
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id bundle'>bundle</span> <span class='comment'># we don't use install here
425
- </span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id copy_tasks'>copy_tasks</span> <span class='comment'># because add_gem only works
426
- </span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id run_tasks'>run_tasks</span> <span class='comment'># with released gem extensions
427
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
391
+ <span class='kw'>else</span>
392
+ <span class='id name'>name</span> <span class='op'>=</span> <span class='id extensions'>extensions</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>
393
+ <span class='id zip'>zip</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>Zip</span><span class='period'>.</span><span class='id new'>new</span> <span class='id name'>name</span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
394
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Downloading...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
395
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id download'>download</span>
396
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Extracting...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
397
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id extract'>extract</span>
398
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
399
+ <span class='id zip'>zip</span><span class='period'>.</span><span class='id install'>install</span>
400
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
428
401
  <span class='kw'>end</span>
429
402
  <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
403
+ <span class='kw'>if</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>&gt;</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span>
404
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You can only list one extension at a time</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:red</span>
405
+ <span class='id exit'>exit</span> <span class='int'>1</span>
406
+ <span class='kw'>end</span>
430
407
  <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span>
431
408
  <span class='id extensions'>extensions</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>
432
- <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># first we search the cache
433
- </span> <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id empty?'>empty?</span> <span class='comment'># when there are no cache hits
434
- </span> <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># then search github
435
- </span> <span class='kw'>end</span>
436
- <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># when there is just one match
437
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span> <span class='comment'># that's our extension
438
- </span> <span class='kw'>else</span> <span class='comment'># when there is more than one match
439
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span> <span class='comment'># make the user pick
440
- </span> <span class='kw'>end</span>
441
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id install'>install</span> <span class='comment'># install the extension
442
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
409
+ <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id to_extension_name'>to_extension_name</span>
410
+ <span class='id search'>search</span><span class='period'>.</span><span class='id cache'>cache</span>
411
+ <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
412
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span>
413
+ <span class='kw'>else</span>
414
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span>
415
+ <span class='kw'>end</span>
416
+ <span class='id git'>git</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:repository</span><span class='rbracket'>]</span>
417
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Cloning...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
418
+ <span class='id git'>git</span><span class='period'>.</span><span class='id clone'>clone</span>
419
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
420
+ <span class='id git'>git</span><span class='period'>.</span><span class='id install'>install</span>
421
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
443
422
  <span class='kw'>end</span>
444
423
  <span class='kw'>else</span>
445
- <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='comment'># instantiate with minimal info
446
- </span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id first'>first</span><span class='comma'>,</span> <span class='comment'># nothing works without a name
447
- </span> <span class='symbol'>:uri</span> <span class='op'>=&gt;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='comment'># uri should be a git repo
448
- </span> <span class='rbrace'>}</span><span class='rparen'>)</span>
449
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id install'>install</span> <span class='comment'># install the extension
450
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
424
+ <span class='id name'>name</span> <span class='op'>=</span> <span class='id extensions'>extensions</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>
425
+ <span class='id git'>git</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span> <span class='id name'>name</span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>git</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
426
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Cloning...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
427
+ <span class='id git'>git</span><span class='period'>.</span><span class='id clone'>clone</span>
428
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
429
+ <span class='id git'>git</span><span class='period'>.</span><span class='id install'>install</span>
430
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
451
431
  <span class='kw'>end</span>
452
- <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
453
- <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span>
432
+ <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
433
+ <span class='kw'>if</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>&gt;</span> <span class='int'>1</span> <span class='op'>&amp;&amp;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygem</span><span class='tstring_end'>&quot;</span></span>
434
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You can only list one extension at a time</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:red</span>
435
+ <span class='id exit'>exit</span> <span class='int'>1</span>
436
+ <span class='kw'>end</span>
437
+ <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygem</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygem</span><span class='tstring_end'>&quot;</span></span>
454
438
  <span class='id extensions'>extensions</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>
455
- <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># first we search the cache
456
- </span> <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id empty?'>empty?</span> <span class='comment'># when there are no cache hits
457
- </span> <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span> <span class='comment'># then search github
458
- </span> <span class='kw'>end</span>
459
- <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># when there is just one match
460
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Zip</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span> <span class='comment'># that's our extension
461
- </span> <span class='kw'>else</span> <span class='comment'># when there is more than one match
462
- </span> <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Zip</span><span class='period'>.</span><span class='id new'>new</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span> <span class='comment'># make the user pick
463
- </span> <span class='kw'>end</span>
464
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id install'>install</span> <span class='comment'># install the extension
465
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
439
+ <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id to_extension_name'>to_extension_name</span>
440
+ <span class='id search'>search</span><span class='period'>.</span><span class='id cache'>cache</span>
441
+ <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
442
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span>
443
+ <span class='kw'>else</span>
444
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span>
445
+ <span class='kw'>end</span>
446
+ <span class='id rubygem'>rubygem</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>RubyGem</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:repository</span><span class='rbracket'>]</span>
447
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Bundling...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
448
+ <span class='id rubygem'>rubygem</span><span class='period'>.</span><span class='id bundle'>bundle</span>
449
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
450
+ <span class='id rubygem'>rubygem</span><span class='period'>.</span><span class='id install'>install</span>
451
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
466
452
  <span class='kw'>end</span>
467
453
  <span class='kw'>else</span>
468
- <span class='id extension'>extension</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Zip</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='comment'># instantiate with minimal info
469
- </span> <span class='symbol'>:name</span> <span class='op'>=&gt;</span> <span class='id extensions'>extensions</span><span class='period'>.</span><span class='id first'>first</span><span class='comma'>,</span> <span class='comment'># nothing works without a name
470
- </span> <span class='symbol'>:uri</span> <span class='op'>=&gt;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>zip</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='comment'># uri should be a zip archive
471
- </span> <span class='rbrace'>}</span><span class='rparen'>)</span>
472
- <span class='id extension'>extension</span><span class='period'>.</span><span class='id install'>install</span> <span class='comment'># install the extension
473
- </span> <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete!</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
474
- <span class='kw'>end</span>
454
+ <span class='comment'># not sure what to do here
455
+ </span> <span class='kw'>end</span>
475
456
  <span class='kw'>else</span>
476
- <span class='id p'>p</span> <span class='id options'>options</span>
457
+ <span class='id extensions'>extensions</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>
458
+ <span class='id search'>search</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='period'>.</span><span class='id to_extension_name'>to_extension_name</span>
459
+ <span class='id search'>search</span><span class='period'>.</span><span class='id cache'>cache</span>
460
+ <span class='kw'>if</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
461
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id last'>last</span>
462
+ <span class='kw'>else</span>
463
+ <span class='id extension'>extension</span> <span class='op'>=</span> <span class='id search'>search</span><span class='period'>.</span><span class='id multiple_choice'>multiple_choice</span>
464
+ <span class='kw'>end</span>
465
+ <span class='kw'>if</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:version</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>latest</span><span class='tstring_end'>&quot;</span></span>
466
+ <span class='id git'>git</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>Git</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:repository</span><span class='rbracket'>]</span>
467
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Cloning...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
468
+ <span class='id git'>git</span><span class='period'>.</span><span class='id clone'>clone</span>
469
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
470
+ <span class='id git'>git</span><span class='period'>.</span><span class='id install'>install</span>
471
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
472
+ <span class='kw'>else</span>
473
+ <span class='id rubygem'>rubygem</span> <span class='op'>=</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Extension</span><span class='op'>::</span><span class='const'>RubyGem</span><span class='period'>.</span><span class='id new'>new</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:repository</span><span class='rbracket'>]</span>
474
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Bundling...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
475
+ <span class='id rubygem'>rubygem</span><span class='period'>.</span><span class='id bundle'>bundle</span>
476
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Running tasks...</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:yellow</span>
477
+ <span class='id rubygem'>rubygem</span><span class='period'>.</span><span class='id install'>install</span>
478
+ <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id extension'>extension</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> =&gt; Installation complete.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:green</span>
479
+ <span class='kw'>end</span>
480
+ <span class='kw'>end</span>
477
481
  <span class='kw'>end</span>
478
482
  <span class='kw'>end</span></pre>
479
483
  </td>
@@ -484,55 +488,67 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
484
488
  <div class="method_details ">
485
489
  <p class="signature " id="search-instance_method">
486
490
 
487
- - (<tt>Object</tt>) <strong>search</strong>(query)
491
+ - (<tt>Object</tt>) <strong>search</strong>(query = nil)
488
492
 
489
493
 
490
494
 
491
- </p><table class="source_code">
495
+ </p><div class="docstring">
496
+ <div class="discussion">
497
+ <p>Search for extensions</p>
498
+
499
+
500
+ </div>
501
+ </div>
502
+ <div class="tags">
503
+
504
+ <div class="examples">
505
+ <h3>Examples:</h3>
506
+
507
+ <h4><div class='inline'>
508
+ </div></h4>
509
+ <pre class="example code"><span class='id ray'>ray</span> <span class='id search'>search</span> <span class='id blog'>blog</span>
510
+ <span class='id ray'>ray</span> <span class='id search'>search</span> <span class='id blog'>blog</span> <span class='op'>-</span><span class='op'>-</span><span class='id live'>live</span>
511
+ <span class='id ray'>ray</span> <span class='id search'>search</span> <span class='id blog'>blog</span> <span class='op'>-</span><span class='op'>-</span><span class='id github'>github</span>
512
+ <span class='id ray'>ray</span> <span class='id search'>search</span> <span class='id blog'>blog</span> <span class='op'>-</span><span class='op'>-</span><span class='id rubygems'>rubygems</span></pre>
513
+
514
+ </div>
515
+
516
+
517
+ </div><table class="source_code">
492
518
  <tr>
493
519
  <td>
494
520
  <pre class="lines">
495
521
 
496
522
 
497
- 56
498
- 57
499
- 58
500
- 59
501
- 60
502
- 61
503
- 62
504
- 63
505
- 64
506
- 65
507
- 66
508
- 67
509
- 68
510
- 69
511
- 70
512
- 71
513
- 72
514
- 73
515
- 74</pre>
523
+ 34
524
+ 35
525
+ 36
526
+ 37
527
+ 38
528
+ 39
529
+ 40
530
+ 41
531
+ 42
532
+ 43
533
+ 44
534
+ 45
535
+ 46
536
+ 47</pre>
516
537
  </td>
517
538
  <td>
518
- <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 56</span>
539
+ <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 34</span>
519
540
 
520
- <span class='kw'>def</span> <span class='id search'>search</span> <span class='id query'>query</span>
541
+ <span class='kw'>def</span> <span class='id search'>search</span> <span class='id query'>query</span> <span class='op'>=</span> <span class='kw'>nil</span>
521
542
  <span class='id search'>search</span> <span class='op'>=</span> <span class='kw'>case</span>
522
- <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>github</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
523
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
524
543
  <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygems</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
525
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
544
+ <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
545
+ <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>github</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
546
+ <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
526
547
  <span class='kw'>when</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>live</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span>
527
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id merge'>merge</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id query'>query</span><span class='rparen'>)</span>
528
- <span class='kw'>else</span>
529
- <span class='kw'>if</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id results'>results</span><span class='period'>.</span><span class='id empty?'>empty?</span>
530
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>GitHub</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id query'>query</span><span class='rparen'>)</span><span class='period'>.</span><span class='id merge'>merge</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>RubyGems</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id query'>query</span><span class='rparen'>)</span>
531
- <span class='kw'>else</span>
532
- <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Cache</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
533
- <span class='kw'>end</span>
548
+ <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span><span class='comma'>,</span> <span class='symbol'>:live</span>
549
+ <span class='kw'>when</span> <span class='id options'>options</span><span class='period'>.</span><span class='id empty?'>empty?</span>
550
+ <span class='const'>Ray</span><span class='op'>::</span><span class='const'>Search</span><span class='period'>.</span><span class='id new'>new</span> <span class='id query'>query</span>
534
551
  <span class='kw'>end</span>
535
-
536
552
  <span class='id search'>search</span><span class='period'>.</span><span class='id cache'>cache</span>
537
553
  <span class='id say'>say</span> <span class='id search'>search</span><span class='period'>.</span><span class='id output'>output</span>
538
554
  <span class='kw'>end</span></pre>
@@ -554,17 +570,15 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
554
570
  <pre class="lines">
555
571
 
556
572
 
557
- 29
558
- 30
559
- 31
560
- 32</pre>
573
+ 17
574
+ 18
575
+ 19</pre>
561
576
  </td>
562
577
  <td>
563
- <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 29</span>
578
+ <pre class="code"><span class="info file"># File 'lib/ray/cli.rb', line 17</span>
564
579
 
565
580
  <span class='kw'>def</span> <span class='id version'>version</span>
566
- <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Friendly extension management for Radiant CMS</span><span class='tstring_end'>&quot;</span></span>
567
- <span class='id say'>say</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Version: </span><span class='embexpr_beg'>#{</span><span class='const'>Ray</span><span class='op'>::</span><span class='const'>VERSION</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
581
+ <span class='id say'>say</span> <span class='const'>Ray</span><span class='op'>::</span><span class='const'>VERSION</span>
568
582
  <span class='kw'>end</span></pre>
569
583
  </td>
570
584
  </tr>
@@ -576,7 +590,7 @@ refer to the <a href="http://goo.gl/5UtP8">User Manual</a> instead.</p>
576
590
  </div>
577
591
 
578
592
  <div id="footer">
579
- Generated on Sun Nov 20 20:26:43 2011 by
593
+ Generated on Tue Nov 15 19:16:22 2011 by
580
594
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
581
595
  0.7.3 (ruby-1.9.3).
582
596
  </div>