brauser 2.0.3 → 2.1.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.
- data/README.md +1 -1
- data/brauser.gemspec +1 -1
- data/doc/Brauser.html +1 -1
- data/doc/Brauser/Browser.html +37 -37
- data/doc/Brauser/BrowserMethods.html +1 -1
- data/doc/Brauser/BrowserMethods/Attributes.html +11 -11
- data/doc/Brauser/BrowserMethods/General.html +1 -1
- data/doc/Brauser/BrowserMethods/General/ClassMethods.html +13 -13
- data/doc/Brauser/BrowserMethods/Parsing.html +8 -8
- data/doc/Brauser/BrowserMethods/PartialQuerying.html +17 -19
- data/doc/Brauser/BrowserMethods/Querying.html +19 -19
- data/doc/Brauser/BrowserMethods/Register.html +1 -1
- data/doc/Brauser/BrowserMethods/Register/ClassMethods.html +12 -14
- data/doc/Brauser/Hooks.html +1 -1
- data/doc/Brauser/Hooks/RubyOnRails.html +1 -1
- data/doc/Brauser/Query.html +9 -9
- data/doc/Brauser/Version.html +3 -3
- data/doc/_index.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/top-level-namespace.html +1 -1
- data/lib/brauser/browser.rb +12 -14
- data/lib/brauser/query.rb +2 -2
- data/lib/brauser/version.rb +2 -2
- metadata +5 -5
data/README.md
CHANGED
@@ -97,7 +97,7 @@ browser.is?("< 2 && > 1")
|
|
97
97
|
# => true
|
98
98
|
```
|
99
99
|
|
100
|
-
The method `on` check is the current browser in one of the
|
100
|
+
The method `on` check is the current browser in one of the specified platform. The platform should be passed as `Symbol`.
|
101
101
|
|
102
102
|
```ruby
|
103
103
|
browser.on?(:osx)
|
data/brauser.gemspec
CHANGED
data/doc/Brauser.html
CHANGED
@@ -120,7 +120,7 @@
|
|
120
120
|
</div>
|
121
121
|
|
122
122
|
<div id="footer">
|
123
|
-
Generated on
|
123
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
124
124
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
125
125
|
0.8.5.2 (ruby-1.9.3).
|
126
126
|
</div>
|
data/doc/Brauser/Browser.html
CHANGED
@@ -489,6 +489,8 @@
|
|
489
489
|
<pre class="lines">
|
490
490
|
|
491
491
|
|
492
|
+
749
|
493
|
+
750
|
492
494
|
751
|
493
495
|
752
|
494
496
|
753
|
@@ -497,12 +499,10 @@
|
|
497
499
|
756
|
498
500
|
757
|
499
501
|
758
|
500
|
-
759
|
501
|
-
760
|
502
|
-
761</pre>
|
502
|
+
759</pre>
|
503
503
|
</td>
|
504
504
|
<td>
|
505
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
505
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 749</span>
|
506
506
|
|
507
507
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_accept_language'>accept_language</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
508
508
|
<span class='op'>::</span><span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_register_default_browsers'>register_default_browsers</span>
|
@@ -630,18 +630,18 @@ browser.is_msie_gt_4_1__on_windows?
|
|
630
630
|
<pre class="lines">
|
631
631
|
|
632
632
|
|
633
|
+
778
|
634
|
+
779
|
633
635
|
780
|
634
636
|
781
|
635
637
|
782
|
636
638
|
783
|
637
639
|
784
|
638
640
|
785
|
639
|
-
786
|
640
|
-
787
|
641
|
-
788</pre>
|
641
|
+
786</pre>
|
642
642
|
</td>
|
643
643
|
<td>
|
644
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
644
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 778</span>
|
645
645
|
|
646
646
|
<span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
647
647
|
<span class='kw'>begin</span>
|
@@ -706,6 +706,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
706
706
|
<pre class="lines">
|
707
707
|
|
708
708
|
|
709
|
+
726
|
710
|
+
727
|
709
711
|
728
|
710
712
|
729
|
711
713
|
730
|
@@ -828,12 +830,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
828
830
|
847
|
829
831
|
848
|
830
832
|
849
|
831
|
-
850
|
832
|
-
851
|
833
|
-
852</pre>
|
833
|
+
850</pre>
|
834
834
|
</td>
|
835
835
|
<td>
|
836
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
836
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
837
837
|
|
838
838
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
839
839
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -1013,6 +1013,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1013
1013
|
<pre class="lines">
|
1014
1014
|
|
1015
1015
|
|
1016
|
+
726
|
1017
|
+
727
|
1016
1018
|
728
|
1017
1019
|
729
|
1018
1020
|
730
|
@@ -1135,12 +1137,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1135
1137
|
847
|
1136
1138
|
848
|
1137
1139
|
849
|
1138
|
-
850
|
1139
|
-
851
|
1140
|
-
852</pre>
|
1140
|
+
850</pre>
|
1141
1141
|
</td>
|
1142
1142
|
<td>
|
1143
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
1143
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
1144
1144
|
|
1145
1145
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
1146
1146
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -1316,6 +1316,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1316
1316
|
<pre class="lines">
|
1317
1317
|
|
1318
1318
|
|
1319
|
+
726
|
1320
|
+
727
|
1319
1321
|
728
|
1320
1322
|
729
|
1321
1323
|
730
|
@@ -1438,12 +1440,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1438
1440
|
847
|
1439
1441
|
848
|
1440
1442
|
849
|
1441
|
-
850
|
1442
|
-
851
|
1443
|
-
852</pre>
|
1443
|
+
850</pre>
|
1444
1444
|
</td>
|
1445
1445
|
<td>
|
1446
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
1446
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
1447
1447
|
|
1448
1448
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
1449
1449
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -1619,6 +1619,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1619
1619
|
<pre class="lines">
|
1620
1620
|
|
1621
1621
|
|
1622
|
+
726
|
1623
|
+
727
|
1622
1624
|
728
|
1623
1625
|
729
|
1624
1626
|
730
|
@@ -1741,12 +1743,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1741
1743
|
847
|
1742
1744
|
848
|
1743
1745
|
849
|
1744
|
-
850
|
1745
|
-
851
|
1746
|
-
852</pre>
|
1746
|
+
850</pre>
|
1747
1747
|
</td>
|
1748
1748
|
<td>
|
1749
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
1749
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
1750
1750
|
|
1751
1751
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
1752
1752
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -1922,6 +1922,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
1922
1922
|
<pre class="lines">
|
1923
1923
|
|
1924
1924
|
|
1925
|
+
726
|
1926
|
+
727
|
1925
1927
|
728
|
1926
1928
|
729
|
1927
1929
|
730
|
@@ -2044,12 +2046,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
2044
2046
|
847
|
2045
2047
|
848
|
2046
2048
|
849
|
2047
|
-
850
|
2048
|
-
851
|
2049
|
-
852</pre>
|
2049
|
+
850</pre>
|
2050
2050
|
</td>
|
2051
2051
|
<td>
|
2052
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
2052
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
2053
2053
|
|
2054
2054
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
2055
2055
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -2225,6 +2225,8 @@ browser.is_msie_gt_4_1__on_windows?
|
|
2225
2225
|
<pre class="lines">
|
2226
2226
|
|
2227
2227
|
|
2228
|
+
726
|
2229
|
+
727
|
2228
2230
|
728
|
2229
2231
|
729
|
2230
2232
|
730
|
@@ -2347,12 +2349,10 @@ browser.is_msie_gt_4_1__on_windows?
|
|
2347
2349
|
847
|
2348
2350
|
848
|
2349
2351
|
849
|
2350
|
-
850
|
2351
|
-
851
|
2352
|
-
852</pre>
|
2352
|
+
850</pre>
|
2353
2353
|
</td>
|
2354
2354
|
<td>
|
2355
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
2355
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 726</span>
|
2356
2356
|
|
2357
2357
|
<span class='kw'>class</span> <span class='const'>Browser</span>
|
2358
2358
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:agent</span>
|
@@ -2540,12 +2540,12 @@ browser.is_msie_gt_4_1__on_windows?
|
|
2540
2540
|
<pre class="lines">
|
2541
2541
|
|
2542
2542
|
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2543
|
+
793
|
2544
|
+
794
|
2545
|
+
795</pre>
|
2546
2546
|
</td>
|
2547
2547
|
<td>
|
2548
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
2548
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 793</span>
|
2549
2549
|
|
2550
2550
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
2551
2551
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_classes'>classes</span>
|
@@ -2560,7 +2560,7 @@ browser.is_msie_gt_4_1__on_windows?
|
|
2560
2560
|
</div>
|
2561
2561
|
|
2562
2562
|
<div id="footer">
|
2563
|
-
Generated on
|
2563
|
+
Generated on Fri Mar 1 17:26:26 2013 by
|
2564
2564
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2565
2565
|
0.8.5.2 (ruby-1.9.3).
|
2566
2566
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.5.2 (ruby-1.9.3).
|
122
122
|
</div>
|
@@ -334,17 +334,17 @@
|
|
334
334
|
<pre class="lines">
|
335
335
|
|
336
336
|
|
337
|
+
442
|
337
338
|
443
|
338
339
|
444
|
339
340
|
445
|
340
|
-
446
|
341
|
-
447</pre>
|
341
|
+
446</pre>
|
342
342
|
</td>
|
343
343
|
<td>
|
344
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
344
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 442</span>
|
345
345
|
|
346
346
|
<span class='kw'>def</span> <span class='id identifier rubyid_classes'>classes</span><span class='lparen'>(</span><span class='id identifier rubyid_join'>join</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_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>version-</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>platform-</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
347
|
-
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>platform-</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_platform'>platform</span
|
347
|
+
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>platform-</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_platform'>platform</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>TrueClass</span><span class='rparen'>)</span>
|
348
348
|
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_stringify_name'>stringify_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_stringify_version'>stringify_version</span><span class='lparen'>(</span><span class='id identifier rubyid_version'>version</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='op'>!</span><span class='id identifier rubyid_platform'>platform</span> <span class='op'>?</span> <span class='kw'>nil</span> <span class='op'>:</span> <span class='lparen'>(</span><span class='id identifier rubyid_platform'>platform</span> <span class='op'>+</span> <span class='ivar'>@platform</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
349
349
|
<span class='id identifier rubyid_join'>join</span> <span class='op'>?</span> <span class='id identifier rubyid_rv'>rv</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_join'>join</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_rv'>rv</span>
|
350
350
|
<span class='kw'>end</span></pre>
|
@@ -395,13 +395,13 @@
|
|
395
395
|
<pre class="lines">
|
396
396
|
|
397
397
|
|
398
|
+
421
|
398
399
|
422
|
399
400
|
423
|
400
|
-
424
|
401
|
-
425</pre>
|
401
|
+
424</pre>
|
402
402
|
</td>
|
403
403
|
<td>
|
404
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
404
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 421</span>
|
405
405
|
|
406
406
|
<span class='kw'>def</span> <span class='id identifier rubyid_platform_name'>platform_name</span>
|
407
407
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@platform</span>
|
@@ -454,13 +454,13 @@
|
|
454
454
|
<pre class="lines">
|
455
455
|
|
456
456
|
|
457
|
+
413
|
457
458
|
414
|
458
459
|
415
|
459
|
-
416
|
460
|
-
417</pre>
|
460
|
+
416</pre>
|
461
461
|
</td>
|
462
462
|
<td>
|
463
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
463
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 413</span>
|
464
464
|
|
465
465
|
<span class='kw'>def</span> <span class='id identifier rubyid_readable_name'>readable_name</span>
|
466
466
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@name</span>
|
@@ -476,7 +476,7 @@
|
|
476
476
|
</div>
|
477
477
|
|
478
478
|
<div id="footer">
|
479
|
-
Generated on
|
479
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
480
480
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
481
481
|
0.8.5.2 (ruby-1.9.3).
|
482
482
|
</div>
|
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on
|
128
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.5.2 (ruby-1.9.3).
|
131
131
|
</div>
|
@@ -254,12 +254,12 @@
|
|
254
254
|
<pre class="lines">
|
255
255
|
|
256
256
|
|
257
|
+
319
|
257
258
|
320
|
258
|
-
321
|
259
|
-
322</pre>
|
259
|
+
321</pre>
|
260
260
|
</td>
|
261
261
|
<td>
|
262
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
262
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 319</span>
|
263
263
|
|
264
264
|
<span class='kw'>def</span> <span class='id identifier rubyid_browsers'>browsers</span>
|
265
265
|
<span class='id identifier rubyid_registered_to_hash'>registered_to_hash</span><span class='lparen'>(</span><span class='ivar'>@browsers</span><span class='rparen'>)</span>
|
@@ -366,6 +366,7 @@
|
|
366
366
|
<pre class="lines">
|
367
367
|
|
368
368
|
|
369
|
+
347
|
369
370
|
348
|
370
371
|
349
|
371
372
|
350
|
@@ -375,11 +376,10 @@
|
|
375
376
|
354
|
376
377
|
355
|
377
378
|
356
|
378
|
-
357
|
379
|
-
358</pre>
|
379
|
+
357</pre>
|
380
380
|
</td>
|
381
381
|
<td>
|
382
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
382
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 347</span>
|
383
383
|
|
384
384
|
<span class='kw'>def</span> <span class='id identifier rubyid_compare_versions'>compare_versions</span><span class='lparen'>(</span><span class='id identifier rubyid_v1'>v1</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_operator'>operator</span> <span class='op'>=</span> <span class='symbol'>:eq</span><span class='comma'>,</span> <span class='id identifier rubyid_v2'>v2</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
385
385
|
<span class='id identifier rubyid_valid_results'>valid_results</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>lt:</span> <span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>lte:</span> <span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>eq:</span> <span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>gte:</span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>gt:</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_operator'>operator</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -441,12 +441,12 @@
|
|
441
441
|
<pre class="lines">
|
442
442
|
|
443
443
|
|
444
|
+
337
|
444
445
|
338
|
445
|
-
339
|
446
|
-
340</pre>
|
446
|
+
339</pre>
|
447
447
|
</td>
|
448
448
|
<td>
|
449
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
449
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 337</span>
|
450
450
|
|
451
451
|
<span class='kw'>def</span> <span class='id identifier rubyid_languages'>languages</span>
|
452
452
|
<span class='ivar'>@languages</span>
|
@@ -500,12 +500,12 @@
|
|
500
500
|
<pre class="lines">
|
501
501
|
|
502
502
|
|
503
|
+
328
|
503
504
|
329
|
504
|
-
330
|
505
|
-
331</pre>
|
505
|
+
330</pre>
|
506
506
|
</td>
|
507
507
|
<td>
|
508
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
508
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 328</span>
|
509
509
|
|
510
510
|
<span class='kw'>def</span> <span class='id identifier rubyid_platforms'>platforms</span>
|
511
511
|
<span class='id identifier rubyid_registered_to_hash'>registered_to_hash</span><span class='lparen'>(</span><span class='ivar'>@platforms</span><span class='rparen'>)</span>
|
@@ -520,7 +520,7 @@
|
|
520
520
|
</div>
|
521
521
|
|
522
522
|
<div id="footer">
|
523
|
-
Generated on
|
523
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
524
524
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
525
525
|
0.8.5.2 (ruby-1.9.3).
|
526
526
|
</div>
|
@@ -231,12 +231,12 @@
|
|
231
231
|
<pre class="lines">
|
232
232
|
|
233
233
|
|
234
|
+
499
|
234
235
|
500
|
235
|
-
501
|
236
|
-
502</pre>
|
236
|
+
501</pre>
|
237
237
|
</td>
|
238
238
|
<td>
|
239
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
239
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 499</span>
|
240
240
|
|
241
241
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_accept_language'>parse_accept_language</span><span class='lparen'>(</span><span class='id identifier rubyid_accept_language'>accept_language</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
242
242
|
<span class='id identifier rubyid_accept_language'>accept_language</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>;q=[\d.]+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</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><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='rbrace'>}</span>
|
@@ -309,6 +309,7 @@
|
|
309
309
|
<pre class="lines">
|
310
310
|
|
311
311
|
|
312
|
+
485
|
312
313
|
486
|
313
314
|
487
|
314
315
|
488
|
@@ -316,16 +317,15 @@
|
|
316
317
|
490
|
317
318
|
491
|
318
319
|
492
|
319
|
-
493
|
320
|
-
494</pre>
|
320
|
+
493</pre>
|
321
321
|
</td>
|
322
322
|
<td>
|
323
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
323
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 485</span>
|
324
324
|
|
325
325
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
326
326
|
<span class='id identifier rubyid_agent'>agent</span> <span class='op'>=</span> <span class='id identifier rubyid_agent'>agent</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
327
327
|
|
328
|
-
<span class='ivar'>@name</span><span class='comma'>,</span> <span class='id identifier
|
328
|
+
<span class='ivar'>@name</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='id identifier rubyid_match_name_and_version'>match_name_and_version</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span><span class='rparen'>)</span>
|
329
329
|
<span class='ivar'>@version</span> <span class='op'>=</span> <span class='id identifier rubyid_adjust_version'>adjust_version</span><span class='lparen'>(</span><span class='ivar'>@version</span><span class='rparen'>)</span>
|
330
330
|
<span class='ivar'>@platform</span> <span class='op'>=</span> <span class='id identifier rubyid_match_platform'>match_platform</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span><span class='rparen'>)</span>
|
331
331
|
|
@@ -341,7 +341,7 @@
|
|
341
341
|
</div>
|
342
342
|
|
343
343
|
<div id="footer">
|
344
|
-
Generated on
|
344
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
345
345
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
346
346
|
0.8.5.2 (ruby-1.9.3).
|
347
347
|
</div>
|
@@ -199,7 +199,7 @@
|
|
199
199
|
|
200
200
|
|
201
201
|
|
202
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the
|
202
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
203
203
|
</div></span>
|
204
204
|
|
205
205
|
</li>
|
@@ -277,13 +277,13 @@
|
|
277
277
|
<pre class="lines">
|
278
278
|
|
279
279
|
|
280
|
+
621
|
281
|
+
622
|
280
282
|
623
|
281
|
-
624
|
282
|
-
625
|
283
|
-
626</pre>
|
283
|
+
624</pre>
|
284
284
|
</td>
|
285
285
|
<td>
|
286
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
286
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 621</span>
|
287
287
|
|
288
288
|
<span class='kw'>def</span> <span class='id identifier rubyid_accepts'>accepts</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
289
289
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_accept_language'>parse_accept_language</span><span class='lparen'>(</span><span class='ivar'>@accept_language</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@languages</span>
|
@@ -400,6 +400,7 @@
|
|
400
400
|
<pre class="lines">
|
401
401
|
|
402
402
|
|
403
|
+
576
|
403
404
|
577
|
404
405
|
578
|
405
406
|
579
|
@@ -411,11 +412,10 @@
|
|
411
412
|
585
|
412
413
|
586
|
413
414
|
587
|
414
|
-
588
|
415
|
-
589</pre>
|
415
|
+
588</pre>
|
416
416
|
</td>
|
417
417
|
<td>
|
418
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
418
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 576</span>
|
419
419
|
|
420
420
|
<span class='kw'>def</span> <span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
421
421
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@name</span>
|
@@ -498,13 +498,13 @@
|
|
498
498
|
<pre class="lines">
|
499
499
|
|
500
500
|
|
501
|
+
612
|
502
|
+
613
|
501
503
|
614
|
502
|
-
615
|
503
|
-
616
|
504
|
-
617</pre>
|
504
|
+
615</pre>
|
505
505
|
</td>
|
506
506
|
<td>
|
507
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
507
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 612</span>
|
508
508
|
|
509
509
|
<span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
510
510
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@platform</span>
|
@@ -526,7 +526,7 @@
|
|
526
526
|
|
527
527
|
</h3><div class="docstring">
|
528
528
|
<div class="discussion">
|
529
|
-
<p>Checks if the
|
529
|
+
<p>Checks if the browser is a specific version.</p>
|
530
530
|
|
531
531
|
|
532
532
|
</div>
|
@@ -578,6 +578,7 @@
|
|
578
578
|
<pre class="lines">
|
579
579
|
|
580
580
|
|
581
|
+
594
|
581
582
|
595
|
582
583
|
596
|
583
584
|
597
|
@@ -589,16 +590,13 @@
|
|
589
590
|
603
|
590
591
|
604
|
591
592
|
605
|
592
|
-
606
|
593
|
-
607
|
594
|
-
608</pre>
|
593
|
+
606</pre>
|
595
594
|
</td>
|
596
595
|
<td>
|
597
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
596
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 594</span>
|
598
597
|
|
599
598
|
<span class='kw'>def</span> <span class='id identifier rubyid_v'>v</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
600
599
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@version</span>
|
601
|
-
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>true</span>
|
602
600
|
|
603
601
|
<span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_versions'>versions</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
604
602
|
<span class='id identifier rubyid_parse_versions_query'>parse_versions_query</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
@@ -620,7 +618,7 @@
|
|
620
618
|
</div>
|
621
619
|
|
622
620
|
<div id="footer">
|
623
|
-
Generated on
|
621
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
624
622
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
625
623
|
0.8.5.2 (ruby-1.9.3).
|
626
624
|
</div>
|
@@ -199,7 +199,7 @@
|
|
199
199
|
|
200
200
|
|
201
201
|
|
202
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the
|
202
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
203
203
|
</div></span>
|
204
204
|
|
205
205
|
</li>
|
@@ -277,12 +277,12 @@
|
|
277
277
|
<pre class="lines">
|
278
278
|
|
279
279
|
|
280
|
-
|
281
|
-
|
282
|
-
|
280
|
+
706
|
281
|
+
707
|
282
|
+
708</pre>
|
283
283
|
</td>
|
284
284
|
<td>
|
285
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
285
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 706</span>
|
286
286
|
|
287
287
|
<span class='kw'>def</span> <span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
288
288
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_accepts'>accepts</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span>
|
@@ -398,12 +398,12 @@
|
|
398
398
|
<pre class="lines">
|
399
399
|
|
400
400
|
|
401
|
-
|
402
|
-
|
403
|
-
|
401
|
+
682
|
402
|
+
683
|
403
|
+
684</pre>
|
404
404
|
</td>
|
405
405
|
<td>
|
406
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
406
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 682</span>
|
407
407
|
|
408
408
|
<span class='kw'>def</span> <span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
409
409
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span>
|
@@ -476,12 +476,12 @@
|
|
476
476
|
<pre class="lines">
|
477
477
|
|
478
478
|
|
479
|
-
|
480
|
-
|
481
|
-
|
479
|
+
698
|
480
|
+
699
|
481
|
+
700</pre>
|
482
482
|
</td>
|
483
483
|
<td>
|
484
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
484
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 698</span>
|
485
485
|
|
486
486
|
<span class='kw'>def</span> <span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
487
487
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span>
|
@@ -502,7 +502,7 @@
|
|
502
502
|
|
503
503
|
</h3><div class="docstring">
|
504
504
|
<div class="discussion">
|
505
|
-
<p>Checks if the
|
505
|
+
<p>Checks if the browser is a specific version.</p>
|
506
506
|
|
507
507
|
|
508
508
|
</div>
|
@@ -554,12 +554,12 @@
|
|
554
554
|
<pre class="lines">
|
555
555
|
|
556
556
|
|
557
|
-
|
558
|
-
|
559
|
-
|
557
|
+
690
|
558
|
+
691
|
559
|
+
692</pre>
|
560
560
|
</td>
|
561
561
|
<td>
|
562
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
562
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 690</span>
|
563
563
|
|
564
564
|
<span class='kw'>def</span> <span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
565
565
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_v'>v</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span>
|
@@ -574,7 +574,7 @@
|
|
574
574
|
</div>
|
575
575
|
|
576
576
|
<div id="footer">
|
577
|
-
Generated on
|
577
|
+
Generated on Fri Mar 1 17:26:26 2013 by
|
578
578
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
579
579
|
0.8.5.2 (ruby-1.9.3).
|
580
580
|
</div>
|
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on
|
128
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.5.2 (ruby-1.9.3).
|
131
131
|
</div>
|
@@ -368,13 +368,13 @@
|
|
368
368
|
<pre class="lines">
|
369
369
|
|
370
370
|
|
371
|
+
186
|
371
372
|
187
|
372
373
|
188
|
373
|
-
189
|
374
|
-
190</pre>
|
374
|
+
189</pre>
|
375
375
|
</td>
|
376
376
|
<td>
|
377
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
377
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 186</span>
|
378
378
|
|
379
379
|
<span class='kw'>def</span> <span class='id identifier rubyid_register_browser'>register_browser</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_name_match'>name_match</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_version_match'>version_match</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
380
380
|
<span class='ivar'>@browsers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -614,8 +614,7 @@
|
|
614
614
|
174
|
615
615
|
175
|
616
616
|
176
|
617
|
-
177
|
618
|
-
178</pre>
|
617
|
+
177</pre>
|
619
618
|
</td>
|
620
619
|
<td>
|
621
620
|
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 57</span>
|
@@ -700,7 +699,6 @@
|
|
700
699
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ro-mo</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Romanian/Moldavia</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
701
700
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ru</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Russian</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
702
701
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ru-mo</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Russian /Moldavia</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
703
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>gd</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Scots Gaelic</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
704
702
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sr</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Serbian</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
705
703
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sk</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Slovack</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
706
704
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sl</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Slovenian</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
@@ -820,7 +818,7 @@
|
|
820
818
|
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register_platform'>register_platform</span><span class='lparen'>(</span><span class='lbracket'>[</span>
|
821
819
|
<span class='lbracket'>[</span><span class='symbol'>:symbian</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>s60|symb</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Symbian</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
822
820
|
<span class='lbracket'>[</span><span class='symbol'>:windows_phone</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>windows phone</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Microsoft Windows Phone</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
823
|
-
<span class='lbracket'>[</span><span class='symbol'>:kindle</span><span class='comma'>,</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier
|
821
|
+
<span class='lbracket'>[</span><span class='symbol'>:kindle</span><span class='comma'>,</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>==</span> <span class='symbol'>:kindle</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Nokia Symbian</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
824
822
|
<span class='lbracket'>[</span><span class='symbol'>:ios</span><span class='comma'>,</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_agent'>agent</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='symbol'>:iphone</span><span class='comma'>,</span> <span class='symbol'>:ipad</span><span class='comma'>,</span> <span class='symbol'>:ipod</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_agent'>agent</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>ipad|iphone|ipod</span><span class='regexp_end'>/i</span></span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Apple iOS</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
825
823
|
<span class='lbracket'>[</span><span class='symbol'>:android</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>android</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Android</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
826
824
|
<span class='lbracket'>[</span><span class='symbol'>:blackberry</span><span class='comma'>,</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>blackberry</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>RIM BlackBerry</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
|
@@ -918,6 +916,7 @@
|
|
918
916
|
<pre class="lines">
|
919
917
|
|
920
918
|
|
919
|
+
207
|
921
920
|
208
|
922
921
|
209
|
923
922
|
210
|
@@ -930,11 +929,10 @@
|
|
930
929
|
217
|
931
930
|
218
|
932
931
|
219
|
933
|
-
220
|
934
|
-
221</pre>
|
932
|
+
220</pre>
|
935
933
|
</td>
|
936
934
|
<td>
|
937
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
935
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 207</span>
|
938
936
|
|
939
937
|
<span class='kw'>def</span> <span class='id identifier rubyid_register_language'>register_language</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
940
938
|
<span class='ivar'>@languages</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -1050,13 +1048,13 @@
|
|
1050
1048
|
<pre class="lines">
|
1051
1049
|
|
1052
1050
|
|
1051
|
+
197
|
1053
1052
|
198
|
1054
1053
|
199
|
1055
|
-
200
|
1056
|
-
201</pre>
|
1054
|
+
200</pre>
|
1057
1055
|
</td>
|
1058
1056
|
<td>
|
1059
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line
|
1057
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 197</span>
|
1060
1058
|
|
1061
1059
|
<span class='kw'>def</span> <span class='id identifier rubyid_register_platform'>register_platform</span><span class='lparen'>(</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='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1062
1060
|
<span class='ivar'>@platforms</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -1072,7 +1070,7 @@
|
|
1072
1070
|
</div>
|
1073
1071
|
|
1074
1072
|
<div id="footer">
|
1075
|
-
Generated on
|
1073
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
1076
1074
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1077
1075
|
0.8.5.2 (ruby-1.9.3).
|
1078
1076
|
</div>
|
data/doc/Brauser/Hooks.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.5.2 (ruby-1.9.3).
|
122
122
|
</div>
|
@@ -323,7 +323,7 @@
|
|
323
323
|
</div>
|
324
324
|
|
325
325
|
<div id="footer">
|
326
|
-
Generated on
|
326
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
327
327
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
328
328
|
0.8.5.2 (ruby-1.9.3).
|
329
329
|
</div>
|
data/doc/Brauser/Query.html
CHANGED
@@ -367,7 +367,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
367
367
|
|
368
368
|
|
369
369
|
|
370
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the
|
370
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
371
371
|
</div></span>
|
372
372
|
|
373
373
|
</li>
|
@@ -390,7 +390,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
390
390
|
|
391
391
|
|
392
392
|
|
393
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the
|
393
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
394
394
|
</div></span>
|
395
395
|
|
396
396
|
</li>
|
@@ -674,7 +674,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
674
674
|
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
675
675
|
<span class='kw'>end</span>
|
676
676
|
|
677
|
-
<span class='comment'># Checks if the
|
677
|
+
<span class='comment'># Checks if the browser is a specific version.
|
678
678
|
</span> <span class='comment'>#
|
679
679
|
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
680
680
|
</span> <span class='comment'># @return [Query] The query itself.
|
@@ -683,7 +683,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
683
683
|
<span class='kw'>self</span>
|
684
684
|
<span class='kw'>end</span>
|
685
685
|
|
686
|
-
<span class='comment'># Checks if the
|
686
|
+
<span class='comment'># Checks if the browser is a specific version.
|
687
687
|
</span> <span class='comment'>#
|
688
688
|
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#v}.
|
689
689
|
</span> <span class='comment'>#
|
@@ -925,7 +925,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
925
925
|
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
926
926
|
<span class='kw'>end</span>
|
927
927
|
|
928
|
-
<span class='comment'># Checks if the
|
928
|
+
<span class='comment'># Checks if the browser is a specific version.
|
929
929
|
</span> <span class='comment'>#
|
930
930
|
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
931
931
|
</span> <span class='comment'># @return [Query] The query itself.
|
@@ -934,7 +934,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
934
934
|
<span class='kw'>self</span>
|
935
935
|
<span class='kw'>end</span>
|
936
936
|
|
937
|
-
<span class='comment'># Checks if the
|
937
|
+
<span class='comment'># Checks if the browser is a specific version.
|
938
938
|
</span> <span class='comment'>#
|
939
939
|
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#v}.
|
940
940
|
</span> <span class='comment'>#
|
@@ -1571,7 +1571,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
1571
1571
|
|
1572
1572
|
</h3><div class="docstring">
|
1573
1573
|
<div class="discussion">
|
1574
|
-
<p>Checks if the
|
1574
|
+
<p>Checks if the browser is a specific version.</p>
|
1575
1575
|
|
1576
1576
|
|
1577
1577
|
</div>
|
@@ -1651,7 +1651,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
1651
1651
|
|
1652
1652
|
</h3><div class="docstring">
|
1653
1653
|
<div class="discussion">
|
1654
|
-
<p>Checks if the
|
1654
|
+
<p>Checks if the browser is a specific version.</p>
|
1655
1655
|
|
1656
1656
|
<p>This version returns a boolean and it is equal to append a call to <span class='object_link'><a href="#result-instance_method" title="Brauser::Query#result (method)">#result</a></span> to the method <span class='object_link'><a href="#v-instance_method" title="Brauser::Query#v (method)">#v</a></span>.</p>
|
1657
1657
|
|
@@ -1725,7 +1725,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
1725
1725
|
</div>
|
1726
1726
|
|
1727
1727
|
<div id="footer">
|
1728
|
-
Generated on
|
1728
|
+
Generated on Fri Mar 1 17:26:26 2013 by
|
1729
1729
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1730
1730
|
0.8.5.2 (ruby-1.9.3).
|
1731
1731
|
</div>
|
data/doc/Brauser/Version.html
CHANGED
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
</div>
|
136
136
|
</dt>
|
137
|
-
<dd><pre class="code"><span class='int'>
|
137
|
+
<dd><pre class="code"><span class='int'>1</span></pre></dd>
|
138
138
|
|
139
139
|
<dt id="PATCH-constant" class="">PATCH =
|
140
140
|
<div class="docstring">
|
@@ -149,7 +149,7 @@
|
|
149
149
|
|
150
150
|
</div>
|
151
151
|
</dt>
|
152
|
-
<dd><pre class="code"><span class='int'>
|
152
|
+
<dd><pre class="code"><span class='int'>0</span></pre></dd>
|
153
153
|
|
154
154
|
<dt id="STRING-constant" class="">STRING =
|
155
155
|
<div class="docstring">
|
@@ -180,7 +180,7 @@
|
|
180
180
|
</div>
|
181
181
|
|
182
182
|
<div id="footer">
|
183
|
-
Generated on
|
183
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
185
|
0.8.5.2 (ruby-1.9.3).
|
186
186
|
</div>
|
data/doc/_index.html
CHANGED
@@ -266,7 +266,7 @@
|
|
266
266
|
</div>
|
267
267
|
|
268
268
|
<div id="footer">
|
269
|
-
Generated on
|
269
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
270
270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
271
271
|
0.8.5.2 (ruby-1.9.3).
|
272
272
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -160,7 +160,7 @@ browser.is?("< 2 && > 1")
|
|
160
160
|
# => true
|
161
161
|
</code></p>
|
162
162
|
|
163
|
-
<p>The method <code>on</code> check is the current browser in one of the
|
163
|
+
<p>The method <code>on</code> check is the current browser in one of the specified platform. The platform should be passed as <code>Symbol</code>.</p>
|
164
164
|
|
165
165
|
<p><code>ruby
|
166
166
|
browser.on?(:osx)
|
@@ -281,7 +281,7 @@ browser.register_language("it", "Italian")
|
|
281
281
|
</div></div>
|
282
282
|
|
283
283
|
<div id="footer">
|
284
|
-
Generated on
|
284
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
285
285
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
286
286
|
0.8.5.2 (ruby-1.9.3).
|
287
287
|
</div>
|
data/doc/index.html
CHANGED
@@ -160,7 +160,7 @@ browser.is?("< 2 && > 1")
|
|
160
160
|
# => true
|
161
161
|
</code></p>
|
162
162
|
|
163
|
-
<p>The method <code>on</code> check is the current browser in one of the
|
163
|
+
<p>The method <code>on</code> check is the current browser in one of the specified platform. The platform should be passed as <code>Symbol</code>.</p>
|
164
164
|
|
165
165
|
<p><code>ruby
|
166
166
|
browser.on?(:osx)
|
@@ -281,7 +281,7 @@ browser.register_language("it", "Italian")
|
|
281
281
|
</div></div>
|
282
282
|
|
283
283
|
<div id="footer">
|
284
|
-
Generated on
|
284
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
285
285
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
286
286
|
0.8.5.2 (ruby-1.9.3).
|
287
287
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Fri Mar 1 17:26:25 2013 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.5.2 (ruby-1.9.3).
|
109
109
|
</div>
|
data/lib/brauser/browser.rb
CHANGED
@@ -35,7 +35,7 @@ module Brauser
|
|
35
35
|
self.register_platform([
|
36
36
|
[:symbian, /s60|symb/i, "Symbian"],
|
37
37
|
[:windows_phone, /windows phone/i, "Microsoft Windows Phone"],
|
38
|
-
[:kindle, Proc.new { |name,
|
38
|
+
[:kindle, Proc.new { |name, _| name == :kindle }, "Nokia Symbian"],
|
39
39
|
[:ios, Proc.new { |name, agent| [:iphone, :ipad, :ipod].include?(name) || agent =~ /ipad|iphone|ipod/i }, "Apple iOS"],
|
40
40
|
[:android, /android/i, "Android"],
|
41
41
|
[:blackberry, /blackberry/i, "RIM BlackBerry"],
|
@@ -134,7 +134,6 @@ module Brauser
|
|
134
134
|
"ro-mo" => "Romanian/Moldavia",
|
135
135
|
"ru" => "Russian",
|
136
136
|
"ru-mo" => "Russian /Moldavia",
|
137
|
-
"gd" => "Scots Gaelic",
|
138
137
|
"sr" => "Serbian",
|
139
138
|
"sk" => "Slovack",
|
140
139
|
"sl" => "Slovenian",
|
@@ -230,7 +229,7 @@ module Brauser
|
|
230
229
|
[:firefox, /firefox/i, /(.+Firefox\/)([a-z0-9.]+)/i, "Mozilla Firefox"],
|
231
230
|
[:safari, Proc.new{ |agent| agent =~ /safari/i && agent !~ /((chrome)|(chromium))/i }, /(.+Version\/)([a-z0-9.]+)/i, "Apple Safari"],
|
232
231
|
|
233
|
-
[:msie_compatibility, /trident/i, Proc.new { |
|
232
|
+
[:msie_compatibility, /trident/i, Proc.new { |_, agent|
|
234
233
|
version = /(.+Trident\/)([a-z0-9.]+)/i.match(agent)
|
235
234
|
|
236
235
|
if version.is_a?(::MatchData) then
|
@@ -257,7 +256,7 @@ module Brauser
|
|
257
256
|
[:coremedia, /coremedia/i, /.+CoreMedia v([a-z0-9.]+)/i, "Apple CoreMedia"],
|
258
257
|
|
259
258
|
[:opera_mobile, /opera mobi/i, /.+Opera Mobi.+((.+Opera )|(Version\/))([a-z0-9.]+)/i, "Opera Mobile"],
|
260
|
-
[:opera, /opera/i, Proc.new{ |
|
259
|
+
[:opera, /opera/i, Proc.new{ |_, agent|
|
261
260
|
regexp = (agent !~ /wii/i) ? /((.+Opera )|(Version\/))([a-z0-9.]+)/i : /(.+Nintendo Wii; U; ; )([a-z0-9.]+)/i
|
262
261
|
|
263
262
|
version = regexp.match(agent)
|
@@ -441,7 +440,7 @@ module Brauser
|
|
441
440
|
# @param block [Proc] A block to translate browser name.
|
442
441
|
# @return [String|Array] CSS ready information of the current browser.
|
443
442
|
def classes(join = " ", name = "", version = "version-", platform = "platform-", &block)
|
444
|
-
platform = "platform-" if platform
|
443
|
+
platform = "platform-" if platform.is_a?(TrueClass)
|
445
444
|
rv = [stringify_name(name, &block), stringify_version(version), !platform ? nil : (platform + @platform.to_s)].compact.flatten
|
446
445
|
join ? rv.join(join) : rv
|
447
446
|
end
|
@@ -457,9 +456,9 @@ module Brauser
|
|
457
456
|
if !name then
|
458
457
|
nil
|
459
458
|
else
|
460
|
-
name = "" if name
|
459
|
+
name = "" if name.is_a?(TrueClass)
|
461
460
|
self.parse_agent(@agent) if !@name
|
462
|
-
block ||= Proc.new {|
|
461
|
+
block ||= Proc.new {|n, *| n == :msie_compatibility ? [:msie_compatibility, :msie] : n }
|
463
462
|
|
464
463
|
names = block.call(@name, @version, @platform).ensure_array.collect {|n| "#{name}#{n}" }
|
465
464
|
names.length > 1 ? names : names.first
|
@@ -471,7 +470,7 @@ module Brauser
|
|
471
470
|
# @param version [String|NilClass] If non falsy, the string to prepend to the version. If falsy, the version information will not be included.
|
472
471
|
# @return [Array] The version strings or `nil`, if it was set to be skipped
|
473
472
|
def stringify_version(version)
|
474
|
-
version = "version-" if version
|
473
|
+
version = "version-" if version.is_a?(TrueClass)
|
475
474
|
others = @version.split(".")
|
476
475
|
major = others.shift
|
477
476
|
!version ? nil : others.inject([version + major]) {|prev, current| prev + [prev.last + "_" + current] }.flatten
|
@@ -486,7 +485,7 @@ module Brauser
|
|
486
485
|
def parse_agent(agent = nil)
|
487
486
|
agent = agent.ensure_string
|
488
487
|
|
489
|
-
@name,
|
488
|
+
@name, _ = match_name_and_version(agent)
|
490
489
|
@version = adjust_version(@version)
|
491
490
|
@platform = match_platform(agent)
|
492
491
|
|
@@ -525,9 +524,9 @@ module Brauser
|
|
525
524
|
def adjust_version(version)
|
526
525
|
# Adjust version
|
527
526
|
if version.blank? then
|
528
|
-
|
527
|
+
"0.0"
|
529
528
|
elsif version.is_a?(::MatchData) then
|
530
|
-
version
|
529
|
+
version.to_a.last
|
531
530
|
else
|
532
531
|
version
|
533
532
|
end
|
@@ -588,13 +587,12 @@ module Brauser
|
|
588
587
|
)
|
589
588
|
end
|
590
589
|
|
591
|
-
# Checks if the
|
590
|
+
# Checks if the browser is a specific version.
|
592
591
|
#
|
593
592
|
# @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
594
593
|
# @return [Query] A query which can evaluated for concatenation or result.
|
595
594
|
def v(versions = {})
|
596
595
|
self.parse_agent(@agent) if !@version
|
597
|
-
rv = true
|
598
596
|
|
599
597
|
versions = if versions.is_a?(String) then
|
600
598
|
parse_versions_query(versions)
|
@@ -685,7 +683,7 @@ module Brauser
|
|
685
683
|
self.is(names, versions, platforms).result
|
686
684
|
end
|
687
685
|
|
688
|
-
# Checks if the
|
686
|
+
# Checks if the browser is a specific version.
|
689
687
|
#
|
690
688
|
# @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
691
689
|
# @return [Boolean] `true` if current browser matches, `false` otherwise.
|
data/lib/brauser/query.rb
CHANGED
@@ -60,7 +60,7 @@ module Brauser
|
|
60
60
|
@result ? @target.is?(names, versions, platforms) : @result
|
61
61
|
end
|
62
62
|
|
63
|
-
# Checks if the
|
63
|
+
# Checks if the browser is a specific version.
|
64
64
|
#
|
65
65
|
# @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
66
66
|
# @return [Query] The query itself.
|
@@ -69,7 +69,7 @@ module Brauser
|
|
69
69
|
self
|
70
70
|
end
|
71
71
|
|
72
|
-
# Checks if the
|
72
|
+
# Checks if the browser is a specific version.
|
73
73
|
#
|
74
74
|
# This version returns a boolean and it is equal to append a call to {#result} to the method {#v}.
|
75
75
|
#
|
data/lib/brauser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brauser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02
|
12
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lazier
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.
|
21
|
+
version: 2.7.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.
|
29
|
+
version: 2.7.0
|
30
30
|
description: A framework agnostic browser detection and querying helper.
|
31
31
|
email:
|
32
32
|
- shogun_panda@me.com
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
segments:
|
105
105
|
- 0
|
106
|
-
hash:
|
106
|
+
hash: 511167923729030104
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project: brauser
|
109
109
|
rubygems_version: 1.8.25
|