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,307 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module Vermillion::Helper::ApiCommunication - 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="module">
|
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/helper/apicommunication.rb
|
53
|
+
</ul>
|
54
|
+
</nav>
|
55
|
+
|
56
|
+
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<nav id="method-list-section" class="section">
|
66
|
+
<h3 class="section-header">Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
<li ><a href="#method-i-send_to_all">#send_to_all</a>
|
71
|
+
|
72
|
+
<li ><a href="#method-i-send_to_one">#send_to_one</a>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="project-metadata">
|
80
|
+
<nav id="fileindex-section" class="section project-section">
|
81
|
+
<h3 class="section-header">Pages</h3>
|
82
|
+
|
83
|
+
<ul>
|
84
|
+
|
85
|
+
<li class="file"><a href="../../Gemfile.html">Gemfile</a>
|
86
|
+
|
87
|
+
<li class="file"><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
88
|
+
|
89
|
+
<li class="file"><a href="../../README_md.html">README</a>
|
90
|
+
|
91
|
+
<li class="file"><a href="../../Rakefile.html">Rakefile</a>
|
92
|
+
|
93
|
+
<li class="file"><a href="../../bin/setup.html">setup</a>
|
94
|
+
|
95
|
+
<li class="file"><a href="../../vermillion-client_gemspec.html">vermillion-client.gemspec</a>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
</nav>
|
99
|
+
|
100
|
+
<nav id="classindex-section" class="section project-section">
|
101
|
+
<h3 class="section-header">Class and Module Index</h3>
|
102
|
+
|
103
|
+
<ul class="link-list">
|
104
|
+
|
105
|
+
<li><a href="../../ChangeBranchTest.html">ChangeBranchTest</a>
|
106
|
+
|
107
|
+
<li><a href="../../ConfigurationTest.html">ConfigurationTest</a>
|
108
|
+
|
109
|
+
<li><a href="../../CreateTest.html">CreateTest</a>
|
110
|
+
|
111
|
+
<li><a href="../../UpdateTest.html">UpdateTest</a>
|
112
|
+
|
113
|
+
<li><a href="../../Vermillion.html">Vermillion</a>
|
114
|
+
|
115
|
+
<li><a href="../../Vermillion/Cfg.html">Vermillion::Cfg</a>
|
116
|
+
|
117
|
+
<li><a href="../../Vermillion/Controller.html">Vermillion::Controller</a>
|
118
|
+
|
119
|
+
<li><a href="../../Vermillion/Controller/Base.html">Vermillion::Controller::Base</a>
|
120
|
+
|
121
|
+
<li><a href="../../Vermillion/Controller/Change.html">Vermillion::Controller::Change</a>
|
122
|
+
|
123
|
+
<li><a href="../../Vermillion/Controller/Create.html">Vermillion::Controller::Create</a>
|
124
|
+
|
125
|
+
<li><a href="../../Vermillion/Controller/Firstrun.html">Vermillion::Controller::Firstrun</a>
|
126
|
+
|
127
|
+
<li><a href="../../Vermillion/Controller/Status.html">Vermillion::Controller::Status</a>
|
128
|
+
|
129
|
+
<li><a href="../../Vermillion/Controller/Update.html">Vermillion::Controller::Update</a>
|
130
|
+
|
131
|
+
<li><a href="../../Vermillion/Helper.html">Vermillion::Helper</a>
|
132
|
+
|
133
|
+
<li><a href="../../Vermillion/Helper/ApiCommunication.html">Vermillion::Helper::ApiCommunication</a>
|
134
|
+
|
135
|
+
<li><a href="../../Vermillion/Helper/Endpoint.html">Vermillion::Helper::Endpoint</a>
|
136
|
+
|
137
|
+
<li><a href="../../Vermillion/Helper/Formatting.html">Vermillion::Helper::Formatting</a>
|
138
|
+
|
139
|
+
<li><a href="../../Vermillion/Helper/Network.html">Vermillion::Helper::Network</a>
|
140
|
+
|
141
|
+
<li><a href="../../Vermillion/Helper/Results.html">Vermillion::Helper::Results</a>
|
142
|
+
|
143
|
+
<li><a href="../../Vermillion/Helper/Time.html">Vermillion::Helper::Time</a>
|
144
|
+
|
145
|
+
<li><a href="../../Vermillion/Request.html">Vermillion::Request</a>
|
146
|
+
|
147
|
+
<li><a href="../../Vermillion/Router.html">Vermillion::Router</a>
|
148
|
+
|
149
|
+
<li><a href="../../Vermillion/Test.html">Vermillion::Test</a>
|
150
|
+
|
151
|
+
<li><a href="../../Vermillion/Test/Base.html">Vermillion::Test::Base</a>
|
152
|
+
|
153
|
+
<li><a href="../../Vermillion/Utils.html">Vermillion::Utils</a>
|
154
|
+
|
155
|
+
</ul>
|
156
|
+
</nav>
|
157
|
+
|
158
|
+
</div>
|
159
|
+
</nav>
|
160
|
+
|
161
|
+
<div id="documentation">
|
162
|
+
<h1 class="module">module Vermillion::Helper::ApiCommunication</h1>
|
163
|
+
|
164
|
+
<div id="description" class="description">
|
165
|
+
|
166
|
+
</div><!-- description -->
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<!-- Methods -->
|
181
|
+
|
182
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
183
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
184
|
+
|
185
|
+
|
186
|
+
<div id="method-i-send_to_all" class="method-detail ">
|
187
|
+
|
188
|
+
<div class="method-heading">
|
189
|
+
<span class="method-name">send_to_all</span><span
|
190
|
+
class="method-args">(endpoint, args = {})</span>
|
191
|
+
|
192
|
+
<span class="method-click-advice">click to toggle source</span>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
|
199
|
+
<p>Send HTTP requests to all servers in the local manifest Params:</p>
|
200
|
+
<dl class="rdoc-list note-list"><dt><code>endpoint</code>
|
201
|
+
<dd>
|
202
|
+
<p>The REST endpoint you'd like to send a request to</p>
|
203
|
+
</dd><dt><code>args</code>
|
204
|
+
<dd>
|
205
|
+
<p>Any specific configuration data to send along with the request</p>
|
206
|
+
</dd></dl>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<div class="method-source-code" id="send_to_all-source">
|
212
|
+
<pre><span class="ruby-comment"># File lib/client/helper/apicommunication.rb, line 41</span>
|
213
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">send_to_all</span>(<span class="ruby-identifier">endpoint</span>, <span class="ruby-identifier">args</span> = {})
|
214
|
+
<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">:servers</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
215
|
+
<span class="ruby-identifier">send_to_one</span>(<span class="ruby-identifier">server</span>[<span class="ruby-value">:name</span>], <span class="ruby-identifier">endpoint</span>, <span class="ruby-identifier">args</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">server</span>[<span class="ruby-value">:name</span>]
|
216
|
+
<span class="ruby-keyword">end</span>
|
217
|
+
<span class="ruby-keyword">end</span></pre>
|
218
|
+
</div><!-- send_to_all-source -->
|
219
|
+
|
220
|
+
</div>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</div><!-- send_to_all-method -->
|
226
|
+
|
227
|
+
|
228
|
+
<div id="method-i-send_to_one" class="method-detail ">
|
229
|
+
|
230
|
+
<div class="method-heading">
|
231
|
+
<span class="method-name">send_to_one</span><span
|
232
|
+
class="method-args">(input, endpoint, args = {})</span>
|
233
|
+
|
234
|
+
<span class="method-click-advice">click to toggle source</span>
|
235
|
+
|
236
|
+
</div>
|
237
|
+
|
238
|
+
|
239
|
+
<div class="method-description">
|
240
|
+
|
241
|
+
<p>Send an HTTP request to one server Params:</p>
|
242
|
+
<dl class="rdoc-list note-list"><dt><code>input</code>
|
243
|
+
<dd>
|
244
|
+
<p>The server you want to connect to</p>
|
245
|
+
</dd><dt><code>endpoint</code>
|
246
|
+
<dd>
|
247
|
+
<p>The REST endpoint you'd like to send a request to</p>
|
248
|
+
</dd><dt><code>args</code>
|
249
|
+
<dd>
|
250
|
+
<p>Any specific configuration data to send along with the request</p>
|
251
|
+
</dd></dl>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
<div class="method-source-code" id="send_to_one-source">
|
257
|
+
<pre><span class="ruby-comment"># File lib/client/helper/apicommunication.rb, line 9</span>
|
258
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">send_to_one</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">endpoint</span>, <span class="ruby-identifier">args</span> = {})
|
259
|
+
<span class="ruby-identifier">server</span>, <span class="ruby-identifier">endpoint</span> = <span class="ruby-identifier">setup</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">endpoint</span>, <span class="ruby-identifier">args</span>)
|
260
|
+
|
261
|
+
<span class="ruby-keyword">begin</span>
|
262
|
+
<span class="ruby-identifier">resp</span> = <span class="ruby-ivar">@network</span>.<span class="ruby-identifier">post</span>(<span class="ruby-identifier">endpoint</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">server</span>[<span class="ruby-value">:key</span>])
|
263
|
+
|
264
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">spit</span>(<span class="ruby-identifier">endpoint</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">DEBUG</span>
|
265
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">spit</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">body</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">DEBUG</span>
|
266
|
+
|
267
|
+
<span class="ruby-comment"># generic failure for invalid response type</span>
|
268
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-string">"Content-Type"</span>] <span class="ruby-operator">!=</span> <span class="ruby-string">"application/json"</span>
|
269
|
+
|
270
|
+
<span class="ruby-comment"># handle JSON response</span>
|
271
|
+
<span class="ruby-identifier">response_data</span> = <span class="ruby-ivar">@format</span>.<span class="ruby-identifier">symbolize</span>(<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">body</span>))
|
272
|
+
|
273
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">response_data</span>[<span class="ruby-value">:_code</span>] <span class="ruby-operator">==</span> <span class="ruby-value">200</span>
|
274
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">success</span>(<span class="ruby-node">"#{server[:name]} (#{server[:address]}) update succeeded"</span>)
|
275
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-identifier">response_data</span>[<span class="ruby-value">:message</span>].<span class="ruby-identifier">nil?</span>
|
276
|
+
<span class="ruby-comment"># work around a messaging issue with vermillion-server</span>
|
277
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">warning</span>(<span class="ruby-node">"Error: #{response_data[:message]}"</span>)
|
278
|
+
<span class="ruby-keyword">else</span>
|
279
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">warning</span>(<span class="ruby-node">"#{response_data[:_title]}: #{response_data[:_message]}"</span>)
|
280
|
+
<span class="ruby-keyword">end</span>
|
281
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>
|
282
|
+
<span class="ruby-constant">Notify</span>.<span class="ruby-identifier">warning</span>(<span class="ruby-node">"Request failed for #{server[:name]} (#{server[:address]})"</span>)
|
283
|
+
<span class="ruby-keyword">end</span>
|
284
|
+
<span class="ruby-keyword">end</span></pre>
|
285
|
+
</div><!-- send_to_one-source -->
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</div><!-- send_to_one-method -->
|
293
|
+
|
294
|
+
|
295
|
+
</section><!-- public-instance-method-details -->
|
296
|
+
|
297
|
+
</section><!-- 5Buntitled-5D -->
|
298
|
+
|
299
|
+
</div><!-- documentation -->
|
300
|
+
|
301
|
+
|
302
|
+
<footer id="validator-badges">
|
303
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
304
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
305
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
306
|
+
</footer>
|
307
|
+
|
@@ -0,0 +1,506 @@
|
|
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::Helper::Endpoint - 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/helper/endpoint.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-add">#add</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-delete">#delete</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-exists-3F">#exists?</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-get">#get</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-protocol-3D">#protocol=</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="project-metadata">
|
96
|
+
<nav id="fileindex-section" class="section project-section">
|
97
|
+
<h3 class="section-header">Pages</h3>
|
98
|
+
|
99
|
+
<ul>
|
100
|
+
|
101
|
+
<li class="file"><a href="../../Gemfile.html">Gemfile</a>
|
102
|
+
|
103
|
+
<li class="file"><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
104
|
+
|
105
|
+
<li class="file"><a href="../../README_md.html">README</a>
|
106
|
+
|
107
|
+
<li class="file"><a href="../../Rakefile.html">Rakefile</a>
|
108
|
+
|
109
|
+
<li class="file"><a href="../../bin/setup.html">setup</a>
|
110
|
+
|
111
|
+
<li class="file"><a href="../../vermillion-client_gemspec.html">vermillion-client.gemspec</a>
|
112
|
+
|
113
|
+
</ul>
|
114
|
+
</nav>
|
115
|
+
|
116
|
+
<nav id="classindex-section" class="section project-section">
|
117
|
+
<h3 class="section-header">Class and Module Index</h3>
|
118
|
+
|
119
|
+
<ul class="link-list">
|
120
|
+
|
121
|
+
<li><a href="../../ChangeBranchTest.html">ChangeBranchTest</a>
|
122
|
+
|
123
|
+
<li><a href="../../ConfigurationTest.html">ConfigurationTest</a>
|
124
|
+
|
125
|
+
<li><a href="../../CreateTest.html">CreateTest</a>
|
126
|
+
|
127
|
+
<li><a href="../../UpdateTest.html">UpdateTest</a>
|
128
|
+
|
129
|
+
<li><a href="../../Vermillion.html">Vermillion</a>
|
130
|
+
|
131
|
+
<li><a href="../../Vermillion/Cfg.html">Vermillion::Cfg</a>
|
132
|
+
|
133
|
+
<li><a href="../../Vermillion/Controller.html">Vermillion::Controller</a>
|
134
|
+
|
135
|
+
<li><a href="../../Vermillion/Controller/Base.html">Vermillion::Controller::Base</a>
|
136
|
+
|
137
|
+
<li><a href="../../Vermillion/Controller/Change.html">Vermillion::Controller::Change</a>
|
138
|
+
|
139
|
+
<li><a href="../../Vermillion/Controller/Create.html">Vermillion::Controller::Create</a>
|
140
|
+
|
141
|
+
<li><a href="../../Vermillion/Controller/Firstrun.html">Vermillion::Controller::Firstrun</a>
|
142
|
+
|
143
|
+
<li><a href="../../Vermillion/Controller/Status.html">Vermillion::Controller::Status</a>
|
144
|
+
|
145
|
+
<li><a href="../../Vermillion/Controller/Update.html">Vermillion::Controller::Update</a>
|
146
|
+
|
147
|
+
<li><a href="../../Vermillion/Helper.html">Vermillion::Helper</a>
|
148
|
+
|
149
|
+
<li><a href="../../Vermillion/Helper/ApiCommunication.html">Vermillion::Helper::ApiCommunication</a>
|
150
|
+
|
151
|
+
<li><a href="../../Vermillion/Helper/Endpoint.html">Vermillion::Helper::Endpoint</a>
|
152
|
+
|
153
|
+
<li><a href="../../Vermillion/Helper/Formatting.html">Vermillion::Helper::Formatting</a>
|
154
|
+
|
155
|
+
<li><a href="../../Vermillion/Helper/Network.html">Vermillion::Helper::Network</a>
|
156
|
+
|
157
|
+
<li><a href="../../Vermillion/Helper/Results.html">Vermillion::Helper::Results</a>
|
158
|
+
|
159
|
+
<li><a href="../../Vermillion/Helper/Time.html">Vermillion::Helper::Time</a>
|
160
|
+
|
161
|
+
<li><a href="../../Vermillion/Request.html">Vermillion::Request</a>
|
162
|
+
|
163
|
+
<li><a href="../../Vermillion/Router.html">Vermillion::Router</a>
|
164
|
+
|
165
|
+
<li><a href="../../Vermillion/Test.html">Vermillion::Test</a>
|
166
|
+
|
167
|
+
<li><a href="../../Vermillion/Test/Base.html">Vermillion::Test::Base</a>
|
168
|
+
|
169
|
+
<li><a href="../../Vermillion/Utils.html">Vermillion::Utils</a>
|
170
|
+
|
171
|
+
</ul>
|
172
|
+
</nav>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
</nav>
|
176
|
+
|
177
|
+
<div id="documentation">
|
178
|
+
<h1 class="class">class Vermillion::Helper::Endpoint</h1>
|
179
|
+
|
180
|
+
<div id="description" class="description">
|
181
|
+
|
182
|
+
</div><!-- description -->
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<!-- Attributes -->
|
196
|
+
<section id="attribute-method-details" class="method-section section">
|
197
|
+
<h3 class="section-header">Attributes</h3>
|
198
|
+
|
199
|
+
|
200
|
+
<div id="attribute-i-server" class="method-detail">
|
201
|
+
<div class="method-heading attribute-method-heading">
|
202
|
+
<span class="method-name">server</span><span
|
203
|
+
class="attribute-access-type">[W]</span>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</section><!-- attribute-method-details -->
|
214
|
+
|
215
|
+
|
216
|
+
<!-- Methods -->
|
217
|
+
|
218
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
219
|
+
<h3 class="section-header">Public Class Methods</h3>
|
220
|
+
|
221
|
+
|
222
|
+
<div id="method-c-new" class="method-detail ">
|
223
|
+
|
224
|
+
<div class="method-heading">
|
225
|
+
<span class="method-name">new</span><span
|
226
|
+
class="method-args">(initial_path)</span>
|
227
|
+
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
|
235
|
+
<p>Creates the <a href="Endpoint.html">Endpoint</a> object with default values
|
236
|
+
for internal variables Params:</p>
|
237
|
+
<dl class="rdoc-list note-list"><dt><code>initial_path</code>
|
238
|
+
<dd>
|
239
|
+
<p>Starting point of the URL this class will build</p>
|
240
|
+
</dd></dl>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<div class="method-source-code" id="new-source">
|
246
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 9</span>
|
247
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">initial_path</span>)
|
248
|
+
<span class="ruby-ivar">@path</span> = { <span class="ruby-identifier">default</span><span class="ruby-operator">:</span> <span class="ruby-identifier">initial_path</span> }
|
249
|
+
<span class="ruby-ivar">@server</span> = <span class="ruby-keyword">nil</span>
|
250
|
+
<span class="ruby-ivar">@protocol</span> = <span class="ruby-string">"http://"</span>
|
251
|
+
<span class="ruby-keyword">end</span></pre>
|
252
|
+
</div><!-- new-source -->
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</div><!-- new-method -->
|
260
|
+
|
261
|
+
|
262
|
+
</section><!-- public-class-method-details -->
|
263
|
+
|
264
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
265
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
266
|
+
|
267
|
+
|
268
|
+
<div id="method-i-add" class="method-detail ">
|
269
|
+
|
270
|
+
<div class="method-heading">
|
271
|
+
<span class="method-name">add</span><span
|
272
|
+
class="method-args">(key, value)</span>
|
273
|
+
|
274
|
+
<span class="method-click-advice">click to toggle source</span>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
|
281
|
+
<p>Add a section to the path Params:</p>
|
282
|
+
<dl class="rdoc-list note-list"><dt><code>key</code>
|
283
|
+
<dd>
|
284
|
+
<p>Symbol, the key to identify the section</p>
|
285
|
+
</dd><dt><code>value</code>
|
286
|
+
<dd>
|
287
|
+
<p>Any value to store with the associated key</p>
|
288
|
+
</dd></dl>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<div class="method-source-code" id="add-source">
|
294
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 26</span>
|
295
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
296
|
+
<span class="ruby-ivar">@path</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">value</span>
|
297
|
+
<span class="ruby-keyword">end</span></pre>
|
298
|
+
</div><!-- add-source -->
|
299
|
+
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
</div><!-- add-method -->
|
306
|
+
|
307
|
+
|
308
|
+
<div id="method-i-delete" class="method-detail ">
|
309
|
+
|
310
|
+
<div class="method-heading">
|
311
|
+
<span class="method-name">delete</span><span
|
312
|
+
class="method-args">(key)</span>
|
313
|
+
|
314
|
+
<span class="method-click-advice">click to toggle source</span>
|
315
|
+
|
316
|
+
</div>
|
317
|
+
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
<p>Deletes a value from the internal hash based on a key Params:</p>
|
322
|
+
<dl class="rdoc-list note-list"><dt><code>key</code>
|
323
|
+
<dd>
|
324
|
+
<p>Symbol, the key to identify the section</p>
|
325
|
+
</dd></dl>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
<div class="method-source-code" id="delete-source">
|
331
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 40</span>
|
332
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
333
|
+
<span class="ruby-ivar">@path</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
334
|
+
<span class="ruby-keyword">end</span></pre>
|
335
|
+
</div><!-- delete-source -->
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</div><!-- delete-method -->
|
343
|
+
|
344
|
+
|
345
|
+
<div id="method-i-exists-3F" class="method-detail ">
|
346
|
+
|
347
|
+
<div class="method-heading">
|
348
|
+
<span class="method-name">exists?</span><span
|
349
|
+
class="method-args">(key)</span>
|
350
|
+
|
351
|
+
<span class="method-click-advice">click to toggle source</span>
|
352
|
+
|
353
|
+
</div>
|
354
|
+
|
355
|
+
|
356
|
+
<div class="method-description">
|
357
|
+
|
358
|
+
<p>Checks whether a key exists Params:</p>
|
359
|
+
<dl class="rdoc-list note-list"><dt><code>key</code>
|
360
|
+
<dd>
|
361
|
+
<p>Symbol, the key to identify the section</p>
|
362
|
+
</dd></dl>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
<div class="method-source-code" id="exists-3F-source">
|
368
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 47</span>
|
369
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">key</span>)
|
370
|
+
<span class="ruby-ivar">@path</span>.<span class="ruby-identifier">key?</span> <span class="ruby-identifier">key</span>
|
371
|
+
<span class="ruby-keyword">end</span></pre>
|
372
|
+
</div><!-- exists-3F-source -->
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div><!-- exists-3F-method -->
|
380
|
+
|
381
|
+
|
382
|
+
<div id="method-i-get" class="method-detail ">
|
383
|
+
|
384
|
+
<div class="method-heading">
|
385
|
+
<span class="method-name">get</span><span
|
386
|
+
class="method-args">(key)</span>
|
387
|
+
|
388
|
+
<span class="method-click-advice">click to toggle source</span>
|
389
|
+
|
390
|
+
</div>
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method-description">
|
394
|
+
|
395
|
+
<p>Return a value based on the provided key Params:</p>
|
396
|
+
<dl class="rdoc-list note-list"><dt><code>key</code>
|
397
|
+
<dd>
|
398
|
+
<p>Symbol, the key to identify the section</p>
|
399
|
+
</dd></dl>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
<div class="method-source-code" id="get-source">
|
405
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 33</span>
|
406
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
407
|
+
<span class="ruby-ivar">@path</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>]
|
408
|
+
<span class="ruby-keyword">end</span></pre>
|
409
|
+
</div><!-- get-source -->
|
410
|
+
|
411
|
+
</div>
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
</div><!-- get-method -->
|
417
|
+
|
418
|
+
|
419
|
+
<div id="method-i-protocol-3D" class="method-detail ">
|
420
|
+
|
421
|
+
<div class="method-heading">
|
422
|
+
<span class="method-name">protocol=</span><span
|
423
|
+
class="method-args">(use_https)</span>
|
424
|
+
|
425
|
+
<span class="method-click-advice">click to toggle source</span>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
|
430
|
+
<div class="method-description">
|
431
|
+
|
432
|
+
<p>Set endpoint protocol Params:</p>
|
433
|
+
<dl class="rdoc-list note-list"><dt><code>use_https</code>
|
434
|
+
<dd>
|
435
|
+
<p>Boolean value for whether to use HTTPS</p>
|
436
|
+
</dd></dl>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
<div class="method-source-code" id="protocol-3D-source">
|
442
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 18</span>
|
443
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">protocol=</span>(<span class="ruby-identifier">use_https</span>)
|
444
|
+
<span class="ruby-ivar">@protocol</span> = <span class="ruby-string">'https://'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">use_https</span>
|
445
|
+
<span class="ruby-keyword">end</span></pre>
|
446
|
+
</div><!-- protocol-3D-source -->
|
447
|
+
|
448
|
+
</div>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</div><!-- protocol-3D-method -->
|
454
|
+
|
455
|
+
|
456
|
+
<div id="method-i-to_s" class="method-detail ">
|
457
|
+
|
458
|
+
<div class="method-heading">
|
459
|
+
<span class="method-name">to_s</span><span
|
460
|
+
class="method-args">()</span>
|
461
|
+
|
462
|
+
<span class="method-click-advice">click to toggle source</span>
|
463
|
+
|
464
|
+
</div>
|
465
|
+
|
466
|
+
|
467
|
+
<div class="method-description">
|
468
|
+
|
469
|
+
<p>Override the <a href="Endpoint.html#method-i-to_s">#to_s</a> method to
|
470
|
+
return an endpoint fragment</p>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
<div class="method-source-code" id="to_s-source">
|
476
|
+
<pre><span class="ruby-comment"># File lib/client/helper/endpoint.rb, line 52</span>
|
477
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
478
|
+
<span class="ruby-identifier">output</span> = <span class="ruby-ivar">@protocol</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@server</span>
|
479
|
+
<span class="ruby-ivar">@path</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_k</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
480
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">value</span>
|
481
|
+
<span class="ruby-keyword">end</span>
|
482
|
+
<span class="ruby-identifier">output</span>
|
483
|
+
<span class="ruby-keyword">end</span></pre>
|
484
|
+
</div><!-- to_s-source -->
|
485
|
+
|
486
|
+
</div>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
</div><!-- to_s-method -->
|
492
|
+
|
493
|
+
|
494
|
+
</section><!-- public-instance-method-details -->
|
495
|
+
|
496
|
+
</section><!-- 5Buntitled-5D -->
|
497
|
+
|
498
|
+
</div><!-- documentation -->
|
499
|
+
|
500
|
+
|
501
|
+
<footer id="validator-badges">
|
502
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
503
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
504
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
505
|
+
</footer>
|
506
|
+
|