urbanairship 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/urbanairship.rb CHANGED
@@ -73,7 +73,9 @@ module Urbanairship
73
73
  Urbanairship::Response.wrap(response)
74
74
  end
75
75
  rescue Timeout::Error
76
- logger.error "Urbanairship request timed out after #{request_timeout} seconds: [#{http_method} #{request.path} #{request.body}]"
76
+ unless logger.nil?
77
+ logger.error "Urbanairship request timed out after #{request_timeout} seconds: [#{http_method} #{request.path} #{request.body}]"
78
+ end
77
79
  Urbanairship::Response.wrap(nil, :body => {:error => 'Request timeout'}, :code => '503')
78
80
  end
79
81
 
@@ -453,6 +453,15 @@ describe Urbanairship do
453
453
  Urbanairship.logger = @logger
454
454
  end
455
455
 
456
+ it "does not attempt to log if logger is not set" do
457
+ Urbanairship::Timer.should_receive(:timeout).with(5.0).and_raise(Timeout::Error)
458
+ Urbanairship.logger = nil
459
+
460
+ lambda {
461
+ Urbanairship.register_device('new_device_token')
462
+ }.should_not raise_exception(NoMethodError)
463
+ end
464
+
456
465
  it "uses a default request_timeout value of five seconds" do
457
466
  Urbanairship::Timer.should_receive(:timeout).with(5.0).and_raise(Timeout::Error)
458
467
  @logger.should_receive(:error).with(/Urbanairship request timed out/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanairship
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
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: 2012-06-24 00:00:00.000000000 Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70194940674580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70194940674580
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rspec
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70194940673940 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *70194940673940
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: fakeweb
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70194940673400 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,12 +43,7 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70194940673400
62
47
  description: Urbanairship is a Ruby library for interacting with the Urban Airship
63
48
  (http://urbanairship.com) API.
64
49
  email:
@@ -95,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
80
  version: '0'
96
81
  requirements: []
97
82
  rubyforge_project:
98
- rubygems_version: 1.8.24
83
+ rubygems_version: 1.8.6
99
84
  signing_key:
100
85
  specification_version: 3
101
86
  summary: A Ruby wrapper for the Urban Airship API