woothee 0.4.0 → 0.4.1

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: 0eb66c8f34c7cddc728a48dfaafdbbb9b32d46d2
4
- data.tar.gz: 0ac4c169c485a76035d1512285bbfa0e3b352451
3
+ metadata.gz: 0a8f09fb64413bb4f5a1a6aaee714da4c3bd1083
4
+ data.tar.gz: 2012053f1446ddd7877a2bfafcdbffc9dc47aa3d
5
5
  SHA512:
6
- metadata.gz: f75d4f18a4f46c303ae35122054626715b504583796f46c1fd2b827ac2e2d4036c81b1822cb16681a7be2e1ec284cb31ac6cdc222acbc009deb9bd369a7257c7
7
- data.tar.gz: 99bbfbb5bd66792c092642bbe4fc7f22ae4b7ff235f04f50d1e69d8fd13f163b84b61df6b93a412f40a5557c01883f7cb1b29b98112f13032b9f47724b3a167e
6
+ metadata.gz: 33f486a66c52ab80b38cc8c1481c934d8f3869c5a3f04d2974f7f00ffb8e4d596c62ea448fb0d3e94ae5a9c92ae45f106e8a4cc9ed07bfb93f40bc3cb1080a51
7
+ data.tar.gz: a25d7a7df05ce0e3f5622838c526d29bb0a2f340cdf5067234f627db227110b4118c492eccb03c80726864e1d4f79507ea9e2473ab9e76a6f5dc77ec0fecfb10
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  module Woothee::DataSet
35
35
  DATASET = {}
36
- # GENERATED from dataset.yaml at Tue Dec 3 19:37:52 JST 2013 by tagomoris
36
+ # GENERATED from dataset.yaml at Fri Apr 25 12:56:38 JST 2014 by tagomoris
37
37
  obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
38
38
  obj[:vendor] = 'Microsoft'
39
39
  DATASET[obj[:label]] = obj
@@ -103,6 +103,9 @@ module Woothee::DataSet
103
103
  obj = {:label => 'BSD', :name => 'BSD', :type => :os}
104
104
  obj[:category] = :pc
105
105
  DATASET[obj[:label]] = obj
106
+ obj = {:label => 'ChromeOS', :name => 'ChromeOS', :type => :os}
107
+ obj[:category] = :pc
108
+ DATASET[obj[:label]] = obj
106
109
  obj = {:label => 'Android', :name => 'Android', :type => :os}
107
110
  obj[:category] = :smartphone
108
111
  DATASET[obj[:label]] = obj
data/lib/woothee/os.rb CHANGED
@@ -58,7 +58,7 @@ module Woothee::OS
58
58
  data = case
59
59
  when ua.index('iPhone;') then Woothee::DataSet.get('iPhone')
60
60
  when ua.index('iPad;') then Woothee::DataSet.get('iPad')
61
- when ua.index('iPod;') then Woothee::DataSet.get('iPod')
61
+ when ua.index('iPod') then Woothee::DataSet.get('iPod')
62
62
  else data
63
63
  end
64
64
  end
@@ -92,9 +92,10 @@ module Woothee::OS
92
92
  end
93
93
 
94
94
  if result[Woothee::KEY_NAME] && result[Woothee::KEY_NAME] == Woothee::DataSet.get('Firefox')[Woothee::KEY_NAME]
95
- # Firefox OS specific pattern
96
- # http://lawrencemandel.com/2012/07/27/decision-made-firefox-os-user-agent-string/
97
- if ua =~ /^Mozilla\/[.0-9]+ \(Mobile;(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/
95
+ # Firefox OS specific pattern
96
+ # http://lawrencemandel.com/2012/07/27/decision-made-firefox-os-user-agent-string/
97
+ # https://github.com/woothee/woothee/issues/2
98
+ if ua =~ /^Mozilla\/[.0-9]+ \((?:Mobile|Tablet);(.*;)? rv:[.0-9]+\) Gecko\/[.0-9]+ Firefox\/[.0-9]+$/
98
99
  data = Woothee::DataSet.get('FirefoxOS')
99
100
  end
100
101
  end
@@ -174,6 +175,8 @@ module Woothee::OS
174
175
  Woothee::DataSet.get('MacOS')
175
176
  when ua.index('X11; FreeBSD ')
176
177
  Woothee::DataSet.get('BSD')
178
+ when ua.index('X11; CrOS ')
179
+ Woothee::DataSet.get('ChromeOS')
177
180
  else
178
181
  nil
179
182
  end
@@ -1,3 +1,3 @@
1
1
  module Woothee
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
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: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec