woothee 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/woothee/browser.rb +3 -1
- data/lib/woothee/dataset.rb +4 -1
- data/lib/woothee/os.rb +2 -1
- data/spec/00_valid_spec.rb +2 -2
- data/spec/01_dataset_spec.rb +3 -3
- data/spec/02_run_testsets_spec.rb +0 -2
- data/woothee.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a5c3078285a34a3f7d67fe200d7277c3c5284a
|
4
|
+
data.tar.gz: 93a32166115fcc0e3d1654e3e3e16f8132a826f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdae3c0a784faeeb9d389c43f9426681c4b97eb1bf5e430be936629b07be05452ea21132af9688cb170281549d767cb94001e7bee49a14c76e454bca1ce252ac
|
7
|
+
data.tar.gz: d7dc70ec8d0a9a5e1737a592622a0224e827a6313719f1537ca6f9c6158725256707f692d4a8cd20e0a4df93e6542c0ed953d8379906c9a1b0521fd788137a41
|
data/lib/woothee/browser.rb
CHANGED
@@ -7,10 +7,12 @@ module Woothee::Browser
|
|
7
7
|
extend Woothee::Util
|
8
8
|
|
9
9
|
def self.challenge_msie(ua, result)
|
10
|
-
return false if ua.index("compatible; MSIE").nil?
|
10
|
+
return false if ua.index("compatible; MSIE").nil? && ua.index("Trident/").nil?
|
11
11
|
|
12
12
|
version = if ua =~ /MSIE ([.0-9]+);/o
|
13
13
|
$1
|
14
|
+
elsif ua =~ /Trident\/([.0-9]+); rv ([.0-9]+)/o
|
15
|
+
$2
|
14
16
|
else
|
15
17
|
Woothee::VALUE_UNKNOWN
|
16
18
|
end
|
data/lib/woothee/dataset.rb
CHANGED
@@ -33,7 +33,7 @@ end
|
|
33
33
|
|
34
34
|
module Woothee::DataSet
|
35
35
|
DATASET = {}
|
36
|
-
# GENERATED from dataset.yaml at Mon
|
36
|
+
# GENERATED from dataset.yaml at Mon Sep 2 19:55:04 JST 2013 by tagomoris
|
37
37
|
obj = {:label => 'MSIE', :name => 'Internet Explorer', :type => :browser}
|
38
38
|
obj[:vendor] = 'Microsoft'
|
39
39
|
DATASET[obj[:label]] = obj
|
@@ -55,6 +55,9 @@ module Woothee::DataSet
|
|
55
55
|
obj = {:label => 'Win', :name => 'Windows UNKNOWN Ver', :type => :os}
|
56
56
|
obj[:category] = :pc
|
57
57
|
DATASET[obj[:label]] = obj
|
58
|
+
obj = {:label => 'Win8.1', :name => 'Windows 8.1', :type => :os}
|
59
|
+
obj[:category] = :pc
|
60
|
+
DATASET[obj[:label]] = obj
|
58
61
|
obj = {:label => 'Win8', :name => 'Windows 8', :type => :os}
|
59
62
|
obj[:category] = :pc
|
60
63
|
DATASET[obj[:label]] = obj
|
data/lib/woothee/os.rb
CHANGED
@@ -18,7 +18,8 @@ module Woothee::OS
|
|
18
18
|
end
|
19
19
|
|
20
20
|
version = $1
|
21
|
-
data = case
|
21
|
+
data = case
|
22
|
+
when version == 'NT 6.3' then Woothee::DataSet.get('Win8.1')
|
22
23
|
when version == 'NT 6.2' then Woothee::DataSet.get('Win8')
|
23
24
|
when version == 'NT 6.1' then Woothee::DataSet.get('Win7')
|
24
25
|
when version == 'NT 6.0' then Woothee::DataSet.get('WinVista')
|
data/spec/00_valid_spec.rb
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
describe Woothee do
|
9
9
|
it "should be read from each modules correctly" do
|
10
|
-
|
11
|
-
|
10
|
+
expect { require 'woothee/dataset' }.not_to raise_error()
|
11
|
+
expect { require 'woothee' }.not_to raise_error()
|
12
12
|
end
|
13
13
|
end
|
data/spec/01_dataset_spec.rb
CHANGED
@@ -6,13 +6,13 @@ require 'woothee/dataset'
|
|
6
6
|
|
7
7
|
describe Woothee::DataSet do
|
8
8
|
it "contains constants" do
|
9
|
-
lambda { Woothee::ATTRIBUTE_NAME }.should_not raise_error(
|
9
|
+
lambda { Woothee::ATTRIBUTE_NAME }.should_not raise_error()
|
10
10
|
Woothee::ATTRIBUTE_NAME.should eql(:name)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "contains list of categories/attributes" do
|
14
|
-
lambda { Woothee::ATTRIBUTE_LIST }.should_not raise_error(
|
15
|
-
lambda { Woothee::CATEGORY_LIST }.should_not raise_error(
|
14
|
+
lambda { Woothee::ATTRIBUTE_LIST }.should_not raise_error()
|
15
|
+
lambda { Woothee::CATEGORY_LIST }.should_not raise_error()
|
16
16
|
Woothee::ATTRIBUTE_LIST.should eql([
|
17
17
|
Woothee::ATTRIBUTE_NAME, Woothee::ATTRIBUTE_CATEGORY, Woothee::ATTRIBUTE_OS,
|
18
18
|
Woothee::ATTRIBUTE_VENDOR, Woothee::ATTRIBUTE_VERSION,
|
data/woothee.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.description = "Cross-language UserAgent classifier library, ruby implementation"
|
7
7
|
gem.homepage = "https://github.com/tagomoris/woothee"
|
8
8
|
gem.summary = gem.description
|
9
|
-
gem.version = "0.3.
|
9
|
+
gem.version = "0.3.3"
|
10
10
|
gem.authors = ["TAGOMORI Satoshi"]
|
11
11
|
gem.email = "tagomoris@gmail.com"
|
12
12
|
gem.has_rdoc = false
|
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
67
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.0.
|
68
|
+
rubygems_version: 2.0.3
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: Cross-language UserAgent classifier library, ruby implementation
|
@@ -73,3 +73,4 @@ test_files:
|
|
73
73
|
- spec/00_valid_spec.rb
|
74
74
|
- spec/01_dataset_spec.rb
|
75
75
|
- spec/02_run_testsets_spec.rb
|
76
|
+
has_rdoc: false
|