brwsr 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg
2
+ coverage
3
+ doc
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - "1.9.3"
3
+ - "1.9.2"
4
+ - jruby-19mode
5
+ - rbx-19mode
6
+ - jruby-18mode
7
+ - "1.8.7"
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source :rubygems
2
+ gemspec
3
+
4
+ group :test do
5
+ gem 'guard-test'
6
+ gem 'growl'
7
+ gem 'rb-fsevent'
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ brwsr (1.1.0)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ actionpack (3.2.10)
10
+ activemodel (= 3.2.10)
11
+ activesupport (= 3.2.10)
12
+ builder (~> 3.0.0)
13
+ erubis (~> 2.7.0)
14
+ journey (~> 1.0.4)
15
+ rack (~> 1.4.0)
16
+ rack-cache (~> 1.2)
17
+ rack-test (~> 0.6.1)
18
+ sprockets (~> 2.2.1)
19
+ activemodel (3.2.10)
20
+ activesupport (= 3.2.10)
21
+ builder (~> 3.0.0)
22
+ activesupport (3.2.10)
23
+ i18n (~> 0.6)
24
+ multi_json (~> 1.0)
25
+ awesome_print (1.1.0)
26
+ builder (3.0.4)
27
+ coderay (1.0.8)
28
+ erubis (2.7.0)
29
+ growl (1.0.3)
30
+ guard (1.6.1)
31
+ listen (>= 0.6.0)
32
+ lumberjack (>= 1.0.2)
33
+ pry (>= 0.9.10)
34
+ thor (>= 0.14.6)
35
+ guard-test (0.7.0)
36
+ guard (>= 1.1)
37
+ test-unit (~> 2.2)
38
+ hike (1.2.1)
39
+ i18n (0.6.1)
40
+ journey (1.0.4)
41
+ json (1.7.6)
42
+ listen (0.7.1)
43
+ lumberjack (1.0.2)
44
+ method_source (0.8.1)
45
+ multi_json (1.5.0)
46
+ pry (0.9.10)
47
+ coderay (~> 1.0.5)
48
+ method_source (~> 0.8)
49
+ slop (~> 3.3.1)
50
+ rack (1.4.3)
51
+ rack-cache (1.2)
52
+ rack (>= 0.4)
53
+ rack-test (0.6.2)
54
+ rack (>= 1.0)
55
+ rake (10.0.3)
56
+ rb-fsevent (0.9.3)
57
+ rdoc (3.12)
58
+ json (~> 1.4)
59
+ slop (3.3.3)
60
+ sprockets (2.2.2)
61
+ hike (~> 1.2)
62
+ multi_json (~> 1.0)
63
+ rack (~> 1.0)
64
+ tilt (~> 1.1, != 1.3.0)
65
+ test-unit (2.5.3)
66
+ thor (0.16.0)
67
+ tilt (1.3.3)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ actionpack
74
+ awesome_print
75
+ brwsr!
76
+ growl
77
+ guard-test
78
+ pry
79
+ rake
80
+ rb-fsevent
81
+ rdoc
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard :test, :keep_failed => true do
2
+ watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
3
+ watch(%r{^test/.+_test\.rb$})
4
+ watch('test/test_helper.rb') { "test" }
5
+ end
data/HISTORY.md ADDED
@@ -0,0 +1,3 @@
1
+ 1.1
2
+ - Added support for ie10
3
+ - Pulled in giacomomacri's iOS detection support https://github.com/fnando/browser/pull/21
data/README.rdoc ADDED
@@ -0,0 +1,80 @@
1
+ = Brwsr
2
+
3
+ Do some browser detection with Ruby. Includes ActionController integration.
4
+
5
+ This is just a namespaced fork of https://github.com/fnando/browser. I may add features that may not be sent upstream due to issues maintaining the two.
6
+
7
+ [![Build Status](https://travis-ci.org/oreoshake/browser.png?branch=master)](https://travis-ci.org/oreoshake/browser)
8
+
9
+ == Installation
10
+
11
+ gem install brwsr
12
+
13
+ == Usage
14
+
15
+ require "rubygems"
16
+ require "brwsr"
17
+
18
+ brwsr = Brwsr::Browser.new(:ua => "some string", :accept_language => "en-us")
19
+ brwsr.name # readable brwsr name
20
+ brwsr.safari?
21
+ brwsr.opera?
22
+ brwsr.chrome?
23
+ brwsr.mobile?
24
+ brwsr.firefox?
25
+ brwsr.ie?
26
+ brwsr.ie6? # this goes up to 10
27
+ brwsr.capable? # supports some CSS 3
28
+ brwsr.platform # return :mac, :windows, :linux or :other
29
+ brwsr.mac?
30
+ brwsr.windows?
31
+ brwsr.linux?
32
+ brwsr.meta # an array with several attributes
33
+ brwsr.to_s # the meta info joined by space
34
+
35
+ See the tests for more examples.
36
+
37
+ === Rails integration
38
+
39
+ Just add it to the Gemfile or `environment.rb`, depending of your Rails version.
40
+
41
+ gem "brwsr" #=> Rails 3
42
+ config.gem "brwsr" #=> Rails 2
43
+
44
+ This adds a helper method called `brwsr`, that inspects your current user agent.
45
+
46
+ <% if brwsr.ie6? %>
47
+ <p class="disclaimer">You're running an older IE version. Please update it!</p>
48
+ <% end %>
49
+
50
+ == Maintainer
51
+
52
+ * Neil Matatall - https://github.com/oreoshake/browser
53
+
54
+ == Contributors
55
+
56
+ * https://github.com/fnando/browser
57
+ * https://github.com/chrisyour/browser
58
+
59
+ == License
60
+
61
+ (The MIT License)
62
+
63
+ Permission is hereby granted, free of charge, to any person obtaining
64
+ a copy of this software and associated documentation files (the
65
+ 'Software'), to deal in the Software without restriction, including
66
+ without limitation the rights to use, copy, modify, merge, publish,
67
+ distribute, sublicense, and/or sell copies of the Software, and to
68
+ permit persons to whom the Software is furnished to do so, subject to
69
+ the following conditions:
70
+
71
+ The above copyright notice and this permission notice shall be
72
+ included in all copies or substantial portions of the Software.
73
+
74
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
75
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
76
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
77
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
78
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
79
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
80
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ require "bundler"
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require "./lib/brwsr/version"
5
+
6
+ require "rake/testtask"
7
+ Rake::TestTask.new do |t|
8
+ t.libs << "lib"
9
+ t.libs << "test"
10
+ t.test_files = FileList["test/**/*_test.rb"]
11
+ t.verbose = true
12
+ t.ruby_opts = %w[-rubygems]
13
+ end
14
+
15
+ require 'rdoc/task'
16
+ RDoc::Task.new do |rdoc|
17
+ rdoc.main = "README.rdoc"
18
+ rdoc.rdoc_dir = "doc"
19
+ rdoc.title = "Brwsr API"
20
+ rdoc.options += %w[ --line-numbers --charset utf-8 ]
21
+ rdoc.rdoc_files.include("README.rdoc", "lib/**/*.rb")
22
+ end
23
+
24
+ task :default => :test
data/browser.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "brwsr/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "brwsr"
7
+ s.version = Brwsr::Version::STRING
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Nando Vieira"]
10
+ s.email = ["fnando.vieira@gmail.com"]
11
+ s.homepage = "http://github.com/fnando/browser"
12
+ s.summary = "Do some browser detection with Ruby."
13
+ s.description = s.summary
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_development_dependency "actionpack"
21
+ s.add_development_dependency "rake"
22
+ s.add_development_dependency "rdoc"
23
+ s.add_development_dependency "pry"
24
+ s.add_development_dependency "awesome_print"
25
+ end
@@ -0,0 +1,19 @@
1
+ module Brwsr
2
+ class Browser
3
+ module ActionController # :nodoc: all
4
+ def self.included(base)
5
+ base.send :helper_method, :brwsr
6
+ end
7
+
8
+ private
9
+ def brwsr
10
+ @brwsr ||= Brwsr::Browser.new(
11
+ :accept_language => request.headers["Accept-Language"],
12
+ :ua => request.headers["User-Agent"]
13
+ )
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ ActionController::Base.send :include, Brwsr::Browser::ActionController
@@ -0,0 +1,398 @@
1
+ module Brwsr
2
+ class Browser
3
+ # Set browser's UA string.
4
+ attr_accessor :user_agent
5
+
6
+ # Set browser's preferred language
7
+ attr_writer :accept_language
8
+
9
+ alias :ua :user_agent
10
+ alias :ua= :user_agent=
11
+
12
+ NAMES = {
13
+ :android => "Android",
14
+ :blackberry => "BlackBerry",
15
+ :chrome => "Chrome",
16
+ :firefox => "Firefox",
17
+ :ie => "Internet Explorer",
18
+ :ipad => "iPad",
19
+ :iphone => "iPhone",
20
+ :ipod => "iPod Touch",
21
+ :opera => "Opera",
22
+ :other => "Other",
23
+ :safari => "Safari",
24
+ :psp => "PlayStation Portable",
25
+ :quicktime => "QuickTime",
26
+ :core_media => "Apple CoreMedia"
27
+ }
28
+
29
+ VERSIONS = {
30
+ :default => /(?:Version|MSIE|Firefox|Chrome|QuickTime|BlackBerry[^\/]+|CoreMedia v)[\/ ]?([a-z0-9.]+)/i,
31
+ :opera => /Opera\/.*? Version\/([\d.]+)/
32
+ }
33
+
34
+ TRIDENT_VERSION_REGEX = /Trident\/([0-9.]+)/
35
+
36
+ LANGUAGES = {
37
+ "af" => "Afrikaans",
38
+ "sq" => "Albanian",
39
+ "eu" => "Basque",
40
+ "bg" => "Bulgarian",
41
+ "be" => "Byelorussian",
42
+ "ca" => "Catalan",
43
+ "zh" => "Chinese",
44
+ "zh-cn" => "Chinese/China",
45
+ "zh-tw" => "Chinese/Taiwan",
46
+ "zh-hk" => "Chinese/Hong Kong",
47
+ "zh-sg" => "Chinese/singapore",
48
+ "hr" => "Croatian",
49
+ "cs" => "Czech",
50
+ "da" => "Danish",
51
+ "nl" => "Dutch",
52
+ "nl-nl" => "Dutch/Netherlands",
53
+ "nl-be" => "Dutch/Belgium",
54
+ "en" => "English",
55
+ "en-gb" => "English/United Kingdom",
56
+ "en-us" => "English/United States",
57
+ "en-au" => "English/Australian",
58
+ "en-ca" => "English/Canada",
59
+ "en-nz" => "English/New Zealand",
60
+ "en-ie" => "English/Ireland",
61
+ "en-za" => "English/South Africa",
62
+ "en-jm" => "English/Jamaica",
63
+ "en-bz" => "English/Belize",
64
+ "en-tt" => "English/Trinidad",
65
+ "et" => "Estonian",
66
+ "fo" => "Faeroese",
67
+ "fa" => "Farsi",
68
+ "fi" => "Finnish",
69
+ "fr" => "French",
70
+ "fr-be" => "French/Belgium",
71
+ "fr-fr" => "French/France",
72
+ "fr-ch" => "French/Switzerland",
73
+ "fr-ca" => "French/Canada",
74
+ "fr-lu" => "French/Luxembourg",
75
+ "gd" => "Gaelic",
76
+ "gl" => "Galician",
77
+ "de" => "German",
78
+ "de-at" => "German/Austria",
79
+ "de-de" => "German/Germany",
80
+ "de-ch" => "German/Switzerland",
81
+ "de-lu" => "German/Luxembourg",
82
+ "de-li" => "German/Liechtenstein",
83
+ "el" => "Greek",
84
+ "he" => "Hebrew",
85
+ "he-il" => "Hebrew/Israel",
86
+ "hi" => "Hindi",
87
+ "hu" => "Hungarian",
88
+ "ie-ee" => "Internet Explorer/Easter Egg",
89
+ "is" => "Icelandic",
90
+ "id" => "Indonesian",
91
+ "in" => "Indonesian",
92
+ "ga" => "Irish",
93
+ "it" => "Italian",
94
+ "it-ch" => "Italian/ Switzerland",
95
+ "ja" => "Japanese",
96
+ "km" => "Khmer",
97
+ "km-kh" => "Khmer/Cambodia",
98
+ "ko" => "Korean",
99
+ "lv" => "Latvian",
100
+ "lt" => "Lithuanian",
101
+ "mk" => "Macedonian",
102
+ "ms" => "Malaysian",
103
+ "mt" => "Maltese",
104
+ "no" => "Norwegian",
105
+ "pl" => "Polish",
106
+ "pt" => "Portuguese",
107
+ "pt-br" => "Portuguese/Brazil",
108
+ "rm" => "Rhaeto-Romanic",
109
+ "ro" => "Romanian",
110
+ "ro-mo" => "Romanian/Moldavia",
111
+ "ru" => "Russian",
112
+ "ru-mo" => "Russian /Moldavia",
113
+ "gd" => "Scots Gaelic",
114
+ "sr" => "Serbian",
115
+ "sk" => "Slovack",
116
+ "sl" => "Slovenian",
117
+ "sb" => "Sorbian",
118
+ "es" => "Spanish",
119
+ "es-do" => "Spanish",
120
+ "es-ar" => "Spanish/Argentina",
121
+ "es-co" => "Spanish/Colombia",
122
+ "es-mx" => "Spanish/Mexico",
123
+ "es-es" => "Spanish/Spain",
124
+ "es-gt" => "Spanish/Guatemala",
125
+ "es-cr" => "Spanish/Costa Rica",
126
+ "es-pa" => "Spanish/Panama",
127
+ "es-ve" => "Spanish/Venezuela",
128
+ "es-pe" => "Spanish/Peru",
129
+ "es-ec" => "Spanish/Ecuador",
130
+ "es-cl" => "Spanish/Chile",
131
+ "es-uy" => "Spanish/Uruguay",
132
+ "es-py" => "Spanish/Paraguay",
133
+ "es-bo" => "Spanish/Bolivia",
134
+ "es-sv" => "Spanish/El salvador",
135
+ "es-hn" => "Spanish/Honduras",
136
+ "es-ni" => "Spanish/Nicaragua",
137
+ "es-pr" => "Spanish/Puerto Rico",
138
+ "sx" => "Sutu",
139
+ "sv" => "Swedish",
140
+ "sv-se" => "Swedish/Sweden",
141
+ "sv-fi" => "Swedish/Finland",
142
+ "ts" => "Thai",
143
+ "tn" => "Tswana",
144
+ "tr" => "Turkish",
145
+ "uk" => "Ukrainian",
146
+ "ur" => "Urdu",
147
+ "vi" => "Vietnamese",
148
+ "xh" => "Xshosa",
149
+ "ji" => "Yiddish",
150
+ "zu" => "Zulu"
151
+ }
152
+
153
+ # Create a new browser instance and set
154
+ # the UA and Accept-Language headers.
155
+ #
156
+ # browser = browser.new({
157
+ # :ua => "Safari",
158
+ # :accept_language => "pt-br"
159
+ # })
160
+ #
161
+ def initialize(options = {}, &block)
162
+ @user_agent = (options[:user_agent] || options[:ua]).to_s
163
+ @accept_language = options[:accept_language].to_s
164
+
165
+ yield self if block_given?
166
+ end
167
+
168
+ # Get readable browser name.
169
+ def name
170
+ NAMES[id]
171
+ end
172
+
173
+ # Return a symbol that identifies the browser.
174
+ def id
175
+ case
176
+ when chrome? then :chrome
177
+ when iphone? then :iphone
178
+ when ipad? then :ipad
179
+ when ipod? then :ipod
180
+ when ie? then :ie
181
+ when opera? then :opera
182
+ when firefox? then :firefox
183
+ when android? then :android
184
+ when blackberry? then :blackberry
185
+ when safari? then :safari
186
+ when psp? then :psp
187
+ when quicktime? then :quicktime
188
+ when core_media? then :core_media
189
+ else
190
+ :other
191
+ end
192
+ end
193
+
194
+ # Return an array with all preferred languages that this browser accepts.
195
+ def accept_language
196
+ @accept_language.gsub(/;q=[\d.]+/, "").split(",").collect {|l| l.downcase.gsub(/\s/m, "")}
197
+ end
198
+
199
+ # Return major version.
200
+ def version
201
+ full_version.to_s.split(".").first
202
+ end
203
+
204
+ # Return the full version.
205
+ def full_version
206
+ _, v = *ua.match(VERSIONS.fetch(id, VERSIONS[:default]))
207
+ v || "0.0"
208
+ end
209
+
210
+ # Return true if browser supports some CSS 3 (Safari, Firefox, Opera & IE7+).
211
+ def capable?
212
+ webkit? || firefox? || opera? || (ie? && version.to_i >= 7)
213
+ end
214
+
215
+ def compatibility_view?
216
+ ie? && ua.match(TRIDENT_VERSION_REGEX) && version.to_i < ($1.to_i + 4)
217
+ end
218
+
219
+ # Detect if browser is WebKit-based.
220
+ def webkit?
221
+ !!(ua =~ /AppleWebKit/i)
222
+ end
223
+
224
+ # Detect if browser is ios?.
225
+ def ios?
226
+ ipod? || ipad? || iphone?
227
+ end
228
+
229
+ # Detect if browser is mobile.
230
+ def mobile?
231
+ !!(ua =~ /(Mobi(le)?|Symbian|MIDP|Windows CE)/) || blackberry? || psp? || opera_mini?
232
+ end
233
+
234
+ # Detect if browser is QuickTime
235
+ def quicktime?
236
+ !!(ua =~ /QuickTime/i)
237
+ end
238
+
239
+ # Detect if browser is BlackBerry
240
+ def blackberry?
241
+ !!(ua =~ /BlackBerry/)
242
+ end
243
+
244
+ # Detect if browser is Android.
245
+ def android?
246
+ !!(ua =~ /Android/ && !opera?)
247
+ end
248
+
249
+ # Detect if browser is Apple CoreMedia.
250
+ def core_media?
251
+ !!(ua =~ /CoreMedia/)
252
+ end
253
+
254
+ # Detect if browser is iPhone.
255
+ def iphone?
256
+ !!(ua =~ /iPhone/)
257
+ end
258
+
259
+ def ios4?
260
+ ios? && !!(ua =~ /OS (4)/)
261
+ end
262
+
263
+ # Detect if is iOS5.
264
+ def ios5?
265
+ ios? && !!(ua =~ /OS (5)/)
266
+ end
267
+
268
+ # Detect if is iOS6.
269
+ def ios6?
270
+ ios? && !!(ua =~ /OS (6)/)
271
+ end
272
+
273
+
274
+ # Detect if browser is iPad.
275
+ def ipad?
276
+ !!(ua =~ /iPad/)
277
+ end
278
+
279
+ # Detect if browser is iPod.
280
+ def ipod?
281
+ !!(ua =~ /iPod/)
282
+ end
283
+
284
+ # Detect if browser is Safari.
285
+ def safari?
286
+ ua =~ /Safari/ && ua !~ /Chrome/
287
+ end
288
+
289
+ # Detect if browser is Firefox.
290
+ def firefox?
291
+ !!(ua =~ /Firefox/)
292
+ end
293
+
294
+ # Detect if browser is Chrome.
295
+ def chrome?
296
+ !!(ua =~ /Chrome/)
297
+ end
298
+
299
+ # Detect if browser is Internet Explorer.
300
+ def ie?
301
+ !!(ua =~ /MSIE/ && ua !~ /Opera/)
302
+ end
303
+
304
+ # Detect if browser is Internet Explorer 6.
305
+ def ie6?
306
+ ie? && version == "6"
307
+ end
308
+
309
+ # Detect if browser is Internet Explorer 7.
310
+ def ie7?
311
+ ie? && version == "7"
312
+ end
313
+
314
+ # Detect if browser is Internet Explorer 8.
315
+ def ie8?
316
+ ie? && version == "8"
317
+ end
318
+
319
+ # Detect if browser is Internet Explorer 9.
320
+ def ie9?
321
+ ie? && version == "9"
322
+ end
323
+
324
+ # Detect if browser is Internet Explorer 10.
325
+ def ie10?
326
+ ie? && version == "10"
327
+ end
328
+ # Detect if browser is running from PSP.
329
+ def psp?
330
+ !!(ua =~ /PSP/)
331
+ end
332
+
333
+ # Detect if browser is Opera.
334
+ def opera?
335
+ !!(ua =~ /Opera/)
336
+ end
337
+
338
+ # Detect if browser is Opera Mini.
339
+ def opera_mini?
340
+ !!(ua =~ /Opera Mini/)
341
+ end
342
+
343
+ # Detect if current platform is Macintosh.
344
+ def mac?
345
+ !!(ua =~ /Mac OS X/)
346
+ end
347
+
348
+ # Detect if current platform is Windows.
349
+ def windows?
350
+ !!(ua =~ /Windows/)
351
+ end
352
+
353
+ # Detect if current platform is Linux flavor.
354
+ def linux?
355
+ !!(ua =~ /Linux/)
356
+ end
357
+
358
+ # Detect if browser is tablet (currently just iPad or Android).
359
+ def tablet?
360
+ !!(ipad? || (android? && !mobile?))
361
+ end
362
+
363
+ # Detect if browser is Kindle.
364
+ def kindle?
365
+ !!(ua =~ /Kindle/)
366
+ end
367
+
368
+ # Return the platform.
369
+ def platform
370
+ case
371
+ when linux? then :linux
372
+ when mac? then :mac
373
+ when windows? then :windows
374
+ else
375
+ :other
376
+ end
377
+ end
378
+
379
+ # Return a meta info about this browser.
380
+ def meta
381
+ Array.new.tap do |m|
382
+ m << id
383
+ m << "webkit" if webkit?
384
+ m << "ios" if ios?
385
+ m << "safari safari#{version}" if safari?
386
+ m << "#{id}#{version}" unless safari? || chrome?
387
+ m << platform
388
+ m << "capable" if capable?
389
+ m << "mobile" if mobile?
390
+ end
391
+ end
392
+
393
+ # Return meta representation as string.
394
+ def to_s
395
+ meta.join(" ")
396
+ end
397
+ end
398
+ end
@@ -0,0 +1,8 @@
1
+ module Brwsr
2
+ module Version
3
+ MAJOR = 1
4
+ MINOR = 1
5
+ PATCH = 0
6
+ STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
+ end
8
+ end
data/lib/brwsr.rb ADDED
@@ -0,0 +1,6 @@
1
+ module Brwsr
2
+
3
+ end
4
+
5
+ require 'brwsr/browser'
6
+ require 'brwsr/action_controller' if defined?(ActionController::Base)
@@ -0,0 +1,484 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require "test_helper"
3
+
4
+ module Brwsr
5
+ class BrowserTest < Test::Unit::TestCase
6
+ IPHONE = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/1A542a Safari/419.3"
7
+ IPOD = "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3"
8
+ IPAD = "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10"
9
+ SAFARI = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8"
10
+ IE6 = "Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)"
11
+ IE7 = "Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)"
12
+ IE8 = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)"
13
+ IE8_COMPAT = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; Media Center PC 5.0; .NET CLR 3.5.21022)"
14
+ IE9 = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
15
+ IE9_COMPAT = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)"
16
+ IE10 = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"
17
+ IE10_COMPAT = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)"
18
+ OPERA = "Opera/9.80 (Macintosh; Intel Mac OS X 10.7.4; U; en) Presto/2.10.229 Version/11.64"
19
+ FIREFOX = "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8"
20
+ CHROME = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4"
21
+ ANDROID = "Android SDK 1.5r3: Mozilla/5.0 (Linux; U; Android 1.5; de-; sdk Build/CUPCAKE) AppleWebkit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1"
22
+ TABLOID = "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"
23
+ BLACKBERRY = "BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103"
24
+ PSP = "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)"
25
+ QUICKTIME = "QuickTime/7.6.8 (qtver=7.6.8;os=Windows NT 5.1Service Pack 3)"
26
+ COREMEDIA = "Apple Mac OS X v10.6.4 CoreMedia v1.0.0.10F569"
27
+ XOOM = "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"
28
+ NEXUS_TABLET = "Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19"
29
+ OPERA_MINI = "Opera/9.80 (Android; Opera Mini/7.029952/28.2359;u; fr) Presto/2.8.119 Version/11.10"
30
+ OPERA_MOBI = "Opera/9.8 (Android 2.3.5; Linux; Opera Mobi/ADR-1205181138; U; en) Presto/2.10.254 Version/12.00"
31
+ WINDOWS_PHONE = "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DELL; Venue Pro)"
32
+ KINDLE = "Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600×800; rotate)"
33
+ KINDLE_FIRE = "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
34
+ IOS4 = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"
35
+ IOS5 = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
36
+ IOS6 = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"
37
+
38
+ def setup
39
+ @browser = Brwsr::Browser.new
40
+ end
41
+
42
+ def test_yield_self_when_block_is_given
43
+ browser = nil
44
+ Brwsr::Browser.new {|b| browser = b }
45
+ assert_kind_of Brwsr::Browser, browser
46
+ end
47
+
48
+ def test_respond_to_ua_methods
49
+ assert @browser.respond_to?(:ua)
50
+ assert @browser.respond_to?(:ua=)
51
+ end
52
+
53
+ def test_delegate_ua_methods
54
+ @browser.user_agent = "Safari"
55
+ assert_equal "Safari", @browser.ua
56
+
57
+ @browser.ua = "Mozilla"
58
+ assert_equal "Mozilla", @browser.user_agent
59
+ end
60
+
61
+ def test_set_accept_language_while_instantiating_object
62
+ @browser = Brwsr::Browser.new(:accept_language => "pt-br")
63
+ assert_equal ["pt-br"], @browser.accept_language
64
+ end
65
+
66
+ def test_set_user_agent_while_instantianting_object
67
+ @browser = Brwsr::Browser.new(:ua => "Safari")
68
+ assert_equal "Safari", @browser.ua
69
+
70
+ @browser = Brwsr::Browser.new(:user_agent => "Chrome")
71
+ assert_equal "Chrome", @browser.ua
72
+ end
73
+
74
+ def test_detect_iphone
75
+ @browser.ua = IPHONE
76
+
77
+ assert_equal "iPhone", @browser.name
78
+ assert @browser.iphone?
79
+ assert @browser.safari?
80
+ assert @browser.webkit?
81
+ assert @browser.mobile?
82
+ assert @browser.capable?
83
+ assert @browser.ios?
84
+ assert @browser.tablet? == false
85
+ assert_equal "3.0", @browser.full_version
86
+ assert_equal "3", @browser.version
87
+ end
88
+
89
+ def test_detect_safari
90
+ @browser.ua = SAFARI
91
+
92
+ assert_equal "Safari", @browser.name
93
+ assert @browser.safari?
94
+ assert @browser.webkit?
95
+ assert @browser.capable?
96
+ assert_equal "5.0.1", @browser.full_version
97
+ assert_equal "5", @browser.version
98
+ end
99
+
100
+ def test_detect_ipod
101
+ @browser.ua = IPOD
102
+
103
+ assert_equal "iPod Touch", @browser.name
104
+ assert @browser.ipod?
105
+ assert @browser.safari?
106
+ assert @browser.webkit?
107
+ assert @browser.mobile?
108
+ assert @browser.capable?
109
+ assert @browser.ios?
110
+ assert @browser.tablet? == false
111
+ assert_equal "3.0", @browser.full_version
112
+ assert_equal "3", @browser.version
113
+ end
114
+
115
+ def test_detect_ipad
116
+ @browser.ua = IPAD
117
+
118
+ assert_equal "iPad", @browser.name
119
+ assert @browser.ipad?
120
+ assert @browser.safari?
121
+ assert @browser.webkit?
122
+ assert @browser.capable?
123
+ assert @browser.ios?
124
+ assert @browser.tablet?
125
+ assert_equal "4.0.4", @browser.full_version
126
+ assert_equal "4", @browser.version
127
+ end
128
+
129
+ def test_detect_ios4
130
+ @browser.ua = IOS4
131
+ assert @browser.ios?
132
+ assert @browser.ios4?
133
+ end
134
+
135
+ def test_detect_ios5
136
+ @browser.ua = IOS5
137
+ assert @browser.ios?
138
+ assert @browser.ios5?
139
+ end
140
+
141
+ def test_detect_ios6
142
+ @browser.ua = IOS6
143
+ assert @browser.ios?
144
+ assert @browser.ios6?
145
+ end
146
+
147
+ def test_detect_ie6
148
+ @browser.ua = IE6
149
+
150
+ assert_equal "Internet Explorer", @browser.name
151
+ assert @browser.ie?
152
+ assert @browser.ie6?
153
+ assert @browser.capable? == false
154
+ assert_equal "6.0", @browser.full_version
155
+ assert_equal "6", @browser.version
156
+ end
157
+
158
+ def test_detect_ie7
159
+ @browser.ua = IE7
160
+
161
+ assert_equal "Internet Explorer", @browser.name
162
+ assert @browser.ie?
163
+ assert @browser.ie7?
164
+ assert @browser.capable?
165
+ assert_equal "7.0", @browser.full_version
166
+ assert_equal "7", @browser.version
167
+ end
168
+
169
+ def test_detect_ie8
170
+ @browser.ua = IE8
171
+
172
+ assert_equal "Internet Explorer", @browser.name
173
+ assert @browser.ie?
174
+ assert @browser.ie8?
175
+ assert @browser.capable?
176
+ assert @browser.compatibility_view? == false
177
+ assert_equal "8.0", @browser.full_version
178
+ assert_equal "8", @browser.version
179
+ end
180
+
181
+ def test_detect_ie8_in_compatibility_view
182
+ @browser.ua = IE8_COMPAT
183
+
184
+ assert_equal "Internet Explorer", @browser.name
185
+ assert @browser.ie?
186
+ assert @browser.ie7?
187
+ assert !@browser.ie8?
188
+ assert @browser.capable?
189
+ assert @browser.compatibility_view?
190
+ assert_equal "7.0", @browser.full_version
191
+ assert_equal "7", @browser.version
192
+ end
193
+
194
+ def test_detect_ie9
195
+ @browser.ua = IE9
196
+
197
+ assert_equal "Internet Explorer", @browser.name
198
+ assert @browser.ie?
199
+ assert @browser.ie9?
200
+ assert @browser.capable?
201
+ assert !@browser.compatibility_view?
202
+ assert_equal "9.0", @browser.full_version
203
+ assert_equal "9", @browser.version
204
+ end
205
+
206
+ def test_detect_ie9_in_compatibility_view
207
+ @browser.ua = IE9_COMPAT
208
+
209
+ assert_equal "Internet Explorer", @browser.name
210
+ assert @browser.ie?
211
+ assert @browser.ie7?
212
+ assert !@browser.ie9?
213
+ assert @browser.capable?
214
+ assert @browser.compatibility_view?
215
+ assert_equal "7.0", @browser.full_version
216
+ assert_equal "7", @browser.version
217
+ end
218
+
219
+ # JANK: meta programming to the rescue
220
+ def test_detect_ie10
221
+ @browser.ua = IE10
222
+
223
+ assert_equal "Internet Explorer", @browser.name
224
+ assert @browser.ie?
225
+ assert @browser.ie10?
226
+ assert @browser.capable?
227
+ assert !@browser.compatibility_view?
228
+ assert_equal "10.0", @browser.full_version
229
+ assert_equal "10", @browser.version
230
+ end
231
+
232
+ def test_detect_ie10_in_compatibility_view
233
+ @browser.ua = IE10_COMPAT
234
+
235
+ assert_equal "Internet Explorer", @browser.name
236
+ assert @browser.ie?
237
+ assert @browser.ie7?
238
+ assert !@browser.ie10?
239
+ assert @browser.capable?
240
+ assert @browser.compatibility_view?
241
+ assert_equal "7.0", @browser.full_version
242
+ assert_equal "7", @browser.version
243
+ end
244
+
245
+ def test_detect_opera
246
+ @browser.ua = OPERA
247
+
248
+ assert_equal "Opera", @browser.name
249
+ assert @browser.opera?
250
+ assert @browser.capable?
251
+ assert_equal "11.64", @browser.full_version
252
+ assert_equal "11", @browser.version
253
+ end
254
+
255
+ def test_detect_firefox
256
+ @browser.ua = FIREFOX
257
+
258
+ assert_equal "Firefox", @browser.name
259
+ assert @browser.firefox?
260
+ assert @browser.capable?
261
+ assert_equal "3.8", @browser.full_version
262
+ assert_equal "3", @browser.version
263
+ end
264
+
265
+ def test_detect_chrome
266
+ @browser.ua = CHROME
267
+
268
+ assert_equal "Chrome", @browser.name
269
+ assert @browser.chrome?
270
+ assert !@browser.safari?
271
+ assert @browser.webkit?
272
+ assert @browser.capable?
273
+ assert_equal "5.0.375.99", @browser.full_version
274
+ assert_equal "5", @browser.version
275
+ end
276
+
277
+ def test_detect_android
278
+ @browser.ua = ANDROID
279
+
280
+ assert_equal "Android", @browser.name
281
+ assert @browser.android?
282
+ assert @browser.safari?
283
+ assert @browser.webkit?
284
+ assert @browser.mobile?
285
+ assert @browser.tablet? == false
286
+ assert @browser.capable?
287
+ assert_equal "3.1.2", @browser.full_version
288
+ assert_equal "3", @browser.version
289
+ end
290
+
291
+ def test_detect_android_tablet
292
+ @browser.ua = TABLOID
293
+
294
+ assert_equal "Android", @browser.name
295
+ assert @browser.android?
296
+ assert @browser.safari?
297
+ assert @browser.webkit?
298
+ assert @browser.mobile? == false
299
+ assert @browser.tablet?
300
+ assert @browser.capable?
301
+ assert_equal "4.0", @browser.full_version
302
+ assert_equal "4", @browser.version
303
+ end
304
+
305
+ def test_detect_blackberry
306
+ @browser.ua = BLACKBERRY
307
+
308
+ assert_equal "BlackBerry", @browser.name
309
+ assert @browser.blackberry?
310
+ assert @browser.tablet? == false
311
+ assert @browser.mobile?
312
+ assert @browser.capable? == false
313
+ assert_equal "4.1.0", @browser.full_version
314
+ assert_equal "4", @browser.version
315
+ end
316
+
317
+ def test_detect_quicktime
318
+ @browser.ua = QUICKTIME
319
+
320
+ assert_equal "QuickTime", @browser.name
321
+ assert @browser.quicktime?
322
+ assert_equal "7.6.8", @browser.full_version
323
+ assert_equal "7", @browser.version
324
+ end
325
+
326
+ def test_detect_core_media
327
+ @browser.ua = COREMEDIA
328
+
329
+ assert_equal "Apple CoreMedia", @browser.name
330
+ assert @browser.core_media?
331
+ assert_equal "1.0.0.10F569", @browser.full_version
332
+ assert_equal "1", @browser.version
333
+ end
334
+
335
+ def test_detect_psp
336
+ @browser.ua = PSP
337
+
338
+ assert_equal "PlayStation Portable", @browser.name
339
+ assert @browser.psp?
340
+ assert @browser.mobile?
341
+ end
342
+
343
+ def test_detect_other_mobiles
344
+ @browser.ua = "Symbian OS"
345
+ assert @browser.mobile?
346
+ assert @browser.tablet? == false
347
+
348
+ @browser.ua = "MIDP-2.0"
349
+ assert @browser.mobile?
350
+ assert @browser.tablet? == false
351
+
352
+ @browser.ua = "Windows CE"
353
+ assert @browser.mobile?
354
+ assert @browser.tablet? == false
355
+
356
+ end
357
+
358
+ def test_return_a_zero_version
359
+ @browser.ua = "Bot"
360
+ assert_equal "0.0", @browser.full_version
361
+ assert_equal "0", @browser.version
362
+ end
363
+
364
+ def test_meta
365
+ @browser.ua = CHROME
366
+ assert_kind_of Array, @browser.meta
367
+ end
368
+
369
+ def test_return_string_representation
370
+ @browser.ua = CHROME
371
+ assert_equal "chrome webkit mac capable", @browser.to_s
372
+ end
373
+
374
+ def test_return_string_representation_for_ios
375
+ @browser.ua = IPHONE
376
+ assert_equal "iphone webkit ios safari safari3 mac capable mobile", @browser.to_s
377
+ end
378
+
379
+ def test_return_string_representation_for_mobile
380
+ @browser.ua = BLACKBERRY
381
+ assert_equal "blackberry blackberry4 other mobile", @browser.to_s
382
+ end
383
+
384
+ def test_return_string_representation_for_handcap
385
+ @browser.ua = IE6
386
+ assert_equal "ie ie6 windows", @browser.to_s
387
+ end
388
+
389
+ def test_detect_unknown_id
390
+ @browser.ua = "Unknown"
391
+ assert_equal :other, @browser.id
392
+ end
393
+
394
+ def test_detect_unknown_name
395
+ @browser.ua = "Unknown"
396
+ assert_equal "Other", @browser.name
397
+ end
398
+
399
+ def test_detect_mac_platform
400
+ @browser.ua = "Mac OS X"
401
+ assert_equal :mac, @browser.platform
402
+ end
403
+
404
+ def test_detect_windows_platform
405
+ @browser.ua = "Windows"
406
+ assert_equal :windows, @browser.platform
407
+ end
408
+
409
+ def test_detect_linux_platform
410
+ @browser.ua = "Linux"
411
+ assert_equal :linux, @browser.platform
412
+ end
413
+
414
+ def test_detect_unknown_platform
415
+ @browser.ua = "Unknown"
416
+ assert_equal :other, @browser.platform
417
+ end
418
+
419
+ def test_return_all_known_languages
420
+ @browser.accept_language = "en-us,en;q=0.8,pt-br;q=0.5,pt;q=0.3"
421
+ assert_equal ["en-us", "en", "pt-br", "pt"], @browser.accept_language
422
+ end
423
+
424
+ def test_pimp_action_controller
425
+ methods = ActionController::Base.private_instance_methods.collect {|m| m.to_sym}
426
+ assert methods.include?(:brwsr)
427
+ end
428
+
429
+ def test_xoom
430
+ @browser.ua = XOOM
431
+
432
+ assert @browser.android?
433
+ assert @browser.tablet?
434
+ assert !@browser.mobile?
435
+ end
436
+
437
+ def test_nexus_tablet
438
+ @browser.ua = NEXUS_TABLET
439
+
440
+ assert @browser.android?
441
+ assert @browser.tablet?
442
+ assert !@browser.mobile?
443
+ end
444
+
445
+ def test_opera_mini
446
+ @browser.ua = OPERA_MINI
447
+
448
+ assert @browser.opera_mini?
449
+ assert !@browser.tablet?
450
+ assert @browser.mobile?
451
+ end
452
+
453
+ def test_opera_mobi
454
+ @browser.ua = OPERA_MOBI
455
+
456
+ assert @browser.opera?
457
+ assert !@browser.tablet?
458
+ assert @browser.mobile?
459
+ end
460
+
461
+ def test_windows_phone
462
+ @browser.ua = WINDOWS_PHONE
463
+
464
+ assert @browser.ie?
465
+ assert_equal "7", @browser.version
466
+ assert @browser.mobile?
467
+ assert !@browser.tablet?
468
+ end
469
+
470
+ def test_kindle_monochrome
471
+ @browser.ua = KINDLE
472
+
473
+ assert @browser.kindle?
474
+ assert @browser.webkit?
475
+ end
476
+
477
+ def test_kindle_fire
478
+ @browser.ua = KINDLE_FIRE
479
+
480
+ assert @browser.kindle?
481
+ assert @browser.webkit?
482
+ end
483
+ end
484
+ end
@@ -0,0 +1,3 @@
1
+ require "test/unit"
2
+ require "action_controller"
3
+ require "brwsr"
metadata ADDED
@@ -0,0 +1,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brwsr
3
+ version: !ruby/object:Gem::Version
4
+ hash: 19
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 0
10
+ version: 1.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Nando Vieira
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2013-01-08 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: actionpack
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: rake
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: rdoc
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ type: :development
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: pry
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :development
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: awesome_print
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :development
89
+ version_requirements: *id005
90
+ description: Do some browser detection with Ruby.
91
+ email:
92
+ - fnando.vieira@gmail.com
93
+ executables: []
94
+
95
+ extensions: []
96
+
97
+ extra_rdoc_files: []
98
+
99
+ files:
100
+ - .gitignore
101
+ - .travis.yml
102
+ - Gemfile
103
+ - Gemfile.lock
104
+ - Guardfile
105
+ - HISTORY.md
106
+ - README.rdoc
107
+ - Rakefile
108
+ - browser.gemspec
109
+ - lib/brwsr.rb
110
+ - lib/brwsr/action_controller.rb
111
+ - lib/brwsr/browser.rb
112
+ - lib/brwsr/version.rb
113
+ - test/brwsr_test.rb
114
+ - test/test_helper.rb
115
+ homepage: http://github.com/fnando/browser
116
+ licenses: []
117
+
118
+ post_install_message:
119
+ rdoc_options: []
120
+
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 0
131
+ version: "0"
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ none: false
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ hash: 3
138
+ segments:
139
+ - 0
140
+ version: "0"
141
+ requirements: []
142
+
143
+ rubyforge_project:
144
+ rubygems_version: 1.8.15
145
+ signing_key:
146
+ specification_version: 3
147
+ summary: Do some browser detection with Ruby.
148
+ test_files:
149
+ - test/brwsr_test.rb
150
+ - test/test_helper.rb