gcal4ruby 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +8 -6
- data/lib/gcal4ruby/base.rb +2 -0
- data/lib/gcal4ruby/event.rb +13 -4
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
#=CHANGELOG
|
2
|
+
#==version 0.1.4
|
3
|
+
#* Added additional search criteria for Event.find
|
2
4
|
#==version 0.1.3
|
3
|
-
|
4
|
-
|
5
|
-
|
5
|
+
#* Added support for authenticating with Google Hosted Apps accounts
|
6
|
+
#* Added flag to indicate whether a calendar is editable
|
7
|
+
#* Added handling to gracefully throw error when trying to create event on a non-editable (shared) calendar
|
6
8
|
#==version 0.1.2
|
7
|
-
|
9
|
+
#* Fixed to_xml dump problem with hidden and selected attributes
|
8
10
|
#==version 0.1.1
|
9
|
-
|
11
|
+
#* Added all_day indicator to event to indicate an all day event
|
10
12
|
#==version 0.1.0
|
11
|
-
|
13
|
+
#* Initial Version
|
data/lib/gcal4ruby/base.rb
CHANGED
data/lib/gcal4ruby/event.rb
CHANGED
@@ -345,10 +345,19 @@ module GCal4Ruby
|
|
345
345
|
end
|
346
346
|
end
|
347
347
|
|
348
|
-
#Finds the event that matches search_term in title or description full text search.
|
349
|
-
|
350
|
-
|
351
|
-
|
348
|
+
#Finds the event that matches search_term in title or description full text search.
|
349
|
+
#* The scope parameter can be either :all to return an array of all matches, or :first to return the first match as an Event.
|
350
|
+
#* The range parameter must be a hash containing a :start and :end values as Times specifying the date range to query by. Defaults to all dates.
|
351
|
+
def self.find(calendar, search_term = '', scope = :all, range = {})
|
352
|
+
if not range.is_a? Hash or (range.size > 0 and (not range[:start].is_a? Time or not range[:end].is_a? Time))
|
353
|
+
raise "The date range must be a hash including the :start and :end date values as Times"
|
354
|
+
else
|
355
|
+
date_range = ''
|
356
|
+
if range.size > 0
|
357
|
+
date_range = "&start-min=#{range[:start].xmlschema}&start-max=#{range[:end].xmlschema}"
|
358
|
+
end
|
359
|
+
end
|
360
|
+
events = calendar.service.send_get("http://www.google.com/calendar/feeds/#{calendar.id}/private/full?q="+CGI.escape(search_term)+date_range)
|
352
361
|
ret = []
|
353
362
|
REXML::Document.new(events.read_body).root.elements.each("entry"){}.map do |entry|
|
354
363
|
entry.attributes["xmlns:gCal"] = "http://schemas.google.com/gCal/2005"
|