gcal4ruby 0.1.0 → 0.1.1
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 +5 -0
- data/README +2 -0
- data/lib/gcal4ruby/event.rb +10 -7
- metadata +3 -2
data/CHANGELOG
ADDED
data/README
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
#GCal4Ruby was created and is maintained by {Mike Reich}[mailto:mike@seabourneconsulting.com]
|
10
10
|
#and is licenses under the GPL v2. Feel free to use and update, but be sure to contribute your
|
11
11
|
#code back to the project and attribute as required by the license.
|
12
|
+
#===Website
|
13
|
+
#http://rubyforge.org/projects/gcal4ruby/
|
12
14
|
#
|
13
15
|
#==Description
|
14
16
|
#GCal4Ruby has three major components: the service, calendar and event objects. Each service
|
data/lib/gcal4ruby/event.rb
CHANGED
@@ -62,6 +62,8 @@ module GCal4Ruby
|
|
62
62
|
attr_accessor :status
|
63
63
|
#The unique event ID
|
64
64
|
attr_accessor :id
|
65
|
+
#Flag indicating whether it is an all day event
|
66
|
+
attr_accessor :all_day
|
65
67
|
|
66
68
|
@attendees
|
67
69
|
|
@@ -126,9 +128,9 @@ module GCal4Ruby
|
|
126
128
|
#Sets the start time of the Event. Must be a Time object or a parsable string representation
|
127
129
|
#of a time.
|
128
130
|
def start=(str)
|
129
|
-
if str.
|
131
|
+
if str.is_a?String
|
130
132
|
@start = Time.parse(str)
|
131
|
-
elsif str.
|
133
|
+
elsif str.is_a?Time
|
132
134
|
@start = str
|
133
135
|
else
|
134
136
|
raise "Start Time must be either Time or String"
|
@@ -138,9 +140,9 @@ module GCal4Ruby
|
|
138
140
|
#Sets the end time of the Event. Must be a Time object or a parsable string representation
|
139
141
|
#of a time.
|
140
142
|
def end=(str)
|
141
|
-
if str.
|
143
|
+
if str.is_a?String
|
142
144
|
@end = Time.parse(str)
|
143
|
-
elsif str.
|
145
|
+
elsif str.is_a?Time
|
144
146
|
@end = str
|
145
147
|
else
|
146
148
|
raise "End Time must be either Time or String"
|
@@ -184,6 +186,7 @@ module GCal4Ruby
|
|
184
186
|
@status = "http://schemas.google.com/g/2005#event.confirmed"
|
185
187
|
@attendees = []
|
186
188
|
@reminder = nil
|
189
|
+
@all_day = false
|
187
190
|
end
|
188
191
|
|
189
192
|
#If the event does not exist on the Google Calendar service, save creates it. Otherwise
|
@@ -220,8 +223,8 @@ module GCal4Ruby
|
|
220
223
|
ele.text = @content
|
221
224
|
when "when"
|
222
225
|
if not @recurrence
|
223
|
-
ele.attributes["startTime"] = @start.xmlschema
|
224
|
-
ele.attributes["endTime"] = @end.xmlschema
|
226
|
+
ele.attributes["startTime"] = @all_day ? @start.strftime("%Y-%m-%d") : @start.xmlschema
|
227
|
+
ele.attributes["endTime"] = @all_day ? @end.strftime("%Y-%m-%d") : @end.xmlschema
|
225
228
|
set_reminder(ele)
|
226
229
|
else
|
227
230
|
if not @reminder
|
@@ -229,7 +232,7 @@ module GCal4Ruby
|
|
229
232
|
xml.root.add_element("gd:recurrence").text = @recurrence.to_s
|
230
233
|
else
|
231
234
|
ele.delete_attribute('startTime')
|
232
|
-
ele.delete_attribute('
|
235
|
+
ele.delete_attribute('endTime')
|
233
236
|
set_reminder(ele)
|
234
237
|
end
|
235
238
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcal4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Reich
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -23,6 +23,7 @@ extra_rdoc_files: []
|
|
23
23
|
|
24
24
|
files:
|
25
25
|
- README
|
26
|
+
- CHANGELOG
|
26
27
|
- lib/gcal4ruby.rb
|
27
28
|
- lib/gcal4ruby/base.rb
|
28
29
|
- lib/gcal4ruby/service.rb
|