woothee 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 959024515294a3ba6229bbbda28d941bdeb370ff
4
- data.tar.gz: ba6e45c2f168b2c868373e39bb309f6c1c57724d
3
+ metadata.gz: 2d213c721164114bb24bf551f2b6d94c30d2984c
4
+ data.tar.gz: 9626b6eef2d873086f0340fa1b45468008bf780c
5
5
  SHA512:
6
- metadata.gz: 5ffebc5751ed825d109e697c9da79a4d33c60e6fcff26028091ace1218702abf2d704e0daaa9796f07418899ce4a0b417c6d1afab612bf286197ba9493f3f9db
7
- data.tar.gz: d92408ac0e398c7d5a134bcb2996c1b254a570c1326f3e1003ca9dbcf61be4cca58b013b4534d9c143c105e98be242c9d80f3bf8315a221bee9d3178771077c4
6
+ metadata.gz: 5d8ac65f61d82dc005238538f4da5109cb41fe0cf5eb8fc0d65721093ac80805c21fd9d3d94c255bfdaa3f032cc02cc6fc91205d06c8279552ecb6a743f80b9a
7
+ data.tar.gz: f09d36c3e3272421931b86de9e75e5bb65a659dac4931154e9777302ba885f8f9e6111a3287cc1b4640317cebb12115bda15465523c9715f4cb234b2eede22aa
data/.travis.yml CHANGED
@@ -4,6 +4,7 @@ rvm:
4
4
  - "2.0"
5
5
  - "2.1"
6
6
  - "2.2"
7
+ - "2.3.1"
7
8
  - "jruby-19mode"
8
9
  before_script:
9
10
  - git submodule update --init
data/lib/woothee.rb CHANGED
@@ -13,7 +13,7 @@ require 'woothee/version'
13
13
  module Woothee
14
14
  def self.parse(useragent)
15
15
  fill_result(exec_parse(useragent))
16
- end
16
+ end
17
17
 
18
18
  def self.is_crawler(useragent)
19
19
  !!useragent && useragent.length > 0 and useragent != '-' and try_crawler(useragent, {})
@@ -71,6 +71,8 @@ module Woothee
71
71
  def self.try_browser(useragent, result)
72
72
  return true if Woothee::Browser.challenge_msie(useragent, result)
73
73
 
74
+ return true if Woothee::Browser.challenge_vivaldi(useragent, result)
75
+
74
76
  return true if Woothee::Browser.challenge_safari_chrome(useragent, result)
75
77
 
76
78
  return true if Woothee::Browser.challenge_firefox(useragent, result)
@@ -136,4 +136,16 @@ module Woothee::Browser
136
136
 
137
137
  true
138
138
  end
139
+
140
+ def self.challenge_vivaldi(ua, result)
141
+ return false if ua.index('Vivaldi/').nil?
142
+
143
+ version = if ua =~ /Vivaldi\/([.0-9]+)/o
144
+ $1
145
+ else
146
+ Woothee::VALUE_UNKNOWN
147
+ end
148
+ update_map(result, Woothee::DataSet.get('Vivaldi'))
149
+ update_version(result, version)
150
+ end
139
151
  end
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  module Woothee::DataSet
37
37
  DATASET = {}
38
- # GENERATED from dataset.yaml at Tue Aug 11 16:54:38 JST 2015 by tagomoris
38
+ # GENERATED from dataset.yaml at Tue May 17 02:25:25 JST 2016 by yuya
39
39
  obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
40
40
  obj[:vendor] = 'Microsoft'
41
41
  DATASET[obj[:label]] = obj
@@ -54,6 +54,9 @@ module Woothee::DataSet
54
54
  obj = {:label => 'Opera', :name => 'Opera', :type => :browser}
55
55
  obj[:vendor] = 'Opera'
56
56
  DATASET[obj[:label]] = obj
57
+ obj = {:label => 'Vivaldi', :name => 'Vivaldi', :type => :browser}
58
+ obj[:vendor] = 'Vivaldi Technologies'
59
+ DATASET[obj[:label]] = obj
57
60
  obj = {:label => 'Sleipnir', :name => 'Sleipnir', :type => :browser}
58
61
  obj[:vendor] = 'Fenrir Inc.'
59
62
  DATASET[obj[:label]] = obj
@@ -1,3 +1,3 @@
1
1
  module Woothee
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woothee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-22 00:00:00.000000000 Z
11
+ date: 2016-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.4.5
89
+ rubygems_version: 2.5.1
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Cross-language UserAgent classifier library, ruby implementation