vermillion-client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +320 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +26 -0
- data/README.md +55 -0
- data/Rakefile +10 -0
- data/bin/setup +7 -0
- data/bin/vermillion +16 -0
- data/doc/ChangeBranchTest.html +240 -0
- data/doc/ConfigurationTest.html +277 -0
- data/doc/CreateTest.html +240 -0
- data/doc/Gemfile.html +145 -0
- data/doc/Gemfile_lock.html +173 -0
- data/doc/README_md.html +216 -0
- data/doc/Rakefile.html +151 -0
- data/doc/UpdateTest.html +280 -0
- data/doc/Vermillion.html +272 -0
- data/doc/Vermillion/Cfg.html +362 -0
- data/doc/Vermillion/Controller.html +185 -0
- data/doc/Vermillion/Controller/Base.html +503 -0
- data/doc/Vermillion/Controller/Change.html +301 -0
- data/doc/Vermillion/Controller/Create.html +301 -0
- data/doc/Vermillion/Controller/Firstrun.html +256 -0
- data/doc/Vermillion/Controller/Status.html +308 -0
- data/doc/Vermillion/Controller/Update.html +326 -0
- data/doc/Vermillion/Helper.html +252 -0
- data/doc/Vermillion/Helper/ApiCommunication.html +307 -0
- data/doc/Vermillion/Helper/Endpoint.html +506 -0
- data/doc/Vermillion/Helper/Formatting.html +250 -0
- data/doc/Vermillion/Helper/Network.html +304 -0
- data/doc/Vermillion/Helper/Results.html +341 -0
- data/doc/Vermillion/Helper/Time.html +295 -0
- data/doc/Vermillion/Request.html +332 -0
- data/doc/Vermillion/Router.html +351 -0
- data/doc/Vermillion/Test.html +183 -0
- data/doc/Vermillion/Test/Base.html +260 -0
- data/doc/Vermillion/Utils.html +247 -0
- data/doc/bin/setup.html +147 -0
- data/doc/created.rid +33 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +138 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +595 -0
- data/doc/table_of_contents.html +255 -0
- data/doc/vermillion-client_gemspec.html +166 -0
- data/lib/client.rb +35 -0
- data/lib/client/config.rb +58 -0
- data/lib/client/controller.rb +68 -0
- data/lib/client/controller/change.rb +26 -0
- data/lib/client/controller/create.rb +26 -0
- data/lib/client/controller/firstrun.rb +30 -0
- data/lib/client/controller/status.rb +43 -0
- data/lib/client/controller/update.rb +26 -0
- data/lib/client/helper.rb +21 -0
- data/lib/client/helper/apicommunication.rb +78 -0
- data/lib/client/helper/endpoint.rb +61 -0
- data/lib/client/helper/formatting.rb +23 -0
- data/lib/client/helper/network.rb +54 -0
- data/lib/client/helper/results.rb +28 -0
- data/lib/client/helper/time.rb +33 -0
- data/lib/client/request.rb +22 -0
- data/lib/client/router.rb +56 -0
- data/lib/client/utils.rb +18 -0
- data/lib/client/version.rb +4 -0
- data/lib/test.rb +13 -0
- data/lib/test/base.rb +17 -0
- data/test/test_change_branch.rb +14 -0
- data/test/test_configuration.rb +21 -0
- data/test/test_create.rb +14 -0
- data/test/test_update.rb +24 -0
- data/vermillion-client.gemspec +23 -0
- metadata +201 -0
@@ -0,0 +1,332 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Vermillion::Request - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
<div id="file-metadata">
|
49
|
+
<nav id="file-list-section" class="section">
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
51
|
+
<ul>
|
52
|
+
<li>lib/client/request.rb
|
53
|
+
</ul>
|
54
|
+
</nav>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
<nav id="parent-class-section" class="section">
|
62
|
+
<h3 class="section-header">Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">Object
|
65
|
+
|
66
|
+
</nav>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<nav id="method-list-section" class="section">
|
72
|
+
<h3 class="section-header">Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
<div id="project-metadata">
|
84
|
+
<nav id="fileindex-section" class="section project-section">
|
85
|
+
<h3 class="section-header">Pages</h3>
|
86
|
+
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
90
|
+
|
91
|
+
<li class="file"><a href="../Gemfile_lock.html">Gemfile.lock</a>
|
92
|
+
|
93
|
+
<li class="file"><a href="../README_md.html">README</a>
|
94
|
+
|
95
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a>
|
96
|
+
|
97
|
+
<li class="file"><a href="../bin/setup.html">setup</a>
|
98
|
+
|
99
|
+
<li class="file"><a href="../vermillion-client_gemspec.html">vermillion-client.gemspec</a>
|
100
|
+
|
101
|
+
</ul>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
<nav id="classindex-section" class="section project-section">
|
105
|
+
<h3 class="section-header">Class and Module Index</h3>
|
106
|
+
|
107
|
+
<ul class="link-list">
|
108
|
+
|
109
|
+
<li><a href="../ChangeBranchTest.html">ChangeBranchTest</a>
|
110
|
+
|
111
|
+
<li><a href="../ConfigurationTest.html">ConfigurationTest</a>
|
112
|
+
|
113
|
+
<li><a href="../CreateTest.html">CreateTest</a>
|
114
|
+
|
115
|
+
<li><a href="../UpdateTest.html">UpdateTest</a>
|
116
|
+
|
117
|
+
<li><a href="../Vermillion.html">Vermillion</a>
|
118
|
+
|
119
|
+
<li><a href="../Vermillion/Cfg.html">Vermillion::Cfg</a>
|
120
|
+
|
121
|
+
<li><a href="../Vermillion/Controller.html">Vermillion::Controller</a>
|
122
|
+
|
123
|
+
<li><a href="../Vermillion/Controller/Base.html">Vermillion::Controller::Base</a>
|
124
|
+
|
125
|
+
<li><a href="../Vermillion/Controller/Change.html">Vermillion::Controller::Change</a>
|
126
|
+
|
127
|
+
<li><a href="../Vermillion/Controller/Create.html">Vermillion::Controller::Create</a>
|
128
|
+
|
129
|
+
<li><a href="../Vermillion/Controller/Firstrun.html">Vermillion::Controller::Firstrun</a>
|
130
|
+
|
131
|
+
<li><a href="../Vermillion/Controller/Status.html">Vermillion::Controller::Status</a>
|
132
|
+
|
133
|
+
<li><a href="../Vermillion/Controller/Update.html">Vermillion::Controller::Update</a>
|
134
|
+
|
135
|
+
<li><a href="../Vermillion/Helper.html">Vermillion::Helper</a>
|
136
|
+
|
137
|
+
<li><a href="../Vermillion/Helper/ApiCommunication.html">Vermillion::Helper::ApiCommunication</a>
|
138
|
+
|
139
|
+
<li><a href="../Vermillion/Helper/Endpoint.html">Vermillion::Helper::Endpoint</a>
|
140
|
+
|
141
|
+
<li><a href="../Vermillion/Helper/Formatting.html">Vermillion::Helper::Formatting</a>
|
142
|
+
|
143
|
+
<li><a href="../Vermillion/Helper/Network.html">Vermillion::Helper::Network</a>
|
144
|
+
|
145
|
+
<li><a href="../Vermillion/Helper/Results.html">Vermillion::Helper::Results</a>
|
146
|
+
|
147
|
+
<li><a href="../Vermillion/Helper/Time.html">Vermillion::Helper::Time</a>
|
148
|
+
|
149
|
+
<li><a href="../Vermillion/Request.html">Vermillion::Request</a>
|
150
|
+
|
151
|
+
<li><a href="../Vermillion/Router.html">Vermillion::Router</a>
|
152
|
+
|
153
|
+
<li><a href="../Vermillion/Test.html">Vermillion::Test</a>
|
154
|
+
|
155
|
+
<li><a href="../Vermillion/Test/Base.html">Vermillion::Test::Base</a>
|
156
|
+
|
157
|
+
<li><a href="../Vermillion/Utils.html">Vermillion::Utils</a>
|
158
|
+
|
159
|
+
</ul>
|
160
|
+
</nav>
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</nav>
|
164
|
+
|
165
|
+
<div id="documentation">
|
166
|
+
<h1 class="class">class Vermillion::Request</h1>
|
167
|
+
|
168
|
+
<div id="description" class="description">
|
169
|
+
|
170
|
+
</div><!-- description -->
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<!-- Attributes -->
|
184
|
+
<section id="attribute-method-details" class="method-section section">
|
185
|
+
<h3 class="section-header">Attributes</h3>
|
186
|
+
|
187
|
+
|
188
|
+
<div id="attribute-i-command" class="method-detail">
|
189
|
+
<div class="method-heading attribute-method-heading">
|
190
|
+
<span class="method-name">command</span><span
|
191
|
+
class="attribute-access-type">[R]</span>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div id="attribute-i-controller" class="method-detail">
|
202
|
+
<div class="method-heading attribute-method-heading">
|
203
|
+
<span class="method-name">controller</span><span
|
204
|
+
class="attribute-access-type">[R]</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div id="attribute-i-custom" class="method-detail">
|
215
|
+
<div class="method-heading attribute-method-heading">
|
216
|
+
<span class="method-name">custom</span><span
|
217
|
+
class="attribute-access-type">[R]</span>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<div class="method-description">
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div id="attribute-i-flags" class="method-detail">
|
228
|
+
<div class="method-heading attribute-method-heading">
|
229
|
+
<span class="method-name">flags</span><span
|
230
|
+
class="attribute-access-type">[R]</span>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="attribute-i-param" class="method-detail">
|
241
|
+
<div class="method-heading attribute-method-heading">
|
242
|
+
<span class="method-name">param</span><span
|
243
|
+
class="attribute-access-type">[R]</span>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<div class="method-description">
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="attribute-i-raw_flags" class="method-detail">
|
254
|
+
<div class="method-heading attribute-method-heading">
|
255
|
+
<span class="method-name">raw_flags</span><span
|
256
|
+
class="attribute-access-type">[R]</span>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
<div class="method-description">
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
</section><!-- attribute-method-details -->
|
267
|
+
|
268
|
+
|
269
|
+
<!-- Methods -->
|
270
|
+
|
271
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
272
|
+
<h3 class="section-header">Public Class Methods</h3>
|
273
|
+
|
274
|
+
|
275
|
+
<div id="method-c-new" class="method-detail ">
|
276
|
+
|
277
|
+
<div class="method-heading">
|
278
|
+
<span class="method-name">new</span><span
|
279
|
+
class="method-args">()</span>
|
280
|
+
|
281
|
+
<span class="method-click-advice">click to toggle source</span>
|
282
|
+
|
283
|
+
</div>
|
284
|
+
|
285
|
+
|
286
|
+
<div class="method-description">
|
287
|
+
|
288
|
+
<p>Create the request object, parse ARGV for values</p>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<div class="method-source-code" id="new-source">
|
294
|
+
<pre><span class="ruby-comment"># File lib/client/request.rb, line 6</span>
|
295
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
|
296
|
+
<span class="ruby-ivar">@controller</span> = <span class="ruby-keyword">nil</span>
|
297
|
+
<span class="ruby-ivar">@flags</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">'-'</span>) }.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">"="</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:to_sym</span>) } <span class="ruby-operator">||</span> []
|
298
|
+
<span class="ruby-ivar">@raw_flags</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">'-'</span>) } <span class="ruby-operator">||</span> []
|
299
|
+
|
300
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">empty?</span>
|
301
|
+
<span class="ruby-ivar">@controller</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">'-'</span>)
|
302
|
+
<span class="ruby-ivar">@command</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">nil?</span>
|
303
|
+
|
304
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">2</span>
|
305
|
+
<span class="ruby-ivar">@custom</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span>].<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">p</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">'-'</span>) }.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:to_sym</span>) <span class="ruby-operator">||</span> []
|
306
|
+
<span class="ruby-ivar">@param</span> = <span class="ruby-constant">ARGV</span>[<span class="ruby-value">2</span>]
|
307
|
+
<span class="ruby-keyword">end</span>
|
308
|
+
<span class="ruby-keyword">end</span>
|
309
|
+
<span class="ruby-keyword">end</span></pre>
|
310
|
+
</div><!-- new-source -->
|
311
|
+
|
312
|
+
</div>
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
</div><!-- new-method -->
|
318
|
+
|
319
|
+
|
320
|
+
</section><!-- public-class-method-details -->
|
321
|
+
|
322
|
+
</section><!-- 5Buntitled-5D -->
|
323
|
+
|
324
|
+
</div><!-- documentation -->
|
325
|
+
|
326
|
+
|
327
|
+
<footer id="validator-badges">
|
328
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
329
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
330
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
331
|
+
</footer>
|
332
|
+
|
@@ -0,0 +1,351 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Vermillion::Router - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
<div id="file-metadata">
|
49
|
+
<nav id="file-list-section" class="section">
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
51
|
+
<ul>
|
52
|
+
<li>lib/client/router.rb
|
53
|
+
</ul>
|
54
|
+
</nav>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
<nav id="parent-class-section" class="section">
|
62
|
+
<h3 class="section-header">Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">Object
|
65
|
+
|
66
|
+
</nav>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<nav id="method-list-section" class="section">
|
72
|
+
<h3 class="section-header">Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list">
|
75
|
+
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-i-pre_exec">#pre_exec</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-route">#route</a>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</nav>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="project-metadata">
|
88
|
+
<nav id="fileindex-section" class="section project-section">
|
89
|
+
<h3 class="section-header">Pages</h3>
|
90
|
+
|
91
|
+
<ul>
|
92
|
+
|
93
|
+
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
94
|
+
|
95
|
+
<li class="file"><a href="../Gemfile_lock.html">Gemfile.lock</a>
|
96
|
+
|
97
|
+
<li class="file"><a href="../README_md.html">README</a>
|
98
|
+
|
99
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a>
|
100
|
+
|
101
|
+
<li class="file"><a href="../bin/setup.html">setup</a>
|
102
|
+
|
103
|
+
<li class="file"><a href="../vermillion-client_gemspec.html">vermillion-client.gemspec</a>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
</nav>
|
107
|
+
|
108
|
+
<nav id="classindex-section" class="section project-section">
|
109
|
+
<h3 class="section-header">Class and Module Index</h3>
|
110
|
+
|
111
|
+
<ul class="link-list">
|
112
|
+
|
113
|
+
<li><a href="../ChangeBranchTest.html">ChangeBranchTest</a>
|
114
|
+
|
115
|
+
<li><a href="../ConfigurationTest.html">ConfigurationTest</a>
|
116
|
+
|
117
|
+
<li><a href="../CreateTest.html">CreateTest</a>
|
118
|
+
|
119
|
+
<li><a href="../UpdateTest.html">UpdateTest</a>
|
120
|
+
|
121
|
+
<li><a href="../Vermillion.html">Vermillion</a>
|
122
|
+
|
123
|
+
<li><a href="../Vermillion/Cfg.html">Vermillion::Cfg</a>
|
124
|
+
|
125
|
+
<li><a href="../Vermillion/Controller.html">Vermillion::Controller</a>
|
126
|
+
|
127
|
+
<li><a href="../Vermillion/Controller/Base.html">Vermillion::Controller::Base</a>
|
128
|
+
|
129
|
+
<li><a href="../Vermillion/Controller/Change.html">Vermillion::Controller::Change</a>
|
130
|
+
|
131
|
+
<li><a href="../Vermillion/Controller/Create.html">Vermillion::Controller::Create</a>
|
132
|
+
|
133
|
+
<li><a href="../Vermillion/Controller/Firstrun.html">Vermillion::Controller::Firstrun</a>
|
134
|
+
|
135
|
+
<li><a href="../Vermillion/Controller/Status.html">Vermillion::Controller::Status</a>
|
136
|
+
|
137
|
+
<li><a href="../Vermillion/Controller/Update.html">Vermillion::Controller::Update</a>
|
138
|
+
|
139
|
+
<li><a href="../Vermillion/Helper.html">Vermillion::Helper</a>
|
140
|
+
|
141
|
+
<li><a href="../Vermillion/Helper/ApiCommunication.html">Vermillion::Helper::ApiCommunication</a>
|
142
|
+
|
143
|
+
<li><a href="../Vermillion/Helper/Endpoint.html">Vermillion::Helper::Endpoint</a>
|
144
|
+
|
145
|
+
<li><a href="../Vermillion/Helper/Formatting.html">Vermillion::Helper::Formatting</a>
|
146
|
+
|
147
|
+
<li><a href="../Vermillion/Helper/Network.html">Vermillion::Helper::Network</a>
|
148
|
+
|
149
|
+
<li><a href="../Vermillion/Helper/Results.html">Vermillion::Helper::Results</a>
|
150
|
+
|
151
|
+
<li><a href="../Vermillion/Helper/Time.html">Vermillion::Helper::Time</a>
|
152
|
+
|
153
|
+
<li><a href="../Vermillion/Request.html">Vermillion::Request</a>
|
154
|
+
|
155
|
+
<li><a href="../Vermillion/Router.html">Vermillion::Router</a>
|
156
|
+
|
157
|
+
<li><a href="../Vermillion/Test.html">Vermillion::Test</a>
|
158
|
+
|
159
|
+
<li><a href="../Vermillion/Test/Base.html">Vermillion::Test::Base</a>
|
160
|
+
|
161
|
+
<li><a href="../Vermillion/Utils.html">Vermillion::Utils</a>
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
</nav>
|
165
|
+
|
166
|
+
</div>
|
167
|
+
</nav>
|
168
|
+
|
169
|
+
<div id="documentation">
|
170
|
+
<h1 class="class">class Vermillion::Router</h1>
|
171
|
+
|
172
|
+
<div id="description" class="description">
|
173
|
+
|
174
|
+
</div><!-- description -->
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<!-- Methods -->
|
189
|
+
|
190
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
191
|
+
<h3 class="section-header">Public Class Methods</h3>
|
192
|
+
|
193
|
+
|
194
|
+
<div id="method-c-new" class="method-detail ">
|
195
|
+
|
196
|
+
<div class="method-heading">
|
197
|
+
<span class="method-name">new</span><span
|
198
|
+
class="method-args">(config_instance)</span>
|
199
|
+
|
200
|
+
<span class="method-click-advice">click to toggle source</span>
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
<div class="method-description">
|
206
|
+
|
207
|
+
<p>Create the router object Params:</p>
|
208
|
+
<dl class="rdoc-list note-list"><dt><code>config_instance</code>
|
209
|
+
<dd>
|
210
|
+
<p>An instance of <a href="Cfg.html">Vermillion::Cfg</a></p>
|
211
|
+
</dd></dl>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method-source-code" id="new-source">
|
217
|
+
<pre><span class="ruby-comment"># File lib/client/router.rb, line 6</span>
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">config_instance</span>)
|
219
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-identifier">config_instance</span>
|
220
|
+
<span class="ruby-keyword">end</span></pre>
|
221
|
+
</div><!-- new-source -->
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
</div><!-- new-method -->
|
229
|
+
|
230
|
+
|
231
|
+
</section><!-- public-class-method-details -->
|
232
|
+
|
233
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
234
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
235
|
+
|
236
|
+
|
237
|
+
<div id="method-i-pre_exec" class="method-detail ">
|
238
|
+
|
239
|
+
<div class="method-heading">
|
240
|
+
<span class="method-name">pre_exec</span><span
|
241
|
+
class="method-args">()</span>
|
242
|
+
|
243
|
+
<span class="method-click-advice">click to toggle source</span>
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
<div class="method-description">
|
249
|
+
|
250
|
+
<p>Prepare for routing</p>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
<div class="method-source-code" id="pre_exec-source">
|
256
|
+
<pre><span class="ruby-comment"># File lib/client/router.rb, line 11</span>
|
257
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pre_exec</span>
|
258
|
+
<span class="ruby-ivar">@request</span> = <span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>
|
259
|
+
|
260
|
+
<span class="ruby-keyword">begin</span>
|
261
|
+
<span class="ruby-comment"># include the controller</span>
|
262
|
+
<span class="ruby-identifier">require</span> <span class="ruby-node">"client/controller/#{@request.controller}"</span>
|
263
|
+
<span class="ruby-comment"># include helpers</span>
|
264
|
+
<span class="ruby-identifier">require</span> <span class="ruby-node">"client/helper/#{@request.controller}"</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-node">"client/helpers/#{@request.controller}"</span>
|
265
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">LoadError</span>
|
266
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"Controller not found: #{@request.controller}"</span>)
|
267
|
+
<span class="ruby-keyword">end</span>
|
268
|
+
<span class="ruby-keyword">end</span></pre>
|
269
|
+
</div><!-- pre_exec-source -->
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
</div><!-- pre_exec-method -->
|
277
|
+
|
278
|
+
|
279
|
+
<div id="method-i-route" class="method-detail ">
|
280
|
+
|
281
|
+
<div class="method-heading">
|
282
|
+
<span class="method-name">route</span><span
|
283
|
+
class="method-args">()</span>
|
284
|
+
|
285
|
+
<span class="method-click-advice">click to toggle source</span>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
<div class="method-description">
|
291
|
+
|
292
|
+
<p>Perform command routing</p>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<div class="method-source-code" id="route-source">
|
298
|
+
<pre><span class="ruby-comment"># File lib/client/router.rb, line 25</span>
|
299
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">route</span>
|
300
|
+
<span class="ruby-identifier">pre_exec</span>
|
301
|
+
|
302
|
+
<span class="ruby-comment"># Create object context and pass it the required command line arguments</span>
|
303
|
+
<span class="ruby-keyword">begin</span>
|
304
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">controller</span>.<span class="ruby-identifier">nil?</span>
|
305
|
+
<span class="ruby-identifier">controller</span> = <span class="ruby-constant">Vermillion</span><span class="ruby-operator">::</span><span class="ruby-constant">Controller</span>.<span class="ruby-identifier">const_get</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">controller</span>.<span class="ruby-identifier">capitalize</span>
|
306
|
+
|
307
|
+
<span class="ruby-comment"># create an instance of the requested controller</span>
|
308
|
+
<span class="ruby-identifier">context</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@config</span>, <span class="ruby-ivar">@request</span>)
|
309
|
+
|
310
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">context</span>.<span class="ruby-identifier">can_exec?</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">command</span>
|
311
|
+
<span class="ruby-comment"># Set things up</span>
|
312
|
+
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">pre_exec</span>
|
313
|
+
|
314
|
+
<span class="ruby-comment"># Run the requested action</span>
|
315
|
+
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">exec</span>
|
316
|
+
|
317
|
+
<span class="ruby-comment"># Run cleanup commands</span>
|
318
|
+
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">post_exec</span>
|
319
|
+
<span class="ruby-keyword">end</span>
|
320
|
+
<span class="ruby-keyword">end</span>
|
321
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">NoMethodError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
322
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>)
|
323
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">RuntimeError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
324
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>, <span class="ruby-identifier">show_time</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>)
|
325
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
326
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"#{e}\n#{e.backtrace.join("\n")}"</span>, <span class="ruby-identifier">show_time</span><span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>)
|
327
|
+
<span class="ruby-keyword">end</span>
|
328
|
+
<span class="ruby-keyword">end</span></pre>
|
329
|
+
</div><!-- route-source -->
|
330
|
+
|
331
|
+
</div>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
</div><!-- route-method -->
|
337
|
+
|
338
|
+
|
339
|
+
</section><!-- public-instance-method-details -->
|
340
|
+
|
341
|
+
</section><!-- 5Buntitled-5D -->
|
342
|
+
|
343
|
+
</div><!-- documentation -->
|
344
|
+
|
345
|
+
|
346
|
+
<footer id="validator-badges">
|
347
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
348
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
349
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
350
|
+
</footer>
|
351
|
+
|