brauser 4.1.2 → 4.1.3
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 +5 -5
- data/.rubocop.yml +6 -1
- data/.travis-gemfile +2 -2
- data/.travis.yml +5 -3
- data/.yardopts +1 -1
- data/Gemfile +1 -1
- data/LICENSE.md +21 -0
- data/README.md +20 -22
- data/Rakefile +1 -1
- data/brauser.gemspec +2 -2
- data/default_definitions/browsers.rb +1 -1
- data/default_definitions/languages.rb +1 -1
- data/default_definitions/platforms.rb +1 -1
- data/{doc → docs}/Brauser.html +1 -1
- data/docs/Brauser/Browser.html +5542 -0
- data/{doc → docs}/Brauser/Definitions.html +23 -27
- data/{doc → docs}/Brauser/Definitions/Base.html +14 -16
- data/docs/Brauser/Definitions/Browser.html +1031 -0
- data/{doc → docs}/Brauser/Definitions/Language.html +35 -38
- data/{doc → docs}/Brauser/Definitions/Platform.html +67 -71
- data/{doc → docs}/Brauser/Hooks.html +1 -1
- data/{doc → docs}/Brauser/Hooks/RubyOnRails.html +8 -10
- data/{doc → docs}/Brauser/Parser.html +22 -25
- data/{doc → docs}/Brauser/Value.html +38 -42
- data/{doc → docs}/Brauser/Version.html +5 -9
- data/{doc → docs}/_index.html +1 -1
- data/{doc → docs}/class_list.html +0 -0
- data/{doc → docs}/css/common.css +0 -0
- data/{doc → docs}/css/full_list.css +0 -0
- data/{doc → docs}/css/style.css +0 -0
- data/{doc → docs}/file.README.html +9 -7
- data/{doc → docs}/file_list.html +0 -0
- data/{doc → docs}/frames.html +0 -0
- data/{doc → docs}/index.html +9 -7
- data/{doc → docs}/js/app.js +0 -0
- data/{doc → docs}/js/full_list.js +0 -0
- data/{doc → docs}/js/jquery.js +0 -0
- data/{doc → docs}/method_list.html +0 -0
- data/{doc → docs}/top-level-namespace.html +1 -1
- data/lib/brauser.rb +1 -1
- data/lib/brauser/browser.rb +1 -1
- data/lib/brauser/definitions/base.rb +1 -1
- data/lib/brauser/definitions/browser.rb +1 -1
- data/lib/brauser/definitions/language.rb +1 -1
- data/lib/brauser/definitions/platform.rb +1 -1
- data/lib/brauser/hooks.rb +1 -1
- data/lib/brauser/parser.rb +1 -1
- data/lib/brauser/value.rb +1 -1
- data/lib/brauser/version.rb +2 -2
- data/spec/brauser/browser_spec.rb +1 -1
- data/spec/brauser/default_definitions_spec.rb +1 -1
- data/spec/brauser/definitions/base_spec.rb +1 -1
- data/spec/brauser/definitions/browser_spec.rb +1 -1
- data/spec/brauser/definitions/language_spec.rb +1 -1
- data/spec/brauser/definitions/platform_spec.rb +1 -1
- data/spec/brauser/hooks_spec.rb +1 -1
- data/spec/brauser/parser_spec.rb +1 -1
- data/spec/brauser/value_spec.rb +1 -1
- data/spec/coverage_helper.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +30 -46
- data/doc/Brauser/Browseable.html +0 -127
- data/doc/Brauser/Browseable/Attributes.html +0 -489
- data/doc/Brauser/Browseable/DefaultDefinitions.html +0 -389
- data/doc/Brauser/Browseable/General.html +0 -134
- data/doc/Brauser/Browseable/General/ClassMethods.html +0 -529
- data/doc/Brauser/Browseable/Parsing.html +0 -350
- data/doc/Brauser/Browseable/PartialQuerying.html +0 -625
- data/doc/Brauser/Browseable/Querying.html +0 -694
- data/doc/Brauser/Browseable/Register.html +0 -134
- data/doc/Brauser/Browseable/Register/ClassMethods.html +0 -516
- data/doc/Brauser/Browser.html +0 -5557
- data/doc/Brauser/Definition.html +0 -1235
- data/doc/Brauser/Definitions/Browser.html +0 -1036
- data/doc/Brauser/Query.html +0 -512
- data/doc/Brauser/Queryable.html +0 -127
- data/doc/Brauser/Queryable/Chainers.html +0 -598
- data/doc/Brauser/Queryable/Queries.html +0 -598
@@ -1,1036 +0,0 @@
|
|
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::Browser
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.6
|
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/Browser.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 (B)</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">Browser</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::Browser
|
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::Browser</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/browser.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="#engine_matcher-instance_method" title="#engine_matcher (instance method)">- (Regexp|Proc) <strong>engine_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 engine.</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
|
-
<li class="public ">
|
178
|
-
<span class="summary_signature">
|
179
|
-
|
180
|
-
<a href="#version_matcher-instance_method" title="#version_matcher (instance method)">- (Regexp|Proc) <strong>version_matcher</strong> </a>
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
</span>
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
<span class="note title readonly">readonly</span>
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
<span class="summary_desc"><div class='inline'><p>The pattern or the block to recognize the version.</p>
|
200
|
-
</div></span>
|
201
|
-
|
202
|
-
</li>
|
203
|
-
|
204
|
-
|
205
|
-
</ul>
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Brauser::Definitions::Base (class)">Base</a></span></h3>
|
212
|
-
<p class="inherited"><span class='object_link'><a href="Base.html#id-instance_method" title="Brauser::Definitions::Base#id (method)">#id</a></span></p>
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
<h2>
|
217
|
-
Instance Method Summary
|
218
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
219
|
-
</h2>
|
220
|
-
|
221
|
-
<ul class="summary">
|
222
|
-
|
223
|
-
<li class="public ">
|
224
|
-
<span class="summary_signature">
|
225
|
-
|
226
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Browser) <strong>initialize</strong>(id, name, engine_matcher, version_matcher, **_) </a>
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
</span>
|
231
|
-
|
232
|
-
|
233
|
-
<span class="note title constructor">constructor</span>
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
<span class="summary_desc"><div class='inline'><p>Creates a new definition.</p>
|
243
|
-
</div></span>
|
244
|
-
|
245
|
-
</li>
|
246
|
-
|
247
|
-
|
248
|
-
<li class="public ">
|
249
|
-
<span class="summary_signature">
|
250
|
-
|
251
|
-
<a href="#match-instance_method" title="#match (instance method)">- (Array|NilClass) <strong>match</strong>(header) </a>
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
</span>
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
<span class="summary_desc"><div class='inline'><p>Matches against an header.</p>
|
266
|
-
</div></span>
|
267
|
-
|
268
|
-
</li>
|
269
|
-
|
270
|
-
|
271
|
-
</ul>
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
<div id="constructor_details" class="method_details_list">
|
281
|
-
<h2>Constructor Details</h2>
|
282
|
-
|
283
|
-
<div class="method_details first">
|
284
|
-
<h3 class="signature first" id="initialize-instance_method">
|
285
|
-
|
286
|
-
- (<tt><span class='object_link'><a href="" title="Brauser::Definitions::Browser (class)">Browser</a></span></tt>) <strong>initialize</strong>(id, name, engine_matcher, version_matcher, **_)
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
</h3><div class="docstring">
|
293
|
-
<div class="discussion">
|
294
|
-
<p>Creates a new definition.</p>
|
295
|
-
|
296
|
-
|
297
|
-
</div>
|
298
|
-
</div>
|
299
|
-
<div class="tags">
|
300
|
-
<p class="tag_title">Parameters:</p>
|
301
|
-
<ul class="param">
|
302
|
-
|
303
|
-
<li>
|
304
|
-
|
305
|
-
<span class='name'>id</span>
|
306
|
-
|
307
|
-
|
308
|
-
<span class='type'>(<tt>Symbol</tt>)</span>
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
—
|
313
|
-
<div class='inline'><p>The platform id.</p>
|
314
|
-
</div>
|
315
|
-
|
316
|
-
</li>
|
317
|
-
|
318
|
-
<li>
|
319
|
-
|
320
|
-
<span class='name'>name</span>
|
321
|
-
|
322
|
-
|
323
|
-
<span class='type'>(<tt>String</tt>)</span>
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
—
|
328
|
-
<div class='inline'><p>The platform name.</p>
|
329
|
-
</div>
|
330
|
-
|
331
|
-
</li>
|
332
|
-
|
333
|
-
<li>
|
334
|
-
|
335
|
-
<span class='name'>engine_matcher</span>
|
336
|
-
|
337
|
-
|
338
|
-
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
—
|
343
|
-
<div class='inline'><p>The pattern or the block to recognize the engine.</p>
|
344
|
-
</div>
|
345
|
-
|
346
|
-
</li>
|
347
|
-
|
348
|
-
<li>
|
349
|
-
|
350
|
-
<span class='name'>version_matcher</span>
|
351
|
-
|
352
|
-
|
353
|
-
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
—
|
358
|
-
<div class='inline'><p>The pattern or the block to recognize the version.</p>
|
359
|
-
</div>
|
360
|
-
|
361
|
-
</li>
|
362
|
-
|
363
|
-
</ul>
|
364
|
-
|
365
|
-
|
366
|
-
</div><table class="source_code">
|
367
|
-
<tr>
|
368
|
-
<td>
|
369
|
-
<pre class="lines">
|
370
|
-
|
371
|
-
|
372
|
-
25
|
373
|
-
26
|
374
|
-
27
|
375
|
-
28
|
376
|
-
29
|
377
|
-
30</pre>
|
378
|
-
</td>
|
379
|
-
<td>
|
380
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/browser.rb', line 25</span>
|
381
|
-
|
382
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_id identifier id'>id</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid__ identifier id'>_</span><span class='rparen token'>)</span>
|
383
|
-
<span class='rubyid_@id ivar id'>@id</span> <span class='assign token'>=</span> <span class='rubyid_id identifier id'>id</span>
|
384
|
-
<span class='rubyid_@name ivar id'>@name</span> <span class='assign token'>=</span> <span class='rubyid_name identifier id'>name</span>
|
385
|
-
<span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span> <span class='assign token'>=</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span>
|
386
|
-
<span class='rubyid_@version_matcher ivar id'>@version_matcher</span> <span class='assign token'>=</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span>
|
387
|
-
<span class='rubyid_end end kw'>end</span>
|
388
|
-
</pre>
|
389
|
-
</td>
|
390
|
-
</tr>
|
391
|
-
</table>
|
392
|
-
</div>
|
393
|
-
|
394
|
-
</div>
|
395
|
-
|
396
|
-
<div id="instance_attr_details" class="attr_details">
|
397
|
-
<h2>Instance Attribute Details</h2>
|
398
|
-
|
399
|
-
|
400
|
-
<span id=""></span>
|
401
|
-
<div class="method_details first">
|
402
|
-
<h3 class="signature first" id="engine_matcher-instance_method">
|
403
|
-
|
404
|
-
- (<tt>Regexp|Proc</tt>) <strong>engine_matcher</strong> <span class="extras">(readonly)</span>
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
</h3><div class="docstring">
|
411
|
-
<div class="discussion">
|
412
|
-
<p>Returns The pattern or the block to recognize the engine.</p>
|
413
|
-
|
414
|
-
|
415
|
-
</div>
|
416
|
-
</div>
|
417
|
-
<div class="tags">
|
418
|
-
|
419
|
-
<p class="tag_title">Returns:</p>
|
420
|
-
<ul class="return">
|
421
|
-
|
422
|
-
<li>
|
423
|
-
|
424
|
-
|
425
|
-
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
—
|
430
|
-
<div class='inline'><p>The pattern or the block to recognize the engine.</p>
|
431
|
-
</div>
|
432
|
-
|
433
|
-
</li>
|
434
|
-
|
435
|
-
</ul>
|
436
|
-
|
437
|
-
</div><table class="source_code">
|
438
|
-
<tr>
|
439
|
-
<td>
|
440
|
-
<pre class="lines">
|
441
|
-
|
442
|
-
|
443
|
-
16
|
444
|
-
17
|
445
|
-
18
|
446
|
-
19
|
447
|
-
20
|
448
|
-
21
|
449
|
-
22
|
450
|
-
23
|
451
|
-
24
|
452
|
-
25
|
453
|
-
26
|
454
|
-
27
|
455
|
-
28
|
456
|
-
29
|
457
|
-
30
|
458
|
-
31
|
459
|
-
32
|
460
|
-
33
|
461
|
-
34
|
462
|
-
35
|
463
|
-
36
|
464
|
-
37
|
465
|
-
38
|
466
|
-
39
|
467
|
-
40
|
468
|
-
41
|
469
|
-
42
|
470
|
-
43
|
471
|
-
44
|
472
|
-
45
|
473
|
-
46
|
474
|
-
47
|
475
|
-
48
|
476
|
-
49
|
477
|
-
50
|
478
|
-
51
|
479
|
-
52
|
480
|
-
53
|
481
|
-
54
|
482
|
-
55
|
483
|
-
56
|
484
|
-
57
|
485
|
-
58
|
486
|
-
59
|
487
|
-
60
|
488
|
-
61
|
489
|
-
62
|
490
|
-
63
|
491
|
-
64
|
492
|
-
65
|
493
|
-
66
|
494
|
-
67
|
495
|
-
68
|
496
|
-
69
|
497
|
-
70
|
498
|
-
71
|
499
|
-
72
|
500
|
-
73
|
501
|
-
74
|
502
|
-
75
|
503
|
-
76</pre>
|
504
|
-
</td>
|
505
|
-
<td>
|
506
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/browser.rb', line 16</span>
|
507
|
-
|
508
|
-
<span class='rubyid_class class kw'>class</span> <span class='rubyid_Browser constant id'>Browser</span> <span class='lt op'><</span> <span class='rubyid_Base constant id'>Base</span>
|
509
|
-
<span class='rubyid_attr_reader identifier id'>attr_reader</span> <span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:engine_matcher</span><span class='comma token'>,</span> <span class='symbol val'>:version_matcher</span>
|
510
|
-
|
511
|
-
<span class='comment val'># Creates a new definition.</span>
|
512
|
-
<span class='comment val'>#</span>
|
513
|
-
<span class='comment val'># @param id [Symbol] The platform id.</span>
|
514
|
-
<span class='comment val'># @param name [String] The platform name.</span>
|
515
|
-
<span class='comment val'># @param engine_matcher [Regexp|Proc] The pattern or the block to recognize the engine.</span>
|
516
|
-
<span class='comment val'># @param version_matcher [Regexp|Proc] The pattern or the block to recognize the version.</span>
|
517
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_id identifier id'>id</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid__ identifier id'>_</span><span class='rparen token'>)</span>
|
518
|
-
<span class='rubyid_@id ivar id'>@id</span> <span class='assign token'>=</span> <span class='rubyid_id identifier id'>id</span>
|
519
|
-
<span class='rubyid_@name ivar id'>@name</span> <span class='assign token'>=</span> <span class='rubyid_name identifier id'>name</span>
|
520
|
-
<span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span> <span class='assign token'>=</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span>
|
521
|
-
<span class='rubyid_@version_matcher ivar id'>@version_matcher</span> <span class='assign token'>=</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span>
|
522
|
-
<span class='rubyid_end end kw'>end</span>
|
523
|
-
|
524
|
-
<span class='comment val'># Matches against an header.</span>
|
525
|
-
<span class='comment val'>#</span>
|
526
|
-
<span class='comment val'># @param header [String] The header to match</span>
|
527
|
-
<span class='comment val'># @return [Array|NilClass] An array with the engine and the version if match succeeded, `false` or `nil` otherwise.</span>
|
528
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span>
|
529
|
-
<span class='comment val'># First of all, match the engine</span>
|
530
|
-
<span class='rubyid_engine identifier id'>engine</span> <span class='assign token'>=</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_@id ivar id'>@id</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
531
|
-
|
532
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_engine identifier id'>engine</span>
|
533
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@version_matcher ivar id'>@version_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
534
|
-
<span class='rubyid_platform identifier id'>platform</span> <span class='assign token'>=</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
535
|
-
<span class='lbrack token'>[</span><span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
|
536
|
-
<span class='rubyid_end end kw'>end</span>
|
537
|
-
<span class='rubyid_end end kw'>end</span>
|
538
|
-
|
539
|
-
<span class='rubyid_private identifier id'>private</span>
|
540
|
-
|
541
|
-
<span class='comment val'># :nodoc:</span>
|
542
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_pattern identifier id'>pattern</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
543
|
-
<span class='rubyid_method identifier id'>method</span> <span class='assign token'>=</span> <span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Regexp constant id'>Regexp</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='symbol val'>:match</span> <span class='colon op'>:</span> <span class='symbol val'>:call</span>
|
544
|
-
<span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_method identifier id'>method</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
545
|
-
<span class='rubyid_end end kw'>end</span>
|
546
|
-
|
547
|
-
<span class='comment val'># :nodoc:</span>
|
548
|
-
<span class='comment val'># @private</span>
|
549
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
550
|
-
<span class='comment val'># Adjust version</span>
|
551
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='string val'>"0.0"</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
552
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span><span class='dot token'>.</span><span class='rubyid_last identifier id'>last</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_MatchData constant id'>MatchData</span><span class='rparen token'>)</span>
|
553
|
-
<span class='rubyid_Versionomy constant id'>Versionomy</span><span class='dot token'>.</span><span class='rubyid_parse identifier id'>parse</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
554
|
-
<span class='rubyid_rescue rescue kw'>rescue</span>
|
555
|
-
<span class='rubyid_version identifier id'>version</span>
|
556
|
-
<span class='rubyid_end end kw'>end</span>
|
557
|
-
|
558
|
-
<span class='comment val'># :nodoc:</span>
|
559
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
560
|
-
<span class='rubyid_catch identifier id'>catch</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span>
|
561
|
-
<span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Definitions constant id'>Definitions</span><span class='dot token'>.</span><span class='rubyid_platforms identifier id'>platforms</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_platform identifier id'>platform</span><span class='comma token'>,</span> <span class='rubyid_definition identifier id'>definition</span><span class='bitor op'>|</span>
|
562
|
-
<span class='rubyid_throw identifier id'>throw</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='comma token'>,</span> <span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_definition identifier id'>definition</span><span class='dot token'>.</span><span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
563
|
-
<span class='rubyid_end end kw'>end</span>
|
564
|
-
|
565
|
-
<span class='rubyid_nil nil kw'>nil</span>
|
566
|
-
<span class='rubyid_end end kw'>end</span>
|
567
|
-
<span class='rubyid_end end kw'>end</span>
|
568
|
-
<span class='rubyid_end end kw'>end</span>
|
569
|
-
</pre>
|
570
|
-
</td>
|
571
|
-
</tr>
|
572
|
-
</table>
|
573
|
-
</div>
|
574
|
-
|
575
|
-
|
576
|
-
<span id=""></span>
|
577
|
-
<div class="method_details ">
|
578
|
-
<h3 class="signature " id="name-instance_method">
|
579
|
-
|
580
|
-
- (<tt>String</tt>) <strong>name</strong> <span class="extras">(readonly)</span>
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
</h3><div class="docstring">
|
587
|
-
<div class="discussion">
|
588
|
-
<p>Returns The platform name.</p>
|
589
|
-
|
590
|
-
|
591
|
-
</div>
|
592
|
-
</div>
|
593
|
-
<div class="tags">
|
594
|
-
|
595
|
-
<p class="tag_title">Returns:</p>
|
596
|
-
<ul class="return">
|
597
|
-
|
598
|
-
<li>
|
599
|
-
|
600
|
-
|
601
|
-
<span class='type'>(<tt>String</tt>)</span>
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
—
|
606
|
-
<div class='inline'><p>The platform name.</p>
|
607
|
-
</div>
|
608
|
-
|
609
|
-
</li>
|
610
|
-
|
611
|
-
</ul>
|
612
|
-
|
613
|
-
</div><table class="source_code">
|
614
|
-
<tr>
|
615
|
-
<td>
|
616
|
-
<pre class="lines">
|
617
|
-
|
618
|
-
|
619
|
-
16
|
620
|
-
17
|
621
|
-
18
|
622
|
-
19
|
623
|
-
20
|
624
|
-
21
|
625
|
-
22
|
626
|
-
23
|
627
|
-
24
|
628
|
-
25
|
629
|
-
26
|
630
|
-
27
|
631
|
-
28
|
632
|
-
29
|
633
|
-
30
|
634
|
-
31
|
635
|
-
32
|
636
|
-
33
|
637
|
-
34
|
638
|
-
35
|
639
|
-
36
|
640
|
-
37
|
641
|
-
38
|
642
|
-
39
|
643
|
-
40
|
644
|
-
41
|
645
|
-
42
|
646
|
-
43
|
647
|
-
44
|
648
|
-
45
|
649
|
-
46
|
650
|
-
47
|
651
|
-
48
|
652
|
-
49
|
653
|
-
50
|
654
|
-
51
|
655
|
-
52
|
656
|
-
53
|
657
|
-
54
|
658
|
-
55
|
659
|
-
56
|
660
|
-
57
|
661
|
-
58
|
662
|
-
59
|
663
|
-
60
|
664
|
-
61
|
665
|
-
62
|
666
|
-
63
|
667
|
-
64
|
668
|
-
65
|
669
|
-
66
|
670
|
-
67
|
671
|
-
68
|
672
|
-
69
|
673
|
-
70
|
674
|
-
71
|
675
|
-
72
|
676
|
-
73
|
677
|
-
74
|
678
|
-
75
|
679
|
-
76</pre>
|
680
|
-
</td>
|
681
|
-
<td>
|
682
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/browser.rb', line 16</span>
|
683
|
-
|
684
|
-
<span class='rubyid_class class kw'>class</span> <span class='rubyid_Browser constant id'>Browser</span> <span class='lt op'><</span> <span class='rubyid_Base constant id'>Base</span>
|
685
|
-
<span class='rubyid_attr_reader identifier id'>attr_reader</span> <span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:engine_matcher</span><span class='comma token'>,</span> <span class='symbol val'>:version_matcher</span>
|
686
|
-
|
687
|
-
<span class='comment val'># Creates a new definition.</span>
|
688
|
-
<span class='comment val'>#</span>
|
689
|
-
<span class='comment val'># @param id [Symbol] The platform id.</span>
|
690
|
-
<span class='comment val'># @param name [String] The platform name.</span>
|
691
|
-
<span class='comment val'># @param engine_matcher [Regexp|Proc] The pattern or the block to recognize the engine.</span>
|
692
|
-
<span class='comment val'># @param version_matcher [Regexp|Proc] The pattern or the block to recognize the version.</span>
|
693
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_id identifier id'>id</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid__ identifier id'>_</span><span class='rparen token'>)</span>
|
694
|
-
<span class='rubyid_@id ivar id'>@id</span> <span class='assign token'>=</span> <span class='rubyid_id identifier id'>id</span>
|
695
|
-
<span class='rubyid_@name ivar id'>@name</span> <span class='assign token'>=</span> <span class='rubyid_name identifier id'>name</span>
|
696
|
-
<span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span> <span class='assign token'>=</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span>
|
697
|
-
<span class='rubyid_@version_matcher ivar id'>@version_matcher</span> <span class='assign token'>=</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span>
|
698
|
-
<span class='rubyid_end end kw'>end</span>
|
699
|
-
|
700
|
-
<span class='comment val'># Matches against an header.</span>
|
701
|
-
<span class='comment val'>#</span>
|
702
|
-
<span class='comment val'># @param header [String] The header to match</span>
|
703
|
-
<span class='comment val'># @return [Array|NilClass] An array with the engine and the version if match succeeded, `false` or `nil` otherwise.</span>
|
704
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span>
|
705
|
-
<span class='comment val'># First of all, match the engine</span>
|
706
|
-
<span class='rubyid_engine identifier id'>engine</span> <span class='assign token'>=</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_@id ivar id'>@id</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
707
|
-
|
708
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_engine identifier id'>engine</span>
|
709
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@version_matcher ivar id'>@version_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
710
|
-
<span class='rubyid_platform identifier id'>platform</span> <span class='assign token'>=</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
711
|
-
<span class='lbrack token'>[</span><span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
|
712
|
-
<span class='rubyid_end end kw'>end</span>
|
713
|
-
<span class='rubyid_end end kw'>end</span>
|
714
|
-
|
715
|
-
<span class='rubyid_private identifier id'>private</span>
|
716
|
-
|
717
|
-
<span class='comment val'># :nodoc:</span>
|
718
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_pattern identifier id'>pattern</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
719
|
-
<span class='rubyid_method identifier id'>method</span> <span class='assign token'>=</span> <span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Regexp constant id'>Regexp</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='symbol val'>:match</span> <span class='colon op'>:</span> <span class='symbol val'>:call</span>
|
720
|
-
<span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_method identifier id'>method</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
721
|
-
<span class='rubyid_end end kw'>end</span>
|
722
|
-
|
723
|
-
<span class='comment val'># :nodoc:</span>
|
724
|
-
<span class='comment val'># @private</span>
|
725
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
726
|
-
<span class='comment val'># Adjust version</span>
|
727
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='string val'>"0.0"</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
728
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span><span class='dot token'>.</span><span class='rubyid_last identifier id'>last</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_MatchData constant id'>MatchData</span><span class='rparen token'>)</span>
|
729
|
-
<span class='rubyid_Versionomy constant id'>Versionomy</span><span class='dot token'>.</span><span class='rubyid_parse identifier id'>parse</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
730
|
-
<span class='rubyid_rescue rescue kw'>rescue</span>
|
731
|
-
<span class='rubyid_version identifier id'>version</span>
|
732
|
-
<span class='rubyid_end end kw'>end</span>
|
733
|
-
|
734
|
-
<span class='comment val'># :nodoc:</span>
|
735
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
736
|
-
<span class='rubyid_catch identifier id'>catch</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span>
|
737
|
-
<span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Definitions constant id'>Definitions</span><span class='dot token'>.</span><span class='rubyid_platforms identifier id'>platforms</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_platform identifier id'>platform</span><span class='comma token'>,</span> <span class='rubyid_definition identifier id'>definition</span><span class='bitor op'>|</span>
|
738
|
-
<span class='rubyid_throw identifier id'>throw</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='comma token'>,</span> <span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_definition identifier id'>definition</span><span class='dot token'>.</span><span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
739
|
-
<span class='rubyid_end end kw'>end</span>
|
740
|
-
|
741
|
-
<span class='rubyid_nil nil kw'>nil</span>
|
742
|
-
<span class='rubyid_end end kw'>end</span>
|
743
|
-
<span class='rubyid_end end kw'>end</span>
|
744
|
-
<span class='rubyid_end end kw'>end</span>
|
745
|
-
</pre>
|
746
|
-
</td>
|
747
|
-
</tr>
|
748
|
-
</table>
|
749
|
-
</div>
|
750
|
-
|
751
|
-
|
752
|
-
<span id=""></span>
|
753
|
-
<div class="method_details ">
|
754
|
-
<h3 class="signature " id="version_matcher-instance_method">
|
755
|
-
|
756
|
-
- (<tt>Regexp|Proc</tt>) <strong>version_matcher</strong> <span class="extras">(readonly)</span>
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
</h3><div class="docstring">
|
763
|
-
<div class="discussion">
|
764
|
-
<p>Returns The pattern or the block to recognize the version.</p>
|
765
|
-
|
766
|
-
|
767
|
-
</div>
|
768
|
-
</div>
|
769
|
-
<div class="tags">
|
770
|
-
|
771
|
-
<p class="tag_title">Returns:</p>
|
772
|
-
<ul class="return">
|
773
|
-
|
774
|
-
<li>
|
775
|
-
|
776
|
-
|
777
|
-
<span class='type'>(<tt>Regexp|Proc</tt>)</span>
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
—
|
782
|
-
<div class='inline'><p>The pattern or the block to recognize the version.</p>
|
783
|
-
</div>
|
784
|
-
|
785
|
-
</li>
|
786
|
-
|
787
|
-
</ul>
|
788
|
-
|
789
|
-
</div><table class="source_code">
|
790
|
-
<tr>
|
791
|
-
<td>
|
792
|
-
<pre class="lines">
|
793
|
-
|
794
|
-
|
795
|
-
16
|
796
|
-
17
|
797
|
-
18
|
798
|
-
19
|
799
|
-
20
|
800
|
-
21
|
801
|
-
22
|
802
|
-
23
|
803
|
-
24
|
804
|
-
25
|
805
|
-
26
|
806
|
-
27
|
807
|
-
28
|
808
|
-
29
|
809
|
-
30
|
810
|
-
31
|
811
|
-
32
|
812
|
-
33
|
813
|
-
34
|
814
|
-
35
|
815
|
-
36
|
816
|
-
37
|
817
|
-
38
|
818
|
-
39
|
819
|
-
40
|
820
|
-
41
|
821
|
-
42
|
822
|
-
43
|
823
|
-
44
|
824
|
-
45
|
825
|
-
46
|
826
|
-
47
|
827
|
-
48
|
828
|
-
49
|
829
|
-
50
|
830
|
-
51
|
831
|
-
52
|
832
|
-
53
|
833
|
-
54
|
834
|
-
55
|
835
|
-
56
|
836
|
-
57
|
837
|
-
58
|
838
|
-
59
|
839
|
-
60
|
840
|
-
61
|
841
|
-
62
|
842
|
-
63
|
843
|
-
64
|
844
|
-
65
|
845
|
-
66
|
846
|
-
67
|
847
|
-
68
|
848
|
-
69
|
849
|
-
70
|
850
|
-
71
|
851
|
-
72
|
852
|
-
73
|
853
|
-
74
|
854
|
-
75
|
855
|
-
76</pre>
|
856
|
-
</td>
|
857
|
-
<td>
|
858
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/browser.rb', line 16</span>
|
859
|
-
|
860
|
-
<span class='rubyid_class class kw'>class</span> <span class='rubyid_Browser constant id'>Browser</span> <span class='lt op'><</span> <span class='rubyid_Base constant id'>Base</span>
|
861
|
-
<span class='rubyid_attr_reader identifier id'>attr_reader</span> <span class='symbol val'>:name</span><span class='comma token'>,</span> <span class='symbol val'>:engine_matcher</span><span class='comma token'>,</span> <span class='symbol val'>:version_matcher</span>
|
862
|
-
|
863
|
-
<span class='comment val'># Creates a new definition.</span>
|
864
|
-
<span class='comment val'>#</span>
|
865
|
-
<span class='comment val'># @param id [Symbol] The platform id.</span>
|
866
|
-
<span class='comment val'># @param name [String] The platform name.</span>
|
867
|
-
<span class='comment val'># @param engine_matcher [Regexp|Proc] The pattern or the block to recognize the engine.</span>
|
868
|
-
<span class='comment val'># @param version_matcher [Regexp|Proc] The pattern or the block to recognize the version.</span>
|
869
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_id identifier id'>id</span><span class='comma token'>,</span> <span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid__ identifier id'>_</span><span class='rparen token'>)</span>
|
870
|
-
<span class='rubyid_@id ivar id'>@id</span> <span class='assign token'>=</span> <span class='rubyid_id identifier id'>id</span>
|
871
|
-
<span class='rubyid_@name ivar id'>@name</span> <span class='assign token'>=</span> <span class='rubyid_name identifier id'>name</span>
|
872
|
-
<span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span> <span class='assign token'>=</span> <span class='rubyid_engine_matcher identifier id'>engine_matcher</span>
|
873
|
-
<span class='rubyid_@version_matcher ivar id'>@version_matcher</span> <span class='assign token'>=</span> <span class='rubyid_version_matcher identifier id'>version_matcher</span>
|
874
|
-
<span class='rubyid_end end kw'>end</span>
|
875
|
-
|
876
|
-
<span class='comment val'># Matches against an header.</span>
|
877
|
-
<span class='comment val'>#</span>
|
878
|
-
<span class='comment val'># @param header [String] The header to match</span>
|
879
|
-
<span class='comment val'># @return [Array|NilClass] An array with the engine and the version if match succeeded, `false` or `nil` otherwise.</span>
|
880
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span>
|
881
|
-
<span class='comment val'># First of all, match the engine</span>
|
882
|
-
<span class='rubyid_engine identifier id'>engine</span> <span class='assign token'>=</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_@id ivar id'>@id</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
883
|
-
|
884
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_engine identifier id'>engine</span>
|
885
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@version_matcher ivar id'>@version_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
886
|
-
<span class='rubyid_platform identifier id'>platform</span> <span class='assign token'>=</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
887
|
-
<span class='lbrack token'>[</span><span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
|
888
|
-
<span class='rubyid_end end kw'>end</span>
|
889
|
-
<span class='rubyid_end end kw'>end</span>
|
890
|
-
|
891
|
-
<span class='rubyid_private identifier id'>private</span>
|
892
|
-
|
893
|
-
<span class='comment val'># :nodoc:</span>
|
894
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_pattern identifier id'>pattern</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
895
|
-
<span class='rubyid_method identifier id'>method</span> <span class='assign token'>=</span> <span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_Regexp constant id'>Regexp</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='symbol val'>:match</span> <span class='colon op'>:</span> <span class='symbol val'>:call</span>
|
896
|
-
<span class='rubyid_pattern identifier id'>pattern</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_method identifier id'>method</span><span class='comma token'>,</span> <span class='rubyid_subject identifier id'>subject</span><span class='rparen token'>)</span>
|
897
|
-
<span class='rubyid_end end kw'>end</span>
|
898
|
-
|
899
|
-
<span class='comment val'># :nodoc:</span>
|
900
|
-
<span class='comment val'># @private</span>
|
901
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
902
|
-
<span class='comment val'># Adjust version</span>
|
903
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='string val'>"0.0"</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_blank? fid id'>blank?</span>
|
904
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span><span class='dot token'>.</span><span class='rubyid_last identifier id'>last</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_version identifier id'>version</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='rubyid_MatchData constant id'>MatchData</span><span class='rparen token'>)</span>
|
905
|
-
<span class='rubyid_Versionomy constant id'>Versionomy</span><span class='dot token'>.</span><span class='rubyid_parse identifier id'>parse</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span>
|
906
|
-
<span class='rubyid_rescue rescue kw'>rescue</span>
|
907
|
-
<span class='rubyid_version identifier id'>version</span>
|
908
|
-
<span class='rubyid_end end kw'>end</span>
|
909
|
-
|
910
|
-
<span class='comment val'># :nodoc:</span>
|
911
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
912
|
-
<span class='rubyid_catch identifier id'>catch</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span>
|
913
|
-
<span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Definitions constant id'>Definitions</span><span class='dot token'>.</span><span class='rubyid_platforms identifier id'>platforms</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_platform identifier id'>platform</span><span class='comma token'>,</span> <span class='rubyid_definition identifier id'>definition</span><span class='bitor op'>|</span>
|
914
|
-
<span class='rubyid_throw identifier id'>throw</span><span class='lparen token'>(</span><span class='symbol val'>:result</span><span class='comma token'>,</span> <span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_definition identifier id'>definition</span><span class='dot token'>.</span><span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
915
|
-
<span class='rubyid_end end kw'>end</span>
|
916
|
-
|
917
|
-
<span class='rubyid_nil nil kw'>nil</span>
|
918
|
-
<span class='rubyid_end end kw'>end</span>
|
919
|
-
<span class='rubyid_end end kw'>end</span>
|
920
|
-
<span class='rubyid_end end kw'>end</span>
|
921
|
-
</pre>
|
922
|
-
</td>
|
923
|
-
</tr>
|
924
|
-
</table>
|
925
|
-
</div>
|
926
|
-
|
927
|
-
</div>
|
928
|
-
|
929
|
-
|
930
|
-
<div id="instance_method_details" class="method_details_list">
|
931
|
-
<h2>Instance Method Details</h2>
|
932
|
-
|
933
|
-
|
934
|
-
<div class="method_details first">
|
935
|
-
<h3 class="signature first" id="match-instance_method">
|
936
|
-
|
937
|
-
- (<tt>Array|NilClass</tt>) <strong>match</strong>(header)
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
</h3><div class="docstring">
|
944
|
-
<div class="discussion">
|
945
|
-
<p>Matches against an header.</p>
|
946
|
-
|
947
|
-
|
948
|
-
</div>
|
949
|
-
</div>
|
950
|
-
<div class="tags">
|
951
|
-
<p class="tag_title">Parameters:</p>
|
952
|
-
<ul class="param">
|
953
|
-
|
954
|
-
<li>
|
955
|
-
|
956
|
-
<span class='name'>header</span>
|
957
|
-
|
958
|
-
|
959
|
-
<span class='type'>(<tt>String</tt>)</span>
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
—
|
964
|
-
<div class='inline'><p>The header to match</p>
|
965
|
-
</div>
|
966
|
-
|
967
|
-
</li>
|
968
|
-
|
969
|
-
</ul>
|
970
|
-
|
971
|
-
<p class="tag_title">Returns:</p>
|
972
|
-
<ul class="return">
|
973
|
-
|
974
|
-
<li>
|
975
|
-
|
976
|
-
|
977
|
-
<span class='type'>(<tt>Array|NilClass</tt>)</span>
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
—
|
982
|
-
<div class='inline'><p>An array with the engine and the version if match succeeded, <code>false</code> or <code>nil</code> otherwise.</p>
|
983
|
-
</div>
|
984
|
-
|
985
|
-
</li>
|
986
|
-
|
987
|
-
</ul>
|
988
|
-
|
989
|
-
</div><table class="source_code">
|
990
|
-
<tr>
|
991
|
-
<td>
|
992
|
-
<pre class="lines">
|
993
|
-
|
994
|
-
|
995
|
-
36
|
996
|
-
37
|
997
|
-
38
|
998
|
-
39
|
999
|
-
40
|
1000
|
-
41
|
1001
|
-
42
|
1002
|
-
43
|
1003
|
-
44
|
1004
|
-
45</pre>
|
1005
|
-
</td>
|
1006
|
-
<td>
|
1007
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/definitions/browser.rb', line 36</span>
|
1008
|
-
|
1009
|
-
<span class='rubyid_def def kw'>def</span> <span class='rubyid_match identifier id'>match</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span>
|
1010
|
-
<span class='comment val'># First of all, match the engine</span>
|
1011
|
-
<span class='rubyid_engine identifier id'>engine</span> <span class='assign token'>=</span> <span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@engine_matcher ivar id'>@engine_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_@id ivar id'>@id</span> <span class='colon op'>:</span> <span class='rubyid_nil nil kw'>nil</span>
|
1012
|
-
|
1013
|
-
<span class='rubyid_if if kw'>if</span> <span class='rubyid_engine identifier id'>engine</span>
|
1014
|
-
<span class='rubyid_version identifier id'>version</span> <span class='assign token'>=</span> <span class='rubyid_extract_version identifier id'>extract_version</span><span class='lparen token'>(</span><span class='rubyid_perform_match identifier id'>perform_match</span><span class='lparen token'>(</span><span class='rubyid_@version_matcher ivar id'>@version_matcher</span><span class='comma token'>,</span> <span class='rubyid_header identifier id'>header</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
1015
|
-
<span class='rubyid_platform identifier id'>platform</span> <span class='assign token'>=</span> <span class='rubyid_extract_platform identifier id'>extract_platform</span><span class='lparen token'>(</span><span class='rubyid_header identifier id'>header</span><span class='comma token'>,</span> <span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span>
|
1016
|
-
<span class='lbrack token'>[</span><span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_engine identifier id'>engine</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_Brauser constant id'>Brauser</span><span class='colon2 op'>::</span><span class='rubyid_Value constant id'>Value</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_platform identifier id'>platform</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
|
1017
|
-
<span class='rubyid_end end kw'>end</span>
|
1018
|
-
<span class='rubyid_end end kw'>end</span>
|
1019
|
-
</pre>
|
1020
|
-
</td>
|
1021
|
-
</tr>
|
1022
|
-
</table>
|
1023
|
-
</div>
|
1024
|
-
|
1025
|
-
</div>
|
1026
|
-
|
1027
|
-
</div>
|
1028
|
-
|
1029
|
-
<div id="footer">
|
1030
|
-
Generated on Tue Mar 29 11:20:20 2016 by
|
1031
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1032
|
-
0.8.7.6 (ruby-2.3.0).
|
1033
|
-
</div>
|
1034
|
-
|
1035
|
-
</body>
|
1036
|
-
</html>
|