google_calendar 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/google_calendar.gemspec +2 -2
- data/lib/google/calendar.rb +6 -3
- data/test/test_google_calendar.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
data/google_calendar.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "google_calendar"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.7"
|
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 = "2012-12-
|
12
|
+
s.date = "2012-12-27"
|
13
13
|
s.description = "A minimal wrapper around the google calendar API, which uses nokogiri for fast parsing."
|
14
14
|
s.email = "steve.zich@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/google/calendar.rb
CHANGED
@@ -76,10 +76,13 @@ module Google
|
|
76
76
|
# a single event if only one found.
|
77
77
|
# an array of events if many found.
|
78
78
|
#
|
79
|
-
def find_events_in_range(start_min, start_max)
|
79
|
+
def find_events_in_range(start_min, start_max,options = {})
|
80
|
+
options[:max_results] ||= 25
|
80
81
|
formatted_start_min = start_min.strftime("%Y-%m-%dT%H:%M:%S")
|
81
82
|
formatted_start_max = start_max.strftime("%Y-%m-%dT%H:%M:%S")
|
82
|
-
|
83
|
+
query = "?start-min=#{formatted_start_min}&start-max=#{formatted_start_max}&recurrence-expansion-start=#{formatted_start_min}&recurrence-expansion-end=#{formatted_start_max}"
|
84
|
+
query = "#{query}&max-results=#{options[:max_results]}"
|
85
|
+
event_lookup(query)
|
83
86
|
end
|
84
87
|
|
85
88
|
# Attempts to find the event specified by the id
|
@@ -216,4 +219,4 @@ module Google
|
|
216
219
|
end
|
217
220
|
end
|
218
221
|
|
219
|
-
end
|
222
|
+
end
|
@@ -128,7 +128,7 @@ class TestGoogleCalendar < Test::Unit::TestCase
|
|
128
128
|
should "find events in range" do
|
129
129
|
start_min = DateTime.new(2011, 2, 1, 11, 1, 1)
|
130
130
|
start_max = DateTime.new(2011, 2, 28, 23, 59, 59)
|
131
|
-
@calendar.expects(:event_lookup).with('?start-min=2011-02-01T11:01:01&start-max=2011-02-28T23:59:59&recurrence-expansion-start=2011-02-01T11:01:01&recurrence-expansion-end=2011-02-28T23:59:59')
|
131
|
+
@calendar.expects(:event_lookup).with('?start-min=2011-02-01T11:01:01&start-max=2011-02-28T23:59:59&recurrence-expansion-start=2011-02-01T11:01:01&recurrence-expansion-end=2011-02-28T23:59:59&max-results=25')
|
132
132
|
events = @calendar.find_events_in_range(start_min, start_max)
|
133
133
|
end
|
134
134
|
|
@@ -265,4 +265,4 @@ class TestGoogleCalendar < Test::Unit::TestCase
|
|
265
265
|
File.open(@@mock_path + '/' + name).read
|
266
266
|
end
|
267
267
|
|
268
|
-
end
|
268
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
segments:
|
172
172
|
- 0
|
173
|
-
hash:
|
173
|
+
hash: -1634053075579293833
|
174
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
175
|
none: false
|
176
176
|
requirements:
|