brauser 3.0.0 → 3.0.1
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 +9 -18
- data/brauser.gemspec +1 -1
- data/doc/Brauser.html +1 -1
- data/doc/Brauser/Browser.html +1 -1
- data/doc/Brauser/BrowserMethods.html +1 -1
- data/doc/Brauser/BrowserMethods/Attributes.html +1 -1
- data/doc/Brauser/BrowserMethods/General.html +1 -1
- data/doc/Brauser/BrowserMethods/General/ClassMethods.html +1 -1
- data/doc/Brauser/BrowserMethods/Parsing.html +1 -1
- data/doc/Brauser/BrowserMethods/PartialQuerying.html +1 -1
- data/doc/Brauser/BrowserMethods/Querying.html +1 -1
- data/doc/Brauser/BrowserMethods/Register.html +1 -1
- data/doc/Brauser/BrowserMethods/Register/ClassMethods.html +1 -1
- data/doc/Brauser/Chainers.html +591 -0
- data/doc/Brauser/Definition.html +1035 -0
- data/doc/Brauser/Hooks.html +1 -1
- data/doc/Brauser/Hooks/RubyOnRails.html +1 -1
- data/doc/Brauser/Queries.html +591 -0
- data/doc/Brauser/Query.html +1 -1
- data/doc/Brauser/Version.html +2 -2
- data/doc/_index.html +1 -1
- data/doc/file.README.html +10 -23
- data/doc/index.html +10 -23
- data/doc/top-level-namespace.html +1 -1
- data/lib/brauser/definition.rb +2 -2
- data/lib/brauser/version.rb +1 -1
- metadata +7 -4
data/README.md
CHANGED
@@ -151,47 +151,38 @@ browser.is_chrome_v_lt_2_and_gt_1_2_on_osx?
|
|
151
151
|
|
152
152
|
### Adding new browsers
|
153
153
|
|
154
|
-
To add new browsers, simply call
|
154
|
+
To add new browsers, simply call `::Brauser::Browser.add(:browsers, ...)`.
|
155
155
|
|
156
|
-
This methods accepts a single
|
157
|
-
|
158
|
-
* `name` is the name of the browser. Should be a `Symbol`.
|
159
|
-
* `name_match` is a `Regexp` to match against the user agent to detect the current browser.
|
160
|
-
* `version_match` is a `Regexp` which last capture group holds the version of the browser.
|
161
|
-
* `label` is the human readable name of the browser.
|
156
|
+
This methods accepts a single instance or an array of instances of the `::Brauser::Definition` class.
|
162
157
|
|
163
158
|
For example, for Google Chrome the call should be:
|
164
159
|
|
165
160
|
```ruby
|
166
|
-
|
161
|
+
Brauser::Browsers.add(:browsers, ::Brauser::Definition.new(:chrome, "Chrome", /((chrome)|(chromium))/i, /(.+Chrom[a-z]+\/)([a-z0-9.]+)/i))
|
167
162
|
```
|
168
163
|
|
169
164
|
### Adding new platforms
|
170
165
|
|
171
|
-
To add new platforms, simply call
|
172
|
-
|
173
|
-
This method accepts a single entry or an array of entries in the following format: `[name, matcher, label]`:
|
166
|
+
To add new platforms, simply call `::Brauser::Browser.add(:platforms, ...)`.
|
174
167
|
|
175
|
-
|
176
|
-
* `matcher` is a `Regexp` to match against the user agent to detect the current platform.
|
177
|
-
* `label` is the human readable name of the platform.
|
168
|
+
This methods accepts a single instance or an array of instances of the `::Brauser::Definition` class.
|
178
169
|
|
179
170
|
For example, for Mac OS X the call should be:
|
180
171
|
|
181
172
|
```ruby
|
182
|
-
|
173
|
+
Brauser::Browsers.add(:platforms, ::Brauser::Definition.new(:osx, /mac|macintosh|mac os x/i, "Apple MacOS X"))
|
183
174
|
```
|
184
175
|
|
185
176
|
### Adding new languages
|
186
177
|
|
187
|
-
To add new languages, simply call
|
178
|
+
To add new languages, simply call `::Brauser::Browser.add(:languages, ...)`.
|
188
179
|
|
189
|
-
This
|
180
|
+
This methods accepts a single instance or an array of instances of the `::Brauser::Definition` class.
|
190
181
|
|
191
182
|
For example, for Italian the call should be:
|
192
183
|
|
193
184
|
```ruby
|
194
|
-
|
185
|
+
Brauser::Browsers.add(:languages, ::Brauser::Definition.new(:it, "Italian"))
|
195
186
|
```
|
196
187
|
|
197
188
|
## Contributing to brauser
|
data/brauser.gemspec
CHANGED
data/doc/Brauser.html
CHANGED
@@ -121,7 +121,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
121
121
|
</div>
|
122
122
|
|
123
123
|
<div id="footer">
|
124
|
-
Generated on Sun May 19
|
124
|
+
Generated on Sun May 19 15:39:13 2013 by
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
126
126
|
0.8.6.1 (ruby-1.9.3).
|
127
127
|
</div>
|
data/doc/Brauser/Browser.html
CHANGED
@@ -2572,7 +2572,7 @@ browser.is_msie_gt_4_1_on_windows?
|
|
2572
2572
|
</div>
|
2573
2573
|
|
2574
2574
|
<div id="footer">
|
2575
|
-
Generated on Sun May 19
|
2575
|
+
Generated on Sun May 19 15:39:14 2013 by
|
2576
2576
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2577
2577
|
0.8.6.1 (ruby-1.9.3).
|
2578
2578
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Sun May 19
|
119
|
+
Generated on Sun May 19 15:39:13 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.6.1 (ruby-1.9.3).
|
122
122
|
</div>
|
@@ -476,7 +476,7 @@
|
|
476
476
|
</div>
|
477
477
|
|
478
478
|
<div id="footer">
|
479
|
-
Generated on Sun May 19
|
479
|
+
Generated on Sun May 19 15:39:14 2013 by
|
480
480
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
481
481
|
0.8.6.1 (ruby-1.9.3).
|
482
482
|
</div>
|
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on Sun May 19
|
128
|
+
Generated on Sun May 19 15:39:14 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.6.1 (ruby-1.9.3).
|
131
131
|
</div>
|
@@ -520,7 +520,7 @@
|
|
520
520
|
</div>
|
521
521
|
|
522
522
|
<div id="footer">
|
523
|
-
Generated on Sun May 19
|
523
|
+
Generated on Sun May 19 15:39:14 2013 by
|
524
524
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
525
525
|
0.8.6.1 (ruby-1.9.3).
|
526
526
|
</div>
|
@@ -341,7 +341,7 @@
|
|
341
341
|
</div>
|
342
342
|
|
343
343
|
<div id="footer">
|
344
|
-
Generated on Sun May 19
|
344
|
+
Generated on Sun May 19 15:39:14 2013 by
|
345
345
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
346
346
|
0.8.6.1 (ruby-1.9.3).
|
347
347
|
</div>
|
@@ -608,7 +608,7 @@
|
|
608
608
|
</div>
|
609
609
|
|
610
610
|
<div id="footer">
|
611
|
-
Generated on Sun May 19
|
611
|
+
Generated on Sun May 19 15:39:14 2013 by
|
612
612
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
613
613
|
0.8.6.1 (ruby-1.9.3).
|
614
614
|
</div>
|
@@ -574,7 +574,7 @@
|
|
574
574
|
</div>
|
575
575
|
|
576
576
|
<div id="footer">
|
577
|
-
Generated on Sun May 19
|
577
|
+
Generated on Sun May 19 15:39:14 2013 by
|
578
578
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
579
579
|
0.8.6.1 (ruby-1.9.3).
|
580
580
|
</div>
|
@@ -125,7 +125,7 @@
|
|
125
125
|
</div>
|
126
126
|
|
127
127
|
<div id="footer">
|
128
|
-
Generated on Sun May 19
|
128
|
+
Generated on Sun May 19 15:39:13 2013 by
|
129
129
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
130
130
|
0.8.6.1 (ruby-1.9.3).
|
131
131
|
</div>
|
@@ -761,7 +761,7 @@
|
|
761
761
|
</div>
|
762
762
|
|
763
763
|
<div id="footer">
|
764
|
-
Generated on Sun May 19
|
764
|
+
Generated on Sun May 19 15:39:14 2013 by
|
765
765
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
766
766
|
0.8.6.1 (ruby-1.9.3).
|
767
767
|
</div>
|
@@ -0,0 +1,591 @@
|
|
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
|
+
Module: Brauser::Chainers
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.6.1
|
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#!" + escape(window.location.href);
|
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 (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Brauser.html" title="Brauser (module)">Brauser</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Chainers</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>Module: Brauser::Chainers
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<dt class="r1">Included in:</dt>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/brauser/query.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>Methods to chain queries.</p>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
<div class="tags">
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#accepts-instance_method" title="#accepts (instance method)">- (Query) <strong>accepts</strong>(langs = []) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>Check if the browser accepts the specified languages.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#is-instance_method" title="#is (instance method)">- (Query) <strong>is</strong>(names = [], versions = {}, platforms = []) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
157
|
+
</div></span>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
<li class="public ">
|
163
|
+
<span class="summary_signature">
|
164
|
+
|
165
|
+
<a href="#on-instance_method" title="#on (instance method)">- (Query) <strong>on</strong>(platforms = []) </a>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'><p>Check if the browser is on a specific platform.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#v-instance_method" title="#v (instance method)">- (Query) <strong>v</strong>(versions = {}) </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
203
|
+
</div></span>
|
204
|
+
|
205
|
+
</li>
|
206
|
+
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div id="instance_method_details" class="method_details_list">
|
214
|
+
<h2>Instance Method Details</h2>
|
215
|
+
|
216
|
+
|
217
|
+
<div class="method_details first">
|
218
|
+
<h3 class="signature first" id="accepts-instance_method">
|
219
|
+
|
220
|
+
- (<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>accepts</strong>(langs = [])
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</h3><div class="docstring">
|
227
|
+
<div class="discussion">
|
228
|
+
<p>Check if the browser accepts the specified languages.</p>
|
229
|
+
|
230
|
+
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
<div class="tags">
|
234
|
+
<p class="tag_title">Parameters:</p>
|
235
|
+
<ul class="param">
|
236
|
+
|
237
|
+
<li>
|
238
|
+
|
239
|
+
<span class='name'>langs</span>
|
240
|
+
|
241
|
+
|
242
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
243
|
+
|
244
|
+
|
245
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
246
|
+
|
247
|
+
|
248
|
+
—
|
249
|
+
<div class='inline'><p>A list of languages to match against.</p>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
</ul>
|
255
|
+
|
256
|
+
<p class="tag_title">Returns:</p>
|
257
|
+
<ul class="return">
|
258
|
+
|
259
|
+
<li>
|
260
|
+
|
261
|
+
|
262
|
+
<span class='type'>(<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
—
|
267
|
+
<div class='inline'><p>The query itself.</p>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</li>
|
271
|
+
|
272
|
+
</ul>
|
273
|
+
|
274
|
+
</div><table class="source_code">
|
275
|
+
<tr>
|
276
|
+
<td>
|
277
|
+
<pre class="lines">
|
278
|
+
|
279
|
+
|
280
|
+
47
|
281
|
+
48
|
282
|
+
49
|
283
|
+
50</pre>
|
284
|
+
</td>
|
285
|
+
<td>
|
286
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 47</span>
|
287
|
+
|
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
|
+
<span class='ivar'>@result</span> <span class='op'>=</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>
|
290
|
+
<span class='kw'>self</span>
|
291
|
+
<span class='kw'>end</span></pre>
|
292
|
+
</td>
|
293
|
+
</tr>
|
294
|
+
</table>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div class="method_details ">
|
298
|
+
<h3 class="signature " id="is-instance_method">
|
299
|
+
|
300
|
+
- (<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>is</strong>(names = [], versions = {}, platforms = [])
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</h3><div class="docstring">
|
307
|
+
<div class="discussion">
|
308
|
+
<p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
309
|
+
|
310
|
+
|
311
|
+
</div>
|
312
|
+
</div>
|
313
|
+
<div class="tags">
|
314
|
+
<p class="tag_title">Parameters:</p>
|
315
|
+
<ul class="param">
|
316
|
+
|
317
|
+
<li>
|
318
|
+
|
319
|
+
<span class='name'>names</span>
|
320
|
+
|
321
|
+
|
322
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
323
|
+
|
324
|
+
|
325
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
326
|
+
|
327
|
+
|
328
|
+
—
|
329
|
+
<div class='inline'><p>A list of specific names to match. Also, this meta-names are supported: <code>:capable</code> and <code>:tablet</code>.</p>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
<li>
|
335
|
+
|
336
|
+
<span class='name'>versions</span>
|
337
|
+
|
338
|
+
|
339
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
340
|
+
|
341
|
+
|
342
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
343
|
+
|
344
|
+
|
345
|
+
—
|
346
|
+
<div class='inline'><p>An hash with specific version to match against. Need to be in any form that <span class='object_link'><a href="#v-instance_method" title="Brauser::Chainers#v (method)">#v</a></span> understands.</p>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</li>
|
350
|
+
|
351
|
+
<li>
|
352
|
+
|
353
|
+
<span class='name'>platforms</span>
|
354
|
+
|
355
|
+
|
356
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
357
|
+
|
358
|
+
|
359
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
360
|
+
|
361
|
+
|
362
|
+
—
|
363
|
+
<div class='inline'><p>A list of specific platform to match. Valid values are all those possible for the platform attribute.</p>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
</li>
|
367
|
+
|
368
|
+
</ul>
|
369
|
+
|
370
|
+
<p class="tag_title">Returns:</p>
|
371
|
+
<ul class="return">
|
372
|
+
|
373
|
+
<li>
|
374
|
+
|
375
|
+
|
376
|
+
<span class='type'>(<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
—
|
381
|
+
<div class='inline'><p>The query itself.</p>
|
382
|
+
</div>
|
383
|
+
|
384
|
+
</li>
|
385
|
+
|
386
|
+
</ul>
|
387
|
+
|
388
|
+
<p class="tag_title">See Also:</p>
|
389
|
+
<ul class="see">
|
390
|
+
|
391
|
+
<li>#version?</li>
|
392
|
+
|
393
|
+
<li>#on?</li>
|
394
|
+
|
395
|
+
</ul>
|
396
|
+
|
397
|
+
</div><table class="source_code">
|
398
|
+
<tr>
|
399
|
+
<td>
|
400
|
+
<pre class="lines">
|
401
|
+
|
402
|
+
|
403
|
+
20
|
404
|
+
21
|
405
|
+
22
|
406
|
+
23</pre>
|
407
|
+
</td>
|
408
|
+
<td>
|
409
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 20</span>
|
410
|
+
|
411
|
+
<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>
|
412
|
+
<span class='ivar'>@result</span> <span class='op'>=</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>
|
413
|
+
<span class='kw'>self</span>
|
414
|
+
<span class='kw'>end</span></pre>
|
415
|
+
</td>
|
416
|
+
</tr>
|
417
|
+
</table>
|
418
|
+
</div>
|
419
|
+
|
420
|
+
<div class="method_details ">
|
421
|
+
<h3 class="signature " id="on-instance_method">
|
422
|
+
|
423
|
+
- (<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>on</strong>(platforms = [])
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
</h3><div class="docstring">
|
430
|
+
<div class="discussion">
|
431
|
+
<p>Check if the browser is on a specific platform.</p>
|
432
|
+
|
433
|
+
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
<div class="tags">
|
437
|
+
<p class="tag_title">Parameters:</p>
|
438
|
+
<ul class="param">
|
439
|
+
|
440
|
+
<li>
|
441
|
+
|
442
|
+
<span class='name'>platforms</span>
|
443
|
+
|
444
|
+
|
445
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
446
|
+
|
447
|
+
|
448
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
449
|
+
|
450
|
+
|
451
|
+
—
|
452
|
+
<div class='inline'><p>A list of specific platform to match.</p>
|
453
|
+
</div>
|
454
|
+
|
455
|
+
</li>
|
456
|
+
|
457
|
+
</ul>
|
458
|
+
|
459
|
+
<p class="tag_title">Returns:</p>
|
460
|
+
<ul class="return">
|
461
|
+
|
462
|
+
<li>
|
463
|
+
|
464
|
+
|
465
|
+
<span class='type'>(<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
—
|
470
|
+
<div class='inline'><p>The query itself.</p>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
</div><table class="source_code">
|
478
|
+
<tr>
|
479
|
+
<td>
|
480
|
+
<pre class="lines">
|
481
|
+
|
482
|
+
|
483
|
+
38
|
484
|
+
39
|
485
|
+
40
|
486
|
+
41</pre>
|
487
|
+
</td>
|
488
|
+
<td>
|
489
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 38</span>
|
490
|
+
|
491
|
+
<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>
|
492
|
+
<span class='ivar'>@result</span> <span class='op'>=</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>
|
493
|
+
<span class='kw'>self</span>
|
494
|
+
<span class='kw'>end</span></pre>
|
495
|
+
</td>
|
496
|
+
</tr>
|
497
|
+
</table>
|
498
|
+
</div>
|
499
|
+
|
500
|
+
<div class="method_details ">
|
501
|
+
<h3 class="signature " id="v-instance_method">
|
502
|
+
|
503
|
+
- (<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>v</strong>(versions = {})
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
</h3><div class="docstring">
|
510
|
+
<div class="discussion">
|
511
|
+
<p>Checks if the browser is a specific version.</p>
|
512
|
+
|
513
|
+
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
<div class="tags">
|
517
|
+
<p class="tag_title">Parameters:</p>
|
518
|
+
<ul class="param">
|
519
|
+
|
520
|
+
<li>
|
521
|
+
|
522
|
+
<span class='name'>versions</span>
|
523
|
+
|
524
|
+
|
525
|
+
<span class='type'>(<tt>String|Hash</tt>)</span>
|
526
|
+
|
527
|
+
|
528
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
529
|
+
|
530
|
+
|
531
|
+
—
|
532
|
+
<div class='inline'><p>A string in the form <code>operator version && ...</code> (example: <code>>= 7 && < 4</code>) or an hash with specific version to match against, in form <code>{:operator => version}</code>, where operator is one of <code>:lt, :lte, :eq, :gt, :gte</code>.</p>
|
533
|
+
</div>
|
534
|
+
|
535
|
+
</li>
|
536
|
+
|
537
|
+
</ul>
|
538
|
+
|
539
|
+
<p class="tag_title">Returns:</p>
|
540
|
+
<ul class="return">
|
541
|
+
|
542
|
+
<li>
|
543
|
+
|
544
|
+
|
545
|
+
<span class='type'>(<tt><span class='object_link'><a href="Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
—
|
550
|
+
<div class='inline'><p>The query itself.</p>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
</li>
|
554
|
+
|
555
|
+
</ul>
|
556
|
+
|
557
|
+
</div><table class="source_code">
|
558
|
+
<tr>
|
559
|
+
<td>
|
560
|
+
<pre class="lines">
|
561
|
+
|
562
|
+
|
563
|
+
29
|
564
|
+
30
|
565
|
+
31
|
566
|
+
32</pre>
|
567
|
+
</td>
|
568
|
+
<td>
|
569
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 29</span>
|
570
|
+
|
571
|
+
<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>
|
572
|
+
<span class='ivar'>@result</span> <span class='op'>=</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>
|
573
|
+
<span class='kw'>self</span>
|
574
|
+
<span class='kw'>end</span></pre>
|
575
|
+
</td>
|
576
|
+
</tr>
|
577
|
+
</table>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</div>
|
581
|
+
|
582
|
+
</div>
|
583
|
+
|
584
|
+
<div id="footer">
|
585
|
+
Generated on Sun May 19 15:39:13 2013 by
|
586
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
587
|
+
0.8.6.1 (ruby-1.9.3).
|
588
|
+
</div>
|
589
|
+
|
590
|
+
</body>
|
591
|
+
</html>
|