which_browser 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/which_browser.rb CHANGED
@@ -72,11 +72,11 @@ module WhichBrowser
72
72
  end
73
73
 
74
74
  def ie?
75
- test_user_agent(/MSIE\s[56789]/)
75
+ test_user_agent(/MSIE/)
76
76
  end
77
77
 
78
78
  def old_ie?
79
- test_user_agent(/MSIE\s[456]/)
79
+ test_user_agent(/MSIE\s[4567]/)
80
80
  end
81
81
 
82
82
 
@@ -1,3 +1,3 @@
1
1
  module WhichBrowser
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/test/helper.rb CHANGED
@@ -23,9 +23,10 @@ register :Safari, '4.0.1', :'OS X 10.5', :webkit, '531.2', 'Mozilla/5.0
23
23
  register :Safari, '4.0', :'Windows Vista', :webkit, '528.16', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru-RU) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16'
24
24
  register :Safari, '3.2.3', :'Windows XP', :webkit, '525.28.3', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; cs-CZ) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.29'
25
25
 
26
- register :MobileSafari, 'iPhone', :'iPhone OS 4_1', :webkit, '6531.22.7', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
27
- register :MobileSafari, 'iPod', :'iPhone OS 4_1', :webkit, '6531.22.7', 'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
28
- register :MobileSafari, 'iPad', :'OS 3_2_2', :webkit, '531.21.10', 'Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10'
26
+ register :MobileSafari, 'iPhone 4', :'iPhone OS 5_0', :webkit, '7534.48.3', 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3'
27
+ register :MobileSafari, 'iPhone', :'iPhone OS 4_1', :webkit, '6531.22.7', 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
28
+ register :MobileSafari, 'iPod', :'iPhone OS 4_1', :webkit, '6531.22.7', 'Mozilla/5.0 (iPod; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
29
+ register :MobileSafari, 'iPad', :'OS 3_2_2', :webkit, '531.21.10', 'Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10'
29
30
 
30
31
  register :IE, '8.0', :'Windows 7', :msie, '8.0', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)'
31
32
  register :IE, '7.0b', :'Windows 2003', :msie, '7.0b', 'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)'
data/test/test_chrome.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestChrome < MiniTest::Unit::TestCase
3
+ class TestChrome < MiniTest::Should::TestCase
4
4
 
5
5
  # chrome tests
6
6
 
data/test/test_firefox.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestFirefox < MiniTest::Unit::TestCase
3
+ class TestFirefox < MiniTest::Should::TestCase
4
4
 
5
5
  # firefox tests
6
6
 
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestInternetExplorer < MiniTest::Unit::TestCase
3
+ class TestInternetExplorer < MiniTest::Should::TestCase
4
4
 
5
5
  # ie tests
6
6
 
@@ -23,7 +23,7 @@ class TestInternetExplorer < MiniTest::Unit::TestCase
23
23
  should "be ie 7" do
24
24
  request = get_request(:IE, '7.0b')
25
25
  assert request.ie?
26
- assert !request.old_ie?
26
+ assert request.old_ie?
27
27
  assert request.ie7?
28
28
  assert request.pc?
29
29
  end
data/test/test_mobile.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestMobile < MiniTest::Unit::TestCase
3
+ class TestMobile < MiniTest::Should::TestCase
4
4
 
5
5
  should "be safari ipad" do
6
6
  request = get_request(:MobileSafari, 'iPad')
@@ -25,6 +25,14 @@ class TestMobile < MiniTest::Unit::TestCase
25
25
  assert request.iphone?
26
26
  assert request.mobile?
27
27
  end
28
+
29
+ should "be safari iphone 4 and i0S 5" do
30
+ request = get_request(:MobileSafari, 'iPhone 4')
31
+ assert !request.safari?
32
+ assert request.mobile_safari?
33
+ assert request.iphone?
34
+ assert request.mobile?
35
+ end
28
36
 
29
37
  should "be blackberry" do
30
38
  request = get_request(:BlackBerry, '7.0.0.296')
data/test/test_os.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestOS < MiniTest::Unit::TestCase
3
+ class TestOS < MiniTest::Should::TestCase
4
4
 
5
5
  should "be on mac" do
6
6
  request = get_request(:Chrome, '8.0.552.237')
data/test/test_safari.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- class TestSafari < MiniTest::Unit::TestCase
3
+ class TestSafari < MiniTest::Should::TestCase
4
4
 
5
5
  should "be safari on mac" do
6
6
  request = get_request(:Safari, '4.0.1')
@@ -17,10 +17,10 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency('rack', '>= 1.0.1')
20
+ s.add_dependency('rack', '> 1')
21
21
 
22
- s.add_development_dependency('rake', '>= 0.8.7')
23
- s.add_development_dependency('minitest', '>= 2.1.0')
24
- s.add_development_dependency('minitest_should', '>= 0.1.1')
22
+ s.add_development_dependency('rake', '> 0')
23
+ s.add_development_dependency('minitest', '~> 2.1')
24
+ s.add_development_dependency('minitest_should', '~> 0.3')
25
25
 
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: which_browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,52 +9,72 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-09 00:00:00.000000000Z
12
+ date: 2013-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &70301390355260 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ! '>'
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.1
21
+ version: '1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70301390355260
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>'
28
+ - !ruby/object:Gem::Version
29
+ version: '1'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rake
27
- requirement: &70301390354700 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
- - - ! '>='
35
+ - - ! '>'
31
36
  - !ruby/object:Gem::Version
32
- version: 0.8.7
37
+ version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70301390354700
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>'
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: minitest
38
- requirement: &70301390354100 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
- - - ! '>='
51
+ - - ~>
42
52
  - !ruby/object:Gem::Version
43
- version: 2.1.0
53
+ version: '2.1'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70301390354100
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.1'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: minitest_should
49
- requirement: &70301390353520 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
- - - ! '>='
67
+ - - ~>
53
68
  - !ruby/object:Gem::Version
54
- version: 0.1.1
69
+ version: '0.3'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70301390353520
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '0.3'
58
78
  description: Which Browser adds a few helper methods to a rack request making it easier
59
79
  to determine which browser is being used by the client.
60
80
  email:
@@ -100,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
120
  version: '0'
101
121
  requirements: []
102
122
  rubyforge_project:
103
- rubygems_version: 1.8.10
123
+ rubygems_version: 1.8.23
104
124
  signing_key:
105
125
  specification_version: 3
106
126
  summary: Which Browser adds a few helper methods to a rack request making it easier