gcal4ruby 0.1.2 → 0.1.3
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 +4 -0
- data/lib/gcal4ruby/base.rb +2 -0
- data/lib/gcal4ruby/calendar.rb +6 -1
- data/lib/gcal4ruby/event.rb +3 -0
- data/lib/gcal4ruby/service.rb +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
#=CHANGELOG
|
2
|
+
#==version 0.1.3
|
3
|
+
#-Added support for authenticating with Google Hosted Apps accounts
|
4
|
+
#-Added flag to indicate whether a calendar is editable
|
5
|
+
#-Added handling to gracefully throw error when trying to create event on a non-editable (shared) calendar
|
2
6
|
#==version 0.1.2
|
3
7
|
#-Fixed to_xml dump problem with hidden and selected attributes
|
4
8
|
#==version 0.1.1
|
data/lib/gcal4ruby/base.rb
CHANGED
data/lib/gcal4ruby/calendar.rb
CHANGED
@@ -55,6 +55,9 @@ class Calendar
|
|
55
55
|
#The event feed for the calendar
|
56
56
|
attr_reader :event_feed
|
57
57
|
|
58
|
+
#A flag indicating whether the calendar is editable by this account
|
59
|
+
attr_reader :editable
|
60
|
+
|
58
61
|
#Returns true if the calendar exists on the Google Calendar system (i.e. was
|
59
62
|
#loaded or has been saved). Otherwise returns false.
|
60
63
|
def exists?
|
@@ -203,7 +206,7 @@ class Calendar
|
|
203
206
|
end
|
204
207
|
t = Calendar.find(service, @id, :first)
|
205
208
|
if t
|
206
|
-
load(t.
|
209
|
+
load(t.to_xml)
|
207
210
|
else
|
208
211
|
return false
|
209
212
|
end
|
@@ -268,8 +271,10 @@ class Calendar
|
|
268
271
|
ret = @service.send_get("http://www.google.com/calendar/feeds/#{@id}/acl/full/")
|
269
272
|
rescue Exception => e
|
270
273
|
@public = false
|
274
|
+
@editable = false
|
271
275
|
return true
|
272
276
|
end
|
277
|
+
@editable = true
|
273
278
|
r = REXML::Document.new(ret.read_body)
|
274
279
|
r.root.elements.each("entry") do |ele|
|
275
280
|
ele.elements.each do |e|
|
data/lib/gcal4ruby/event.rb
CHANGED
data/lib/gcal4ruby/service.rb
CHANGED
@@ -28,7 +28,7 @@ class Service < Base
|
|
28
28
|
# If authentication succeeds, returns true, otherwise raises the AuthenticationFailed error.
|
29
29
|
def authenticate(username, password)
|
30
30
|
ret = nil
|
31
|
-
ret = send_post(AUTH_URL, "Email=#{username}&Passwd=#{password}&source=GCal4Ruby&service=cl")
|
31
|
+
ret = send_post(AUTH_URL, "Email=#{username}&Passwd=#{password}&source=GCal4Ruby&service=cl&accountType=HOSTED_OR_GOOGLE")
|
32
32
|
if ret.class == Net::HTTPOK
|
33
33
|
@auth_token = ret.read_body.to_a[2].gsub("Auth=", "").strip
|
34
34
|
@account = username
|