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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13da5f2dcefa4793ff7a8868504db2965fe0dc86
4
- data.tar.gz: a57fad8bf90c80c9a21d840a6304a1b75b762293
3
+ metadata.gz: c9a5c3078285a34a3f7d67fe200d7277c3c5284a
4
+ data.tar.gz: 93a32166115fcc0e3d1654e3e3e16f8132a826f4
5
5
  SHA512:
6
- metadata.gz: a678ca5fbe5b9731c34b895c1831a8fdbf99ba370c73bd6e791b66da12b8fe8fa95b585cddc434f9ff3ba8112847be51400bc0f9221c18e2e7e1a09ba828539b
7
- data.tar.gz: 7ef9e2d99119fb99861cefe8e1c7306ddeb625845db13459ee3c61d52fce9543d17546c6fc2e7023041ee58a71d7cb2f166d7b4307a095a0f87d4c0b26b5e406
6
+ metadata.gz: cdae3c0a784faeeb9d389c43f9426681c4b97eb1bf5e430be936629b07be05452ea21132af9688cb170281549d767cb94001e7bee49a14c76e454bca1ce252ac
7
+ data.tar.gz: d7dc70ec8d0a9a5e1737a592622a0224e827a6313719f1537ca6f9c6158725256707f692d4a8cd20e0a4df93e6542c0ed953d8379906c9a1b0521fd788137a41
@@ -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
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  module Woothee::DataSet
35
35
  DATASET = {}
36
- # GENERATED from dataset.yaml at Mon Jun 10 18:14:36 JST 2013 by tagomoris
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')
@@ -7,7 +7,7 @@ end
7
7
 
8
8
  describe Woothee do
9
9
  it "should be read from each modules correctly" do
10
- lambda { require 'woothee/dataset' }.should_not raise_error(LoadError)
11
- lambda { require 'woothee' }.should_not raise_error(LoadError)
10
+ expect { require 'woothee/dataset' }.not_to raise_error()
11
+ expect { require 'woothee' }.not_to raise_error()
12
12
  end
13
13
  end
@@ -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(NameError)
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(NameError)
15
- lambda { Woothee::CATEGORY_LIST }.should_not raise_error(NameError)
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,
@@ -22,7 +22,6 @@ TARGETS = [
22
22
  ]
23
23
 
24
24
  describe Woothee do
25
-
26
25
  TARGETS.each do |filename,groupname|
27
26
  YAML.load_file(TESTSET_DIR + filename).each do |e|
28
27
  r = Woothee.parse(e['target'])
@@ -35,5 +34,4 @@ describe Woothee do
35
34
  end
36
35
  end
37
36
  end
38
-
39
37
  end
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.2"
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.2
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-06-10 00:00:00.000000000 Z
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.2
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