brauser 3.3.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/.travis-gemfile +4 -5
- data/.travis.yml +2 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile +7 -8
- data/README.md +31 -95
- data/Rakefile +0 -1
- data/brauser.gemspec +4 -4
- data/default_definitions/browsers.rb +50 -0
- data/default_definitions/languages.rb +118 -0
- data/default_definitions/platforms.rb +24 -0
- data/doc/Brauser.html +6 -6
- data/doc/Brauser/Browser.html +3867 -580
- data/doc/Brauser/Definitions.html +537 -0
- data/doc/Brauser/Definitions/Base.html +342 -0
- data/doc/Brauser/Definitions/Browser.html +1047 -0
- data/doc/Brauser/Definitions/Language.html +496 -0
- data/doc/Brauser/Definitions/Platform.html +686 -0
- data/doc/Brauser/Hooks.html +2 -2
- data/doc/Brauser/Hooks/RubyOnRails.html +9 -9
- data/doc/Brauser/Parser.html +513 -0
- data/doc/Brauser/Value.html +601 -0
- data/doc/Brauser/Version.html +5 -5
- data/doc/_index.html +25 -108
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +33 -97
- data/doc/index.html +33 -97
- data/doc/method_list.html +72 -120
- data/doc/top-level-namespace.html +2 -2
- data/lib/brauser.rb +13 -15
- data/lib/brauser/browser.rb +195 -66
- data/lib/brauser/definitions/base.rb +71 -0
- data/lib/brauser/definitions/browser.rb +80 -0
- data/lib/brauser/definitions/language.rb +29 -0
- data/lib/brauser/definitions/platform.rb +42 -0
- data/lib/brauser/hooks.rb +1 -2
- data/lib/brauser/parser.rb +47 -0
- data/lib/brauser/value.rb +39 -0
- data/lib/brauser/version.rb +3 -4
- data/spec/brauser/browser_spec.rb +73 -564
- data/spec/brauser/default_definitions_spec.rb +129 -0
- data/spec/brauser/definitions/base_spec.rb +48 -0
- data/spec/brauser/definitions/browser_spec.rb +47 -0
- data/spec/brauser/definitions/language_spec.rb +18 -0
- data/spec/brauser/definitions/platform_spec.rb +36 -0
- data/spec/brauser/hooks_spec.rb +5 -6
- data/spec/brauser/parser_spec.rb +31 -0
- data/spec/brauser/value_spec.rb +34 -0
- data/spec/coverage_helper.rb +0 -1
- data/spec/spec_helper.rb +0 -1
- metadata +50 -23
- data/lib/brauser/browseable/attributes.rb +0 -95
- data/lib/brauser/browseable/general.rb +0 -104
- data/lib/brauser/browseable/parsing.rb +0 -127
- data/lib/brauser/browseable/partial_querying.rb +0 -116
- data/lib/brauser/browseable/querying.rb +0 -63
- data/lib/brauser/browseable/register.rb +0 -73
- data/lib/brauser/definition.rb +0 -80
- data/lib/brauser/definitions/browsers.rb +0 -68
- data/lib/brauser/definitions/languages.rb +0 -130
- data/lib/brauser/definitions/platforms.rb +0 -30
- data/lib/brauser/query.rb +0 -36
- data/lib/brauser/queryable/chainers.rb +0 -56
- data/lib/brauser/queryable/queries.rb +0 -60
- data/spec/brauser/definition_spec.rb +0 -39
- data/spec/brauser/query_spec.rb +0 -111
@@ -0,0 +1,686 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: Brauser::Definitions::Platform
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.4
|
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
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!Brauser/Definitions/Platform.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (P)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Brauser.html" title="Brauser (module)">Brauser</a></span></span> » <span class='title'><span class='object_link'><a href="../Definitions.html" title="Brauser::Definitions (module)">Definitions</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Platform</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: Brauser::Definitions::Platform
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="Base.html" title="Brauser::Definitions::Base (class)">Base</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="Base.html" title="Brauser::Definitions::Base (class)">Base</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">Brauser::Definitions::Platform</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/brauser/definitions/platform.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
<p>A definition of a platform.</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
119
|
+
<ul class="summary">
|
120
|
+
|
121
|
+
<li class="public ">
|
122
|
+
<span class="summary_signature">
|
123
|
+
|
124
|
+
<a href="#matcher-instance_method" title="#matcher (instance method)">- (Regexp|Proc) <strong>matcher</strong> </a>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
</span>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="note title readonly">readonly</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<span class="summary_desc"><div class='inline'><p>The pattern or the block to recognize the platform.</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#name-instance_method" title="#name (instance method)">- (String) <strong>name</strong> </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="note title readonly">readonly</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'><p>The platform name.</p>
|
172
|
+
</div></span>
|
173
|
+
|
174
|
+
</li>
|
175
|
+
|
176
|
+
|
177
|
+
</ul>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Brauser::Definitions::Base (class)">Base</a></span></h3>
|
184
|
+
<p class="inherited"><span class='object_link'><a href="Base.html#id-instance_method" title="Brauser::Definitions::Base#id (method)">#id</a></span></p>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<h2>
|
189
|
+
Instance Method Summary
|
190
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
191
|
+
</h2>
|
192
|
+
|
193
|
+
<ul class="summary">
|
194
|
+
|
195
|
+
<li class="public ">
|
196
|
+
<span class="summary_signature">
|
197
|
+
|
198
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Platform) <strong>initialize</strong>(id, name, matcher = /.*/, **_, &block) </a>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</span>
|
203
|
+
|
204
|
+
|
205
|
+
<span class="note title constructor">constructor</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
<span class="summary_desc"><div class='inline'><p>Creates a new definition.</p>
|
215
|
+
</div></span>
|
216
|
+
|
217
|
+
</li>
|
218
|
+
|
219
|
+
|
220
|
+
<li class="public ">
|
221
|
+
<span class="summary_signature">
|
222
|
+
|
223
|
+
<a href="#match-instance_method" title="#match (instance method)">- (Boolean|NilClass) <strong>match</strong>(header, engine) </a>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</span>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
<span class="summary_desc"><div class='inline'><p>Matches against an header.</p>
|
238
|
+
</div></span>
|
239
|
+
|
240
|
+
</li>
|
241
|
+
|
242
|
+
|
243
|
+
</ul>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
<div id="constructor_details" class="method_details_list">
|
253
|
+
<h2>Constructor Details</h2>
|
254
|
+
|
255
|
+
<div class="method_details first">
|
256
|
+
<h3 class="signature first" id="initialize-instance_method">
|
257
|
+
|
258
|
+
- (<tt><span class='object_link'><a href="" title="Brauser::Definitions::Platform (class)">Platform</a></span></tt>) <strong>initialize</strong>(id, name, matcher = /.*/, **_, &block)
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</h3><div class="docstring">
|
265
|
+
<div class="discussion">
|
266
|
+
<p>Creates a new definition.</p>
|
267
|
+
|
268
|
+
|
269
|
+
</div>
|
270
|
+
</div>
|
271
|
+
<div class="tags">
|
272
|
+
<p class="tag_title">Parameters:</p>
|
273
|
+
<ul class="param">
|
274
|
+
|
275
|
+
<li>
|
276
|
+
|
277
|
+
<span class='name'>id</span>
|
278
|
+
|
279
|
+
|
280
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
—
|
285
|
+
<div class='inline'><p>The platform id.</p>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
<li>
|
291
|
+
|
292
|
+
<span class='name'>name</span>
|
293
|
+
|
294
|
+
|
295
|
+
<span class='type'>(<tt>String</tt>)</span>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
—
|
300
|
+
<div class='inline'><p>The platform name.</p>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
</li>
|
304
|
+
|
305
|
+
<li>
|
306
|
+
|
307
|
+
<span class='name'>matcher</span>
|
308
|
+
|
309
|
+
|
310
|
+
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
311
|
+
|
312
|
+
|
313
|
+
<em class="default">(defaults to: <tt>/.*/</tt>)</em>
|
314
|
+
|
315
|
+
|
316
|
+
—
|
317
|
+
<div class='inline'><p>The pattern or the block to recognize the platform. <strong>Ignore if a block is given</strong></p>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
</ul>
|
323
|
+
|
324
|
+
|
325
|
+
</div><table class="source_code">
|
326
|
+
<tr>
|
327
|
+
<td>
|
328
|
+
<pre class="lines">
|
329
|
+
|
330
|
+
|
331
|
+
22
|
332
|
+
23
|
333
|
+
24
|
334
|
+
25
|
335
|
+
26</pre>
|
336
|
+
</td>
|
337
|
+
<td>
|
338
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/platform.rb', line 22</span>
|
339
|
+
|
340
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
341
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
|
342
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
343
|
+
<span class='ivar'>@matcher</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>?</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>:</span> <span class='id identifier rubyid_matcher'>matcher</span>
|
344
|
+
<span class='kw'>end</span></pre>
|
345
|
+
</td>
|
346
|
+
</tr>
|
347
|
+
</table>
|
348
|
+
</div>
|
349
|
+
|
350
|
+
</div>
|
351
|
+
|
352
|
+
<div id="instance_attr_details" class="attr_details">
|
353
|
+
<h2>Instance Attribute Details</h2>
|
354
|
+
|
355
|
+
|
356
|
+
<span id=""></span>
|
357
|
+
<div class="method_details first">
|
358
|
+
<h3 class="signature first" id="matcher-instance_method">
|
359
|
+
|
360
|
+
- (<tt>Regexp|Proc</tt>) <strong>matcher</strong> <span class="extras">(readonly)</span>
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
</h3><div class="docstring">
|
367
|
+
<div class="discussion">
|
368
|
+
<p>Returns The pattern or the block to recognize the platform.</p>
|
369
|
+
|
370
|
+
|
371
|
+
</div>
|
372
|
+
</div>
|
373
|
+
<div class="tags">
|
374
|
+
|
375
|
+
<p class="tag_title">Returns:</p>
|
376
|
+
<ul class="return">
|
377
|
+
|
378
|
+
<li>
|
379
|
+
|
380
|
+
|
381
|
+
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
—
|
386
|
+
<div class='inline'><p>The pattern or the block to recognize the platform.</p>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</li>
|
390
|
+
|
391
|
+
</ul>
|
392
|
+
|
393
|
+
</div><table class="source_code">
|
394
|
+
<tr>
|
395
|
+
<td>
|
396
|
+
<pre class="lines">
|
397
|
+
|
398
|
+
|
399
|
+
14
|
400
|
+
15
|
401
|
+
16
|
402
|
+
17
|
403
|
+
18
|
404
|
+
19
|
405
|
+
20
|
406
|
+
21
|
407
|
+
22
|
408
|
+
23
|
409
|
+
24
|
410
|
+
25
|
411
|
+
26
|
412
|
+
27
|
413
|
+
28
|
414
|
+
29
|
415
|
+
30
|
416
|
+
31
|
417
|
+
32
|
418
|
+
33
|
419
|
+
34
|
420
|
+
35
|
421
|
+
36
|
422
|
+
37
|
423
|
+
38
|
424
|
+
39
|
425
|
+
40</pre>
|
426
|
+
</td>
|
427
|
+
<td>
|
428
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/platform.rb', line 14</span>
|
429
|
+
|
430
|
+
<span class='kw'>class</span> <span class='const'>Platform</span> <span class='op'><</span> <span class='const'>Base</span>
|
431
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:matcher</span>
|
432
|
+
|
433
|
+
<span class='comment'># Creates a new definition.
|
434
|
+
</span> <span class='comment'>#
|
435
|
+
</span> <span class='comment'># @param id [Symbol] The platform id.
|
436
|
+
</span> <span class='comment'># @param name [String] The platform name.
|
437
|
+
</span> <span class='comment'># @param matcher [Regexp|Proc] The pattern or the block to recognize the platform. **Ignore if a block is given**
|
438
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
439
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
|
440
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
441
|
+
<span class='ivar'>@matcher</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>?</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>:</span> <span class='id identifier rubyid_matcher'>matcher</span>
|
442
|
+
<span class='kw'>end</span>
|
443
|
+
|
444
|
+
<span class='comment'># Matches against an header.
|
445
|
+
</span> <span class='comment'>#
|
446
|
+
</span> <span class='comment'># @param header [String] The header to match.
|
447
|
+
</span> <span class='comment'># @param engine [Symbol] The engine to match.
|
448
|
+
</span> <span class='comment'># @return [Boolean|NilClass] True if match succeeded, `false` or `nil` otherwise.
|
449
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
450
|
+
<span class='kw'>if</span> <span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Regexp</span><span class='rparen'>)</span>
|
451
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span>
|
452
|
+
<span class='kw'>else</span>
|
453
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
454
|
+
<span class='kw'>end</span>
|
455
|
+
<span class='kw'>end</span>
|
456
|
+
<span class='kw'>end</span></pre>
|
457
|
+
</td>
|
458
|
+
</tr>
|
459
|
+
</table>
|
460
|
+
</div>
|
461
|
+
|
462
|
+
|
463
|
+
<span id=""></span>
|
464
|
+
<div class="method_details ">
|
465
|
+
<h3 class="signature " id="name-instance_method">
|
466
|
+
|
467
|
+
- (<tt>String</tt>) <strong>name</strong> <span class="extras">(readonly)</span>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
</h3><div class="docstring">
|
474
|
+
<div class="discussion">
|
475
|
+
<p>Returns The platform name.</p>
|
476
|
+
|
477
|
+
|
478
|
+
</div>
|
479
|
+
</div>
|
480
|
+
<div class="tags">
|
481
|
+
|
482
|
+
<p class="tag_title">Returns:</p>
|
483
|
+
<ul class="return">
|
484
|
+
|
485
|
+
<li>
|
486
|
+
|
487
|
+
|
488
|
+
<span class='type'>(<tt>String</tt>)</span>
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
—
|
493
|
+
<div class='inline'><p>The platform name.</p>
|
494
|
+
</div>
|
495
|
+
|
496
|
+
</li>
|
497
|
+
|
498
|
+
</ul>
|
499
|
+
|
500
|
+
</div><table class="source_code">
|
501
|
+
<tr>
|
502
|
+
<td>
|
503
|
+
<pre class="lines">
|
504
|
+
|
505
|
+
|
506
|
+
14
|
507
|
+
15
|
508
|
+
16
|
509
|
+
17
|
510
|
+
18
|
511
|
+
19
|
512
|
+
20
|
513
|
+
21
|
514
|
+
22
|
515
|
+
23
|
516
|
+
24
|
517
|
+
25
|
518
|
+
26
|
519
|
+
27
|
520
|
+
28
|
521
|
+
29
|
522
|
+
30
|
523
|
+
31
|
524
|
+
32
|
525
|
+
33
|
526
|
+
34
|
527
|
+
35
|
528
|
+
36
|
529
|
+
37
|
530
|
+
38
|
531
|
+
39
|
532
|
+
40</pre>
|
533
|
+
</td>
|
534
|
+
<td>
|
535
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/platform.rb', line 14</span>
|
536
|
+
|
537
|
+
<span class='kw'>class</span> <span class='const'>Platform</span> <span class='op'><</span> <span class='const'>Base</span>
|
538
|
+
<span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:matcher</span>
|
539
|
+
|
540
|
+
<span class='comment'># Creates a new definition.
|
541
|
+
</span> <span class='comment'>#
|
542
|
+
</span> <span class='comment'># @param id [Symbol] The platform id.
|
543
|
+
</span> <span class='comment'># @param name [String] The platform name.
|
544
|
+
</span> <span class='comment'># @param matcher [Regexp|Proc] The pattern or the block to recognize the platform. **Ignore if a block is given**
|
545
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_matcher'>matcher</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid__'>_</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
546
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
|
547
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
|
548
|
+
<span class='ivar'>@matcher</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>?</span> <span class='id identifier rubyid_block'>block</span> <span class='op'>:</span> <span class='id identifier rubyid_matcher'>matcher</span>
|
549
|
+
<span class='kw'>end</span>
|
550
|
+
|
551
|
+
<span class='comment'># Matches against an header.
|
552
|
+
</span> <span class='comment'>#
|
553
|
+
</span> <span class='comment'># @param header [String] The header to match.
|
554
|
+
</span> <span class='comment'># @param engine [Symbol] The engine to match.
|
555
|
+
</span> <span class='comment'># @return [Boolean|NilClass] True if match succeeded, `false` or `nil` otherwise.
|
556
|
+
</span> <span class='kw'>def</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
557
|
+
<span class='kw'>if</span> <span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Regexp</span><span class='rparen'>)</span>
|
558
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span>
|
559
|
+
<span class='kw'>else</span>
|
560
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
561
|
+
<span class='kw'>end</span>
|
562
|
+
<span class='kw'>end</span>
|
563
|
+
<span class='kw'>end</span></pre>
|
564
|
+
</td>
|
565
|
+
</tr>
|
566
|
+
</table>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
</div>
|
570
|
+
|
571
|
+
|
572
|
+
<div id="instance_method_details" class="method_details_list">
|
573
|
+
<h2>Instance Method Details</h2>
|
574
|
+
|
575
|
+
|
576
|
+
<div class="method_details first">
|
577
|
+
<h3 class="signature first" id="match-instance_method">
|
578
|
+
|
579
|
+
- (<tt>Boolean|NilClass</tt>) <strong>match</strong>(header, engine)
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
</h3><div class="docstring">
|
586
|
+
<div class="discussion">
|
587
|
+
<p>Matches against an header.</p>
|
588
|
+
|
589
|
+
|
590
|
+
</div>
|
591
|
+
</div>
|
592
|
+
<div class="tags">
|
593
|
+
<p class="tag_title">Parameters:</p>
|
594
|
+
<ul class="param">
|
595
|
+
|
596
|
+
<li>
|
597
|
+
|
598
|
+
<span class='name'>header</span>
|
599
|
+
|
600
|
+
|
601
|
+
<span class='type'>(<tt>String</tt>)</span>
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
—
|
606
|
+
<div class='inline'><p>The header to match.</p>
|
607
|
+
</div>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
<li>
|
612
|
+
|
613
|
+
<span class='name'>engine</span>
|
614
|
+
|
615
|
+
|
616
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
—
|
621
|
+
<div class='inline'><p>The engine to match.</p>
|
622
|
+
</div>
|
623
|
+
|
624
|
+
</li>
|
625
|
+
|
626
|
+
</ul>
|
627
|
+
|
628
|
+
<p class="tag_title">Returns:</p>
|
629
|
+
<ul class="return">
|
630
|
+
|
631
|
+
<li>
|
632
|
+
|
633
|
+
|
634
|
+
<span class='type'>(<tt>Boolean|NilClass</tt>)</span>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
—
|
639
|
+
<div class='inline'><p>True if match succeeded, <code>false</code> or <code>nil</code> otherwise.</p>
|
640
|
+
</div>
|
641
|
+
|
642
|
+
</li>
|
643
|
+
|
644
|
+
</ul>
|
645
|
+
|
646
|
+
</div><table class="source_code">
|
647
|
+
<tr>
|
648
|
+
<td>
|
649
|
+
<pre class="lines">
|
650
|
+
|
651
|
+
|
652
|
+
33
|
653
|
+
34
|
654
|
+
35
|
655
|
+
36
|
656
|
+
37
|
657
|
+
38
|
658
|
+
39</pre>
|
659
|
+
</td>
|
660
|
+
<td>
|
661
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/platform.rb', line 33</span>
|
662
|
+
|
663
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
664
|
+
<span class='kw'>if</span> <span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Regexp</span><span class='rparen'>)</span>
|
665
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='rparen'>)</span>
|
666
|
+
<span class='kw'>else</span>
|
667
|
+
<span class='ivar'>@matcher</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_engine'>engine</span><span class='rparen'>)</span>
|
668
|
+
<span class='kw'>end</span>
|
669
|
+
<span class='kw'>end</span></pre>
|
670
|
+
</td>
|
671
|
+
</tr>
|
672
|
+
</table>
|
673
|
+
</div>
|
674
|
+
|
675
|
+
</div>
|
676
|
+
|
677
|
+
</div>
|
678
|
+
|
679
|
+
<div id="footer">
|
680
|
+
Generated on Mon Sep 29 16:43:32 2014 by
|
681
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
682
|
+
0.8.7.4 (ruby-2.1.3).
|
683
|
+
</div>
|
684
|
+
|
685
|
+
</body>
|
686
|
+
</html>
|