useragent 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/user_agent.rb +1 -2
- data/lib/user_agent/browsers.rb +3 -3
- data/lib/user_agent/browsers/{all.rb → base.rb} +1 -1
- data/lib/user_agent/browsers/chrome.rb +1 -1
- data/lib/user_agent/browsers/gecko.rb +1 -1
- data/lib/user_agent/browsers/internet_explorer.rb +1 -1
- data/lib/user_agent/browsers/opera.rb +1 -1
- data/lib/user_agent/browsers/webkit.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2754f847309df982314904e199ceb1a2330ee16
|
4
|
+
data.tar.gz: 9f51e5fd8fa695b019bd689460944a97aa633517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1287809659ebbf180b230f8145e11532266db9cd7af33db141f40de75fa459921a68bac3e512ed00fcd3389f845022632ab7733ed42fdc743b6be5133a01f79
|
7
|
+
data.tar.gz: 3ddbef57e44135b8e83479c2bf4d0e55912e01e4d2d1575e69001c5b5c97054d2d865e1c31fcd9a3064ce09723cb6715e87e0dc2431913f9f3b69e04f590e97a
|
data/lib/user_agent.rb
CHANGED
@@ -18,13 +18,12 @@ class UserAgent
|
|
18
18
|
string = DEFAULT_USER_AGENT
|
19
19
|
end
|
20
20
|
|
21
|
-
agents =
|
21
|
+
agents = Browsers::Base.new
|
22
22
|
while m = string.to_s.match(MATCHER)
|
23
23
|
agents << new(m[1], m[2], m[4])
|
24
24
|
string = string[m[0].length..-1].strip
|
25
25
|
end
|
26
26
|
Browsers.extend(agents)
|
27
|
-
agents
|
28
27
|
end
|
29
28
|
|
30
29
|
attr_reader :product, :version, :comment
|
data/lib/user_agent/browsers.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'user_agent/browsers/
|
1
|
+
require 'user_agent/browsers/base'
|
2
2
|
require 'user_agent/browsers/chrome'
|
3
3
|
require 'user_agent/browsers/gecko'
|
4
4
|
require 'user_agent/browsers/internet_explorer'
|
@@ -18,10 +18,10 @@ class UserAgent
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.extend(array)
|
21
|
-
array.extend(All)
|
22
21
|
all.each do |extension|
|
23
|
-
return
|
22
|
+
return extension.new(array) if extension.extend?(array)
|
24
23
|
end
|
24
|
+
array
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useragent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Peek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -47,7 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- lib/user_agent.rb
|
49
49
|
- lib/user_agent/browsers.rb
|
50
|
-
- lib/user_agent/browsers/
|
50
|
+
- lib/user_agent/browsers/base.rb
|
51
51
|
- lib/user_agent/browsers/chrome.rb
|
52
52
|
- lib/user_agent/browsers/gecko.rb
|
53
53
|
- lib/user_agent/browsers/internet_explorer.rb
|