useragent_parser 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ module UseragentParser
20
20
  end
21
21
 
22
22
  def os_version
23
- @browser_version ||= "#{os_major_version}.#{os_minor_version}.#{os_patch_version}".gsub(/\.+$/, '').strip
23
+ @os_version ||= "#{os_major_version}.#{os_minor_version}.#{os_patch_version}".gsub(/\.+$/, '').strip
24
24
  end
25
25
 
26
26
  def os
@@ -1,3 +1,3 @@
1
1
  module UseragentParser
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -158,4 +158,12 @@ describe UseragentParser::UserAgent do
158
158
  UseragentParser::UserAgent.new({ 'os_family' => 'FreeBSD' }).os.should == 'FreeBSD'
159
159
  end
160
160
  end
161
+
162
+ it "should confuse operating system and browser version" do
163
+ ua = UseragentParser::UserAgent.new({ 'os_family' => 'Mac OS X', 'os_v1' => '10', 'os_v2' => '7', 'os_v3' => '2', 'family' => 'Chrome', 'v1' => '14', 'v2' => '0', 'v3' => '835' })
164
+ ua.browser_family.should == 'Chrome'
165
+ ua.browser_version.should == '14.0.835'
166
+ ua.os_family.should == 'Mac OS X'
167
+ ua.os_version.should == '10.7.2'
168
+ end
161
169
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: useragent_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-23 00:00:00.000000000 Z
12
+ date: 2011-09-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70149734670220 !ruby/object:Gem::Requirement
16
+ requirement: &70218494984620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70149734670220
24
+ version_requirements: *70218494984620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70149734667680 !ruby/object:Gem::Requirement
27
+ requirement: &70218495033460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.6.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70149734667680
35
+ version_requirements: *70218495033460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_json
38
- requirement: &70149734667040 !ruby/object:Gem::Requirement
38
+ requirement: &70218495032760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 1.0.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70149734667040
46
+ version_requirements: *70218495032760
47
47
  description: UseragentParser extracts browser and operating system information from
48
48
  the headers sent by most browsers and email clients
49
49
  email:
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  segments:
86
86
  - 0
87
- hash: -1317810903120692867
87
+ hash: -1051950562318165295
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
@@ -93,10 +93,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -1317810903120692867
96
+ hash: -1051950562318165295
97
97
  requirements: []
98
98
  rubyforge_project: useragent_parser
99
- rubygems_version: 1.8.10
99
+ rubygems_version: 1.8.6
100
100
  signing_key:
101
101
  specification_version: 3
102
102
  summary: A library to extract informtion from Useragent headers