raspberry_pi_iot 0.0.12 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/IoT.html +6 -4
- data/doc/RaspberryPiIoT.html +16 -10
- data/doc/_index.html +197 -21
- data/doc/class_list.html +1 -1
- data/doc/file.LICENSE.html +1 -1
- data/doc/file.README.html +15 -6
- data/doc/index.html +15 -6
- data/doc/method_list.html +590 -30
- data/doc/top-level-namespace.html +2 -2
- data/lib/iot/bh1750.rb +6 -4
- data/lib/iot/receptor.rb +6 -0
- data/lib/raspberry_pi.rb +1 -1
- data/lib/raspberry_pi_iot/version.rb +1 -1
- data/test/test.sh +5 -0
- data/test/test.txt +52 -169
- data/test/test_bh1750.rb +5 -0
- data/test/test_ky008.rb +41 -0
- metadata +2 -29
- data/doc/Actuator.html +0 -145
- data/doc/BH1750.html +0 -541
- data/doc/BME280.html +0 -276
- data/doc/BMP280.html +0 -276
- data/doc/BMxSensor.html +0 -557
- data/doc/BinaryActuator.html +0 -177
- data/doc/BinaryEffector.html +0 -246
- data/doc/BinaryReceptor.html +0 -387
- data/doc/BinarySensor.html +0 -168
- data/doc/Bus.html +0 -126
- data/doc/Button.html +0 -1276
- data/doc/DHT11.html +0 -287
- data/doc/DHT22.html +0 -287
- data/doc/DHTxxSensor.html +0 -361
- data/doc/DS18B20.html +0 -339
- data/doc/DigitalActuator.html +0 -164
- data/doc/DigitalEffector.html +0 -624
- data/doc/DigitalReceptor.html +0 -242
- data/doc/DigitalSensor.html +0 -162
- data/doc/Effector.html +0 -257
- data/doc/HCSR501.html +0 -172
- data/doc/HumitureSensor.html +0 -453
- data/doc/LED.html +0 -836
- data/doc/MAX44009.html +0 -830
- data/doc/RaspberryPi.html +0 -544
- data/doc/Receptor.html +0 -257
- data/doc/Sensor.html +0 -145
- data/doc/TemperatureSensor.html +0 -644
data/doc/RaspberryPi.html
DELETED
@@ -1,544 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Module: RaspberryPi
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.20
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "RaspberryPi";
|
19
|
-
relpath = '';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="_index.html">Index (R)</a> »
|
40
|
-
|
41
|
-
|
42
|
-
<span class="title">RaspberryPi</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Module: RaspberryPi
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<dl>
|
80
|
-
<dt>Defined in:</dt>
|
81
|
-
<dd>lib/thermal_sensor.rb<span class="defines">,<br />
|
82
|
-
lib/raspberry_pi.rb</span>
|
83
|
-
</dd>
|
84
|
-
</dl>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
<h2>Overview</h2><div class="docstring">
|
89
|
-
<div class="discussion">
|
90
|
-
|
91
|
-
<p>ThermalSensor - Raspberry Pi internal SoC temperature sensor</p>
|
92
|
-
|
93
|
-
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
<div class="tags">
|
97
|
-
|
98
|
-
|
99
|
-
</div><h2>Defined Under Namespace</h2>
|
100
|
-
<p class="children">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="RaspberryPi/ThermalSensor.html" title="RaspberryPi::ThermalSensor (class)">ThermalSensor</a></span>
|
106
|
-
|
107
|
-
|
108
|
-
</p>
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
<h2>
|
118
|
-
Class Method Summary
|
119
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
120
|
-
</h2>
|
121
|
-
|
122
|
-
<ul class="summary">
|
123
|
-
|
124
|
-
<li class="public ">
|
125
|
-
<span class="summary_signature">
|
126
|
-
|
127
|
-
<a href="#disk_space-class_method" title="disk_space (class method)">.<strong>disk_space</strong>(mounted = '/', hash = false) ⇒ Object </a>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
</span>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
<span class="summary_desc"><div class='inline'>
|
142
|
-
<p>Return used and free disk space in KB on a file system or on all (with
|
143
|
-
'*').</p>
|
144
|
-
</div></span>
|
145
|
-
|
146
|
-
</li>
|
147
|
-
|
148
|
-
|
149
|
-
<li class="public ">
|
150
|
-
<span class="summary_signature">
|
151
|
-
|
152
|
-
<a href="#hardware_info-class_method" title="hardware_info (class method)">.<strong>hardware_info</strong> ⇒ Object </a>
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
</span>
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
<span class="summary_desc"><div class='inline'>
|
167
|
-
<p>Return hardware info as a hash.</p>
|
168
|
-
</div></span>
|
169
|
-
|
170
|
-
</li>
|
171
|
-
|
172
|
-
|
173
|
-
<li class="public ">
|
174
|
-
<span class="summary_signature">
|
175
|
-
|
176
|
-
<a href="#host_ip-class_method" title="host_ip (class method)">.<strong>host_ip</strong> ⇒ Object </a>
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
</span>
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
<span class="summary_desc"><div class='inline'>
|
191
|
-
<p>Return host ip-addresses as an Array.</p>
|
192
|
-
</div></span>
|
193
|
-
|
194
|
-
</li>
|
195
|
-
|
196
|
-
|
197
|
-
<li class="public ">
|
198
|
-
<span class="summary_signature">
|
199
|
-
|
200
|
-
<a href="#host_name-class_method" title="host_name (class method)">.<strong>host_name</strong> ⇒ Object </a>
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
</span>
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
<span class="summary_desc"><div class='inline'>
|
215
|
-
<p>Return host name as a string.</p>
|
216
|
-
</div></span>
|
217
|
-
|
218
|
-
</li>
|
219
|
-
|
220
|
-
|
221
|
-
<li class="public ">
|
222
|
-
<span class="summary_signature">
|
223
|
-
|
224
|
-
<a href="#model_name-class_method" title="model_name (class method)">.<strong>model_name</strong>(source = 'proc') ⇒ Object </a>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
</span>
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
<span class="summary_desc"><div class='inline'>
|
239
|
-
<p>Return the model name <a
|
240
|
-
href="https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version">www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version</a>/.</p>
|
241
|
-
</div></span>
|
242
|
-
|
243
|
-
</li>
|
244
|
-
|
245
|
-
|
246
|
-
</ul>
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
<div id="class_method_details" class="method_details_list">
|
252
|
-
<h2>Class Method Details</h2>
|
253
|
-
|
254
|
-
|
255
|
-
<div class="method_details first">
|
256
|
-
<h3 class="signature first" id="disk_space-class_method">
|
257
|
-
|
258
|
-
.<strong>disk_space</strong>(mounted = '/', hash = false) ⇒ <tt>Object</tt>
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
</h3><div class="docstring">
|
265
|
-
<div class="discussion">
|
266
|
-
|
267
|
-
<p>Return used and free disk space in KB on a file system or on all (with
|
268
|
-
'*')</p>
|
269
|
-
|
270
|
-
|
271
|
-
</div>
|
272
|
-
</div>
|
273
|
-
<div class="tags">
|
274
|
-
|
275
|
-
|
276
|
-
</div><table class="source_code">
|
277
|
-
<tr>
|
278
|
-
<td>
|
279
|
-
<pre class="lines">
|
280
|
-
|
281
|
-
|
282
|
-
47
|
283
|
-
48
|
284
|
-
49
|
285
|
-
50
|
286
|
-
51
|
287
|
-
52
|
288
|
-
53
|
289
|
-
54
|
290
|
-
55
|
291
|
-
56
|
292
|
-
57
|
293
|
-
58
|
294
|
-
59
|
295
|
-
60
|
296
|
-
61
|
297
|
-
62
|
298
|
-
63
|
299
|
-
64</pre>
|
300
|
-
</td>
|
301
|
-
<td>
|
302
|
-
<pre class="code"><span class="info file"># File 'lib/raspberry_pi.rb', line 47</span>
|
303
|
-
|
304
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_disk_space'>disk_space</span><span class='lparen'>(</span><span class='id identifier rubyid_mounted'>mounted</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
|
305
|
-
<span class='id identifier rubyid_disk_memory'>disk_memory</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
306
|
-
<span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>df -k</span><span class='tstring_end'>`</span></span>
|
307
|
-
<span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
|
308
|
-
<span class='id identifier rubyid_disk_memory'>disk_memory</span> <span class='op'><<</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
309
|
-
<span class='kw'>end</span>
|
310
|
-
<span class='id identifier rubyid_disk_memory'>disk_memory</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span> <span class='comment'># deleie 1st array with titles
|
311
|
-
</span>
|
312
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_mounted'>mounted</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>*</span><span class='tstring_end'>'</span></span>
|
313
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_hash'>hash</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_matrix2hash'>matrix2hash</span><span class='lparen'>(</span><span class='id identifier rubyid_disk_memory'>disk_memory</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_disk_memory'>disk_memory</span>
|
314
|
-
<span class='kw'>else</span>
|
315
|
-
<span class='id identifier rubyid_disk_memory'>disk_memory</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_fs'>fs</span><span class='op'>|</span>
|
316
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_fs'>fs</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_mounted'>mounted</span>
|
317
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_hash'>hash</span> <span class='op'>?</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_list2hash'>list2hash</span><span class='lparen'>(</span><span class='id identifier rubyid_fs'>fs</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_fs'>fs</span>
|
318
|
-
<span class='kw'>end</span>
|
319
|
-
<span class='kw'>end</span>
|
320
|
-
<span class='kw'>end</span>
|
321
|
-
<span class='kw'>end</span></pre>
|
322
|
-
</td>
|
323
|
-
</tr>
|
324
|
-
</table>
|
325
|
-
</div>
|
326
|
-
|
327
|
-
<div class="method_details ">
|
328
|
-
<h3 class="signature " id="hardware_info-class_method">
|
329
|
-
|
330
|
-
.<strong>hardware_info</strong> ⇒ <tt>Object</tt>
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
</h3><div class="docstring">
|
337
|
-
<div class="discussion">
|
338
|
-
|
339
|
-
<p>Return hardware info as a hash</p>
|
340
|
-
|
341
|
-
|
342
|
-
</div>
|
343
|
-
</div>
|
344
|
-
<div class="tags">
|
345
|
-
|
346
|
-
|
347
|
-
</div><table class="source_code">
|
348
|
-
<tr>
|
349
|
-
<td>
|
350
|
-
<pre class="lines">
|
351
|
-
|
352
|
-
|
353
|
-
19
|
354
|
-
20
|
355
|
-
21
|
356
|
-
22
|
357
|
-
23
|
358
|
-
24
|
359
|
-
25
|
360
|
-
26
|
361
|
-
27
|
362
|
-
28
|
363
|
-
29
|
364
|
-
30
|
365
|
-
31
|
366
|
-
32
|
367
|
-
33
|
368
|
-
34</pre>
|
369
|
-
</td>
|
370
|
-
<td>
|
371
|
-
<pre class="code"><span class="info file"># File 'lib/raspberry_pi.rb', line 19</span>
|
372
|
-
|
373
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hardware_info'>hardware_info</span>
|
374
|
-
<span class='id identifier rubyid_info'>info</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
375
|
-
<span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'> pinout | grep ': '</span><span class='tstring_end'>`</span></span>
|
376
|
-
<span class='id identifier rubyid_lines'>lines</span> <span class='op'><<</span> <span class='backtick'>`</span><span class='tstring_content'>cat /proc/cpuinfo | grep ': '</span><span class='tstring_end'>`</span></span>
|
377
|
-
<span class='id identifier rubyid_lines'>lines</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
|
378
|
-
<span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
379
|
-
<span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_strip!'>strip!</span>
|
380
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>processor</span><span class='tstring_end'>'</span></span>
|
381
|
-
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='op'>+</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
382
|
-
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Cores</span><span class='tstring_end'>'</span></span>
|
383
|
-
<span class='kw'>end</span>
|
384
|
-
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CPU name</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>model name</span><span class='tstring_end'>'</span></span>
|
385
|
-
<span class='id identifier rubyid_info'>info</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
386
|
-
<span class='kw'>end</span>
|
387
|
-
<span class='id identifier rubyid_info'>info</span>
|
388
|
-
<span class='kw'>end</span></pre>
|
389
|
-
</td>
|
390
|
-
</tr>
|
391
|
-
</table>
|
392
|
-
</div>
|
393
|
-
|
394
|
-
<div class="method_details ">
|
395
|
-
<h3 class="signature " id="host_ip-class_method">
|
396
|
-
|
397
|
-
.<strong>host_ip</strong> ⇒ <tt>Object</tt>
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
</h3><div class="docstring">
|
404
|
-
<div class="discussion">
|
405
|
-
|
406
|
-
<p>Return host ip-addresses as an Array</p>
|
407
|
-
|
408
|
-
|
409
|
-
</div>
|
410
|
-
</div>
|
411
|
-
<div class="tags">
|
412
|
-
|
413
|
-
|
414
|
-
</div><table class="source_code">
|
415
|
-
<tr>
|
416
|
-
<td>
|
417
|
-
<pre class="lines">
|
418
|
-
|
419
|
-
|
420
|
-
42
|
421
|
-
43
|
422
|
-
44</pre>
|
423
|
-
</td>
|
424
|
-
<td>
|
425
|
-
<pre class="code"><span class="info file"># File 'lib/raspberry_pi.rb', line 42</span>
|
426
|
-
|
427
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_host_ip'>host_ip</span>
|
428
|
-
<span class='backtick'>`</span><span class='tstring_content'>hostname -I</span><span class='tstring_end'>`</span></span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
429
|
-
<span class='kw'>end</span></pre>
|
430
|
-
</td>
|
431
|
-
</tr>
|
432
|
-
</table>
|
433
|
-
</div>
|
434
|
-
|
435
|
-
<div class="method_details ">
|
436
|
-
<h3 class="signature " id="host_name-class_method">
|
437
|
-
|
438
|
-
.<strong>host_name</strong> ⇒ <tt>Object</tt>
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
</h3><div class="docstring">
|
445
|
-
<div class="discussion">
|
446
|
-
|
447
|
-
<p>Return host name as a string</p>
|
448
|
-
|
449
|
-
|
450
|
-
</div>
|
451
|
-
</div>
|
452
|
-
<div class="tags">
|
453
|
-
|
454
|
-
|
455
|
-
</div><table class="source_code">
|
456
|
-
<tr>
|
457
|
-
<td>
|
458
|
-
<pre class="lines">
|
459
|
-
|
460
|
-
|
461
|
-
37
|
462
|
-
38
|
463
|
-
39</pre>
|
464
|
-
</td>
|
465
|
-
<td>
|
466
|
-
<pre class="code"><span class="info file"># File 'lib/raspberry_pi.rb', line 37</span>
|
467
|
-
|
468
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_host_name'>host_name</span>
|
469
|
-
<span class='backtick'>`</span><span class='tstring_content'>hostname</span><span class='tstring_end'>`</span></span><span class='period'>.</span><span class='id identifier rubyid_chomp'>chomp</span>
|
470
|
-
<span class='kw'>end</span></pre>
|
471
|
-
</td>
|
472
|
-
</tr>
|
473
|
-
</table>
|
474
|
-
</div>
|
475
|
-
|
476
|
-
<div class="method_details ">
|
477
|
-
<h3 class="signature " id="model_name-class_method">
|
478
|
-
|
479
|
-
.<strong>model_name</strong>(source = 'proc') ⇒ <tt>Object</tt>
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
</h3><div class="docstring">
|
486
|
-
<div class="discussion">
|
487
|
-
|
488
|
-
<p>Return the model name <a
|
489
|
-
href="https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version">www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version</a>/</p>
|
490
|
-
|
491
|
-
|
492
|
-
</div>
|
493
|
-
</div>
|
494
|
-
<div class="tags">
|
495
|
-
|
496
|
-
|
497
|
-
</div><table class="source_code">
|
498
|
-
<tr>
|
499
|
-
<td>
|
500
|
-
<pre class="lines">
|
501
|
-
|
502
|
-
|
503
|
-
7
|
504
|
-
8
|
505
|
-
9
|
506
|
-
10
|
507
|
-
11
|
508
|
-
12
|
509
|
-
13
|
510
|
-
14
|
511
|
-
15
|
512
|
-
16</pre>
|
513
|
-
</td>
|
514
|
-
<td>
|
515
|
-
<pre class="code"><span class="info file"># File 'lib/raspberry_pi.rb', line 7</span>
|
516
|
-
|
517
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_model_name'>model_name</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>proc</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
518
|
-
<span class='id identifier rubyid_info'>info</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_source'>source</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>proc</span><span class='tstring_end'>'</span></span>
|
519
|
-
<span class='backtick'>`</span><span class='tstring_content'>cat /proc/device-tree/model</span><span class='tstring_end'>`</span></span>
|
520
|
-
<span class='kw'>elsif</span>
|
521
|
-
<span class='backtick'>`</span><span class='tstring_content'>pinout | grep -Eo "Pi Model[^|]+"</span><span class='tstring_end'>`</span></span>
|
522
|
-
<span class='kw'>else</span>
|
523
|
-
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>N/A</span><span class='tstring_end'>'</span></span>
|
524
|
-
<span class='kw'>end</span>
|
525
|
-
<span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
|
526
|
-
<span class='kw'>end</span></pre>
|
527
|
-
</td>
|
528
|
-
</tr>
|
529
|
-
</table>
|
530
|
-
</div>
|
531
|
-
|
532
|
-
</div>
|
533
|
-
|
534
|
-
</div>
|
535
|
-
|
536
|
-
<div id="footer">
|
537
|
-
Generated on Mon Jun 8 16:36:37 2020 by
|
538
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
539
|
-
0.9.20 (ruby-2.5.5).
|
540
|
-
</div>
|
541
|
-
|
542
|
-
</div>
|
543
|
-
</body>
|
544
|
-
</html>
|