browser 3.0.1 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/.gitignore +1 -0
- data/.prettierignore +1 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +60 -16
- data/README.md +22 -46
- data/bots.yml +300 -294
- data/browser.gemspec +3 -1
- data/lib/browser/base.rb +10 -5
- data/lib/browser/browser.rb +5 -24
- data/lib/browser/chrome.rb +6 -2
- data/lib/browser/duck_duck_go.rb +22 -0
- data/lib/browser/edge.rb +2 -2
- data/lib/browser/meta.rb +0 -1
- data/lib/browser/meta/base.rb +0 -1
- data/lib/browser/platform.rb +1 -1
- data/lib/browser/platform/base.rb +3 -2
- data/lib/browser/platform/mac.rb +3 -1
- data/lib/browser/safari.rb +8 -1
- data/lib/browser/samsung_browser.rb +21 -0
- data/lib/browser/version.rb +1 -1
- data/test/test_helper.rb +8 -0
- data/test/ua.yml +9 -1
- data/test/ua_bots.yml +8 -2
- data/test/unit/duck_duck_go_test.rb +35 -0
- data/test/unit/edge_test.rb +34 -2
- data/test/unit/micro_messenger_test.rb +21 -6
- data/test/unit/platform_test.rb +6 -1
- data/test/unit/samsung_browser_test.rb +23 -0
- metadata +12 -6
- data/.bundle/config +0 -2
- data/lib/browser/meta/modern.rb +0 -11
data/test/unit/platform_test.rb
CHANGED
@@ -104,7 +104,7 @@ class PlatformTest < Minitest::Test
|
|
104
104
|
test "detect mac" do
|
105
105
|
platform = Browser::Platform.new(Browser["SAFARI"])
|
106
106
|
|
107
|
-
assert_equal "
|
107
|
+
assert_equal "Mac OS X", platform.name
|
108
108
|
assert_equal :mac, platform.id
|
109
109
|
assert platform.mac?
|
110
110
|
assert_equal "10.6.4", platform.version
|
@@ -116,6 +116,11 @@ class PlatformTest < Minitest::Test
|
|
116
116
|
assert_equal "0", platform.version
|
117
117
|
end
|
118
118
|
|
119
|
+
test "detect mac names" do
|
120
|
+
assert_equal "Mac OS X", Browser::Platform.new(Browser["MAC_OSX"]).name
|
121
|
+
assert_equal "macOS", Browser::Platform.new(Browser["MAC_OS"]).name
|
122
|
+
end
|
123
|
+
|
119
124
|
test "detect firefox os" do
|
120
125
|
platform = Browser::Platform.new(Browser["FIREFOX_OS"])
|
121
126
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class SamsungBrowserTest < Minitest::Test
|
6
|
+
test "detects samsung browser" do
|
7
|
+
browser = Browser.new(Browser["SAMSUNG_BROWSER"])
|
8
|
+
|
9
|
+
assert browser.webkit?
|
10
|
+
assert browser.samsung_browser?
|
11
|
+
assert_equal "11", browser.version
|
12
|
+
assert_equal :samsung_browser, browser.id
|
13
|
+
assert_equal "11.1", browser.full_version
|
14
|
+
assert_equal "Samsung Browser", browser.name
|
15
|
+
refute browser.chrome?
|
16
|
+
refute browser.safari?
|
17
|
+
end
|
18
|
+
|
19
|
+
test "detects version by range" do
|
20
|
+
browser = Browser.new(Browser["SAMSUNG_BROWSER"])
|
21
|
+
assert browser.samsung_browser?(%w[>=11 <12])
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -171,9 +171,9 @@ executables: []
|
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
|
-
- ".bundle/config"
|
175
174
|
- ".github/ISSUE_TEMPLATE.md"
|
176
175
|
- ".gitignore"
|
176
|
+
- ".prettierignore"
|
177
177
|
- ".rubocop.yml"
|
178
178
|
- ".travis.yml"
|
179
179
|
- CHANGELOG.md
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/browser/device/wiiu.rb
|
223
223
|
- lib/browser/device/xbox_360.rb
|
224
224
|
- lib/browser/device/xbox_one.rb
|
225
|
+
- lib/browser/duck_duck_go.rb
|
225
226
|
- lib/browser/edge.rb
|
226
227
|
- lib/browser/electron.rb
|
227
228
|
- lib/browser/facebook.rb
|
@@ -237,7 +238,6 @@ files:
|
|
237
238
|
- lib/browser/meta/ie.rb
|
238
239
|
- lib/browser/meta/ios.rb
|
239
240
|
- lib/browser/meta/mobile.rb
|
240
|
-
- lib/browser/meta/modern.rb
|
241
241
|
- lib/browser/meta/platform.rb
|
242
242
|
- lib/browser/meta/proxy.rb
|
243
243
|
- lib/browser/meta/safari.rb
|
@@ -269,6 +269,7 @@ files:
|
|
269
269
|
- lib/browser/qq.rb
|
270
270
|
- lib/browser/rails.rb
|
271
271
|
- lib/browser/safari.rb
|
272
|
+
- lib/browser/samsung_browser.rb
|
272
273
|
- lib/browser/snapchat.rb
|
273
274
|
- lib/browser/sputnik.rb
|
274
275
|
- lib/browser/testing.rb
|
@@ -296,6 +297,7 @@ files:
|
|
296
297
|
- test/unit/chrome_test.rb
|
297
298
|
- test/unit/console_test.rb
|
298
299
|
- test/unit/device_test.rb
|
300
|
+
- test/unit/duck_duck_go_test.rb
|
299
301
|
- test/unit/edge_test.rb
|
300
302
|
- test/unit/electron_test.rb
|
301
303
|
- test/unit/facebook_test.rb
|
@@ -315,6 +317,7 @@ files:
|
|
315
317
|
- test/unit/proxy_test.rb
|
316
318
|
- test/unit/qq_test.rb
|
317
319
|
- test/unit/safari_test.rb
|
320
|
+
- test/unit/samsung_browser_test.rb
|
318
321
|
- test/unit/snapchat_test.rb
|
319
322
|
- test/unit/sputnik_test.rb
|
320
323
|
- test/unit/uc_browser_test.rb
|
@@ -322,10 +325,11 @@ files:
|
|
322
325
|
- test/unit/windows_phone_test.rb
|
323
326
|
- test/unit/windows_test.rb
|
324
327
|
- test/unit/yandex_test.rb
|
325
|
-
homepage:
|
328
|
+
homepage: https://github.com/fnando/browser
|
326
329
|
licenses:
|
327
330
|
- MIT
|
328
|
-
metadata:
|
331
|
+
metadata:
|
332
|
+
changelog_uri: https://github.com/fnando/browser/blob/master/CHANGELOG.md
|
329
333
|
post_install_message:
|
330
334
|
rdoc_options: []
|
331
335
|
require_paths:
|
@@ -365,6 +369,7 @@ test_files:
|
|
365
369
|
- test/unit/chrome_test.rb
|
366
370
|
- test/unit/console_test.rb
|
367
371
|
- test/unit/device_test.rb
|
372
|
+
- test/unit/duck_duck_go_test.rb
|
368
373
|
- test/unit/edge_test.rb
|
369
374
|
- test/unit/electron_test.rb
|
370
375
|
- test/unit/facebook_test.rb
|
@@ -384,6 +389,7 @@ test_files:
|
|
384
389
|
- test/unit/proxy_test.rb
|
385
390
|
- test/unit/qq_test.rb
|
386
391
|
- test/unit/safari_test.rb
|
392
|
+
- test/unit/samsung_browser_test.rb
|
387
393
|
- test/unit/snapchat_test.rb
|
388
394
|
- test/unit/sputnik_test.rb
|
389
395
|
- test/unit/uc_browser_test.rb
|
data/.bundle/config
DELETED