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.
@@ -503,7 +503,7 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
503
503
  </div>
504
504
 
505
505
  <div id="footer">
506
- Generated on Sun May 19 12:02:57 2013 by
506
+ Generated on Sun May 19 15:39:14 2013 by
507
507
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
508
508
  0.8.6.1 (ruby-1.9.3).
509
509
  </div>
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>0</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>1</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 Sun May 19 12:02:57 2013 by
183
+ Generated on Sun May 19 15:39:14 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
185
  0.8.6.1 (ruby-1.9.3).
186
186
  </div>
@@ -295,7 +295,7 @@
295
295
  </div>
296
296
 
297
297
  <div id="footer">
298
- Generated on Sun May 19 12:02:56 2013 by
298
+ Generated on Sun May 19 15:39:13 2013 by
299
299
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
300
300
  0.8.6.1 (ruby-1.9.3).
301
301
  </div>
@@ -214,51 +214,38 @@ browser.is_chrome_v_lt<em>2_and_gt</em>1_2_on_osx?
214
214
 
215
215
  <h3 id="adding-new-browsers">Adding new browsers</h3>
216
216
 
217
- <p>To add new browsers, simply call <code>register_browser</code>.</p>
217
+ <p>To add new browsers, simply call <code>::Brauser::Browser.add(:browsers, ...)</code>.</p>
218
218
 
219
- <p>This methods accepts a single entry or an array of entries in the following format: <code>[name, name_match, version_match, label]</code>:</p>
220
-
221
- <ul>
222
- <li><code>name</code> is the name of the browser. Should be a <code>Symbol</code>.</li>
223
- <li><code>name_match</code> is a <code>Regexp</code> to match against the user agent to detect the current browser.</li>
224
- <li><code>version_match</code> is a <code>Regexp</code> which last capture group holds the version of the browser.</li>
225
- <li><code>label</code> is the human readable name of the browser.</li>
226
- </ul>
219
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
227
220
 
228
221
  <p>For example, for Google Chrome the call should be:</p>
229
222
 
230
223
  <p><code>ruby
231
- browser.register_browser(:chrome, /((chrome)|(chromium))/i, /(.+Chrom[a-z]+\/)([a-z0-9.]+)/i, "Google Chrome")
224
+ Brauser::Browsers.add(:browsers, ::Brauser::Definition.new(:chrome, "Chrome", /((chrome)|(chromium))/i, /(.+Chrom[a-z]+\/)([a-z0-9.]+)/i))
232
225
  </code></p>
233
226
 
234
227
  <h3 id="adding-new-platforms">Adding new platforms</h3>
235
228
 
236
- <p>To add new platforms, simply call <code>register_platform</code>.</p>
229
+ <p>To add new platforms, simply call <code>::Brauser::Browser.add(:platforms, ...)</code>.</p>
237
230
 
238
- <p>This method accepts a single entry or an array of entries in the following format: <code>[name, matcher, label]</code>:</p>
239
-
240
- <ul>
241
- <li><code>name</code> is the name of the platform. Should be a <code>Symbol</code>.</li>
242
- <li><code>matcher</code> is a <code>Regexp</code> to match against the user agent to detect the current platform.</li>
243
- <li><code>label</code> is the human readable name of the platform.</li>
244
- </ul>
231
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
245
232
 
246
233
  <p>For example, for Mac OS X the call should be:</p>
247
234
 
248
235
  <p><code>ruby
249
- browser.register_platform(:osx, /mac|macintosh|mac os x/i, "Apple MacOS X")
236
+ Brauser::Browsers.add(:platforms, ::Brauser::Definition.new(:osx, /mac|macintosh|mac os x/i, "Apple MacOS X"))
250
237
  </code></p>
251
238
 
252
239
  <h3 id="adding-new-languages">Adding new languages</h3>
253
240
 
254
- <p>To add new languages, simply call <code>register_language</code>.</p>
241
+ <p>To add new languages, simply call <code>::Brauser::Browser.add(:languages, ...)</code>.</p>
255
242
 
256
- <p>This method accepts a single pair of code and label or an hash where keys are language code and values are labels.</p>
243
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
257
244
 
258
245
  <p>For example, for Italian the call should be:</p>
259
246
 
260
247
  <p><code>ruby
261
- browser.register_language("it", "Italian")
248
+ Brauser::Browsers.add(:languages, ::Brauser::Definition.new(:it, "Italian"))
262
249
  </code></p>
263
250
 
264
251
  <h2 id="contributing-to-brauser">Contributing to brauser</h2>
@@ -281,7 +268,7 @@ browser.register_language("it", "Italian")
281
268
  </div></div>
282
269
 
283
270
  <div id="footer">
284
- Generated on Sun May 19 12:02:56 2013 by
271
+ Generated on Sun May 19 15:39:13 2013 by
285
272
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
286
273
  0.8.6.1 (ruby-1.9.3).
287
274
  </div>
@@ -214,51 +214,38 @@ browser.is_chrome_v_lt<em>2_and_gt</em>1_2_on_osx?
214
214
 
215
215
  <h3 id="adding-new-browsers">Adding new browsers</h3>
216
216
 
217
- <p>To add new browsers, simply call <code>register_browser</code>.</p>
217
+ <p>To add new browsers, simply call <code>::Brauser::Browser.add(:browsers, ...)</code>.</p>
218
218
 
219
- <p>This methods accepts a single entry or an array of entries in the following format: <code>[name, name_match, version_match, label]</code>:</p>
220
-
221
- <ul>
222
- <li><code>name</code> is the name of the browser. Should be a <code>Symbol</code>.</li>
223
- <li><code>name_match</code> is a <code>Regexp</code> to match against the user agent to detect the current browser.</li>
224
- <li><code>version_match</code> is a <code>Regexp</code> which last capture group holds the version of the browser.</li>
225
- <li><code>label</code> is the human readable name of the browser.</li>
226
- </ul>
219
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
227
220
 
228
221
  <p>For example, for Google Chrome the call should be:</p>
229
222
 
230
223
  <p><code>ruby
231
- browser.register_browser(:chrome, /((chrome)|(chromium))/i, /(.+Chrom[a-z]+\/)([a-z0-9.]+)/i, "Google Chrome")
224
+ Brauser::Browsers.add(:browsers, ::Brauser::Definition.new(:chrome, "Chrome", /((chrome)|(chromium))/i, /(.+Chrom[a-z]+\/)([a-z0-9.]+)/i))
232
225
  </code></p>
233
226
 
234
227
  <h3 id="adding-new-platforms">Adding new platforms</h3>
235
228
 
236
- <p>To add new platforms, simply call <code>register_platform</code>.</p>
229
+ <p>To add new platforms, simply call <code>::Brauser::Browser.add(:platforms, ...)</code>.</p>
237
230
 
238
- <p>This method accepts a single entry or an array of entries in the following format: <code>[name, matcher, label]</code>:</p>
239
-
240
- <ul>
241
- <li><code>name</code> is the name of the platform. Should be a <code>Symbol</code>.</li>
242
- <li><code>matcher</code> is a <code>Regexp</code> to match against the user agent to detect the current platform.</li>
243
- <li><code>label</code> is the human readable name of the platform.</li>
244
- </ul>
231
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
245
232
 
246
233
  <p>For example, for Mac OS X the call should be:</p>
247
234
 
248
235
  <p><code>ruby
249
- browser.register_platform(:osx, /mac|macintosh|mac os x/i, "Apple MacOS X")
236
+ Brauser::Browsers.add(:platforms, ::Brauser::Definition.new(:osx, /mac|macintosh|mac os x/i, "Apple MacOS X"))
250
237
  </code></p>
251
238
 
252
239
  <h3 id="adding-new-languages">Adding new languages</h3>
253
240
 
254
- <p>To add new languages, simply call <code>register_language</code>.</p>
241
+ <p>To add new languages, simply call <code>::Brauser::Browser.add(:languages, ...)</code>.</p>
255
242
 
256
- <p>This method accepts a single pair of code and label or an hash where keys are language code and values are labels.</p>
243
+ <p>This methods accepts a single instance or an array of instances of the <code>::Brauser::Definition</code> class.</p>
257
244
 
258
245
  <p>For example, for Italian the call should be:</p>
259
246
 
260
247
  <p><code>ruby
261
- browser.register_language("it", "Italian")
248
+ Brauser::Browsers.add(:languages, ::Brauser::Definition.new(:it, "Italian"))
262
249
  </code></p>
263
250
 
264
251
  <h2 id="contributing-to-brauser">Contributing to brauser</h2>
@@ -281,7 +268,7 @@ browser.register_language("it", "Italian")
281
268
  </div></div>
282
269
 
283
270
  <div id="footer">
284
- Generated on Sun May 19 12:02:56 2013 by
271
+ Generated on Sun May 19 15:39:13 2013 by
285
272
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
286
273
  0.8.6.1 (ruby-1.9.3).
287
274
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sun May 19 12:02:56 2013 by
106
+ Generated on Sun May 19 15:39:13 2013 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.6.1 (ruby-1.9.3).
109
109
  </div>
@@ -13,9 +13,9 @@ module Brauser
13
13
  # @attribute label
14
14
  # @return [String] A human readable label for this definition.
15
15
  # @attribute primary
16
- # @return [String|Symbol|Proc] The primary matcher of this definition.
16
+ # @return [String|Symbol|Proc] The primary matcher of this definition. Used to match browser engine, platform name and language.
17
17
  # @attribute secondary
18
- # @return [String|Symbol|Proc] The secondary matcher of this definition.
18
+ # @return [String|Symbol|Proc] The secondary matcher of this definition. Used to match browser version.
19
19
  class Definition
20
20
  attr_accessor :tag, :label, :primary, :secondary
21
21
 
@@ -16,7 +16,7 @@ module Brauser
16
16
  MINOR = 0
17
17
 
18
18
  # The patch version.
19
- PATCH = 0
19
+ PATCH = 1
20
20
 
21
21
  # The current version of brauser.
22
22
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
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: 3.0.0
4
+ version: 3.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0
21
+ version: 3.0.1
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: 3.0.0
29
+ version: 3.0.1
30
30
  description: A framework agnostic browser detection and querying helper.
31
31
  email:
32
32
  - shogun_panda@me.com
@@ -53,8 +53,11 @@ files:
53
53
  - doc/Brauser/BrowserMethods/Querying.html
54
54
  - doc/Brauser/BrowserMethods/Register.html
55
55
  - doc/Brauser/BrowserMethods/Register/ClassMethods.html
56
+ - doc/Brauser/Chainers.html
57
+ - doc/Brauser/Definition.html
56
58
  - doc/Brauser/Hooks.html
57
59
  - doc/Brauser/Hooks/RubyOnRails.html
60
+ - doc/Brauser/Queries.html
58
61
  - doc/Brauser/Query.html
59
62
  - doc/Brauser/Version.html
60
63
  - doc/_index.html
@@ -105,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
108
  version: '0'
106
109
  segments:
107
110
  - 0
108
- hash: -647433580112480760
111
+ hash: -634335438394906499
109
112
  requirements: []
110
113
  rubyforge_project: brauser
111
114
  rubygems_version: 1.8.25