google_calendar 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{google_calendar}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve Zich"]
12
- s.date = %q{2010-12-17}
12
+ s.date = %q{2011-01-06}
13
13
  s.description = %q{A minimal wrapper around the google calendar API, which uses nokogiri for fast parsing.}
14
14
  s.email = %q{steve.zich@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.homepage = %q{http://github.com/northworld/google_calendar}
43
43
  s.licenses = ["MIT"]
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.3.7}
45
+ s.rubygems_version = %q{1.4.1}
46
46
  s.summary = %q{A lightweight google calendar API wrapper}
47
47
  s.test_files = [
48
48
  "test/helper.rb",
@@ -50,7 +50,6 @@ Gem::Specification.new do |s|
50
50
  ]
51
51
 
52
52
  if s.respond_to? :specification_version then
53
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54
53
  s.specification_version = 3
55
54
 
56
55
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -59,6 +59,7 @@ module Google
59
59
  # an array of events if many found.
60
60
  #
61
61
  def find_event_by_id(id)
62
+ return nil unless id && id.strip != ''
62
63
  event_lookup("/#{id}")
63
64
  end
64
65
 
@@ -110,12 +111,13 @@ module Google
110
111
  protected
111
112
 
112
113
  def event_lookup(query_string = '') #:nodoc:
114
+ begin
113
115
  response = @connection.send(Addressable::URI.parse(events_url + query_string), :get)
114
-
115
- return nil if response.kind_of? Net::HTTPNotFound
116
-
117
116
  events = Event.build_from_google_feed(response.body, self)
118
117
  events.length > 1 ? events : events[0]
118
+ rescue Google::HTTPNotFound
119
+ return nil
120
+ end
119
121
  end
120
122
 
121
123
  def calendar_url #:nodoc:
@@ -58,9 +58,7 @@ class TestGoogleCalendar < Test::Unit::TestCase
58
58
 
59
59
  should "throw NotFound with invalid event id" do
60
60
  @http_mock.stubs(:kind_of?).with(Net::HTTPNotFound).returns(true)
61
- assert_raise(HTTPNotFound) do
62
- @calendar.find_event_by_id('1234')
63
- end
61
+ assert_equal @calendar.find_event_by_id('1234'), nil
64
62
  end
65
63
 
66
64
  should "create an event with block" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_calendar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve Zich
@@ -15,13 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-17 00:00:00 -08:00
18
+ date: 2011-01-06 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- type: :runtime
24
- name: nokogiri
25
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
26
23
  none: false
27
24
  requirements:
@@ -34,10 +31,10 @@ dependencies:
34
31
  - 4
35
32
  version: 1.4.4
36
33
  requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
34
  prerelease: false
35
+ name: nokogiri
39
36
  type: :runtime
40
- name: addressable
37
+ - !ruby/object:Gem::Dependency
41
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
42
39
  none: false
43
40
  requirements:
@@ -50,10 +47,10 @@ dependencies:
50
47
  - 2
51
48
  version: 2.2.2
52
49
  requirement: *id002
53
- - !ruby/object:Gem::Dependency
54
50
  prerelease: false
55
- type: :development
56
- name: shoulda
51
+ name: addressable
52
+ type: :runtime
53
+ - !ruby/object:Gem::Dependency
57
54
  version_requirements: &id003 !ruby/object:Gem::Requirement
58
55
  none: false
59
56
  requirements:
@@ -64,10 +61,10 @@ dependencies:
64
61
  - 0
65
62
  version: "0"
66
63
  requirement: *id003
67
- - !ruby/object:Gem::Dependency
68
64
  prerelease: false
65
+ name: shoulda
69
66
  type: :development
70
- name: bundler
67
+ - !ruby/object:Gem::Dependency
71
68
  version_requirements: &id004 !ruby/object:Gem::Requirement
72
69
  none: false
73
70
  requirements:
@@ -80,10 +77,10 @@ dependencies:
80
77
  - 0
81
78
  version: 1.0.0
82
79
  requirement: *id004
83
- - !ruby/object:Gem::Dependency
84
80
  prerelease: false
81
+ name: bundler
85
82
  type: :development
86
- name: jeweler
83
+ - !ruby/object:Gem::Dependency
87
84
  version_requirements: &id005 !ruby/object:Gem::Requirement
88
85
  none: false
89
86
  requirements:
@@ -96,10 +93,10 @@ dependencies:
96
93
  - 1
97
94
  version: 1.5.1
98
95
  requirement: *id005
99
- - !ruby/object:Gem::Dependency
100
96
  prerelease: false
97
+ name: jeweler
101
98
  type: :development
102
- name: rcov
99
+ - !ruby/object:Gem::Dependency
103
100
  version_requirements: &id006 !ruby/object:Gem::Requirement
104
101
  none: false
105
102
  requirements:
@@ -110,10 +107,10 @@ dependencies:
110
107
  - 0
111
108
  version: "0"
112
109
  requirement: *id006
113
- - !ruby/object:Gem::Dependency
114
110
  prerelease: false
111
+ name: rcov
115
112
  type: :development
116
- name: mocha
113
+ - !ruby/object:Gem::Dependency
117
114
  version_requirements: &id007 !ruby/object:Gem::Requirement
118
115
  none: false
119
116
  requirements:
@@ -124,6 +121,9 @@ dependencies:
124
121
  - 0
125
122
  version: "0"
126
123
  requirement: *id007
124
+ prerelease: false
125
+ name: mocha
126
+ type: :development
127
127
  description: A minimal wrapper around the google calendar API, which uses nokogiri for fast parsing.
128
128
  email: steve.zich@gmail.com
129
129
  executables: []
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements: []
186
186
 
187
187
  rubyforge_project:
188
- rubygems_version: 1.3.7
188
+ rubygems_version: 1.4.1
189
189
  signing_key:
190
190
  specification_version: 3
191
191
  summary: A lightweight google calendar API wrapper