intouch-gcal4ruby 0.5.7.1 → 0.5.7.2
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/lib/gcal4ruby/calendar.rb +4 -4
- data/lib/gcal4ruby/event.rb +4 -4
- data/lib/gcal4ruby/service.rb +3 -3
- metadata +2 -2
data/lib/gcal4ruby/calendar.rb
CHANGED
|
@@ -121,7 +121,7 @@ module GCal4Ruby
|
|
|
121
121
|
def events
|
|
122
122
|
events = []
|
|
123
123
|
ret = @service.send_request(GData4Ruby::Request.new(:get, @content_uri))
|
|
124
|
-
REXML::Document.new(ret
|
|
124
|
+
REXML::Document.new(ret).root.elements.each("entry"){}.map do |entry|
|
|
125
125
|
entry = GData4Ruby::Utils.add_namespaces(entry)
|
|
126
126
|
e = Event.new(service)
|
|
127
127
|
if e.load(entry.to_s)
|
|
@@ -274,7 +274,7 @@ module GCal4Ruby
|
|
|
274
274
|
@public = false
|
|
275
275
|
return true
|
|
276
276
|
end
|
|
277
|
-
r = REXML::Document.new(ret
|
|
277
|
+
r = REXML::Document.new(ret)
|
|
278
278
|
r.root.elements.each("entry") do |ele|
|
|
279
279
|
e = GData4Ruby::ACL::AccessRule.new(service, self)
|
|
280
280
|
ele = GData4Ruby::Utils.add_namespaces(ele)
|
|
@@ -358,8 +358,8 @@ module GCal4Ruby
|
|
|
358
358
|
|
|
359
359
|
private
|
|
360
360
|
def self.get_instance(service, d)
|
|
361
|
-
if d.
|
|
362
|
-
xml = REXML::Document.new(d
|
|
361
|
+
if d.status == 200
|
|
362
|
+
xml = REXML::Document.new(d).root
|
|
363
363
|
if xml.name == 'feed'
|
|
364
364
|
xml = xml.elements.each("entry"){}[0]
|
|
365
365
|
end
|
data/lib/gcal4ruby/event.rb
CHANGED
|
@@ -396,14 +396,14 @@ module GCal4Ruby
|
|
|
396
396
|
feed_uri = args[:calendar].is_a?(Calendar) ? args[:calendar].content_uri : self.event_feed_uri(args[:calendar])
|
|
397
397
|
args.delete(:calendar)
|
|
398
398
|
ret = service.send_request(GData4Ruby::Request.new(:get, feed_uri, nil, nil, args))
|
|
399
|
-
xml = REXML::Document.new(ret
|
|
399
|
+
xml = REXML::Document.new(ret).root
|
|
400
400
|
xml.elements.each("entry") do |e|
|
|
401
401
|
results << get_instance(service, e)
|
|
402
402
|
end
|
|
403
403
|
else
|
|
404
404
|
service.calendars.each do |cal|
|
|
405
405
|
ret = service.send_request(GData4Ruby::Request.new(:get, cal.content_uri, nil, nil, args))
|
|
406
|
-
xml = REXML::Document.new(ret
|
|
406
|
+
xml = REXML::Document.new(ret).root
|
|
407
407
|
xml.elements.each("entry") do |e|
|
|
408
408
|
results << get_instance(service, e)
|
|
409
409
|
end
|
|
@@ -438,8 +438,8 @@ module GCal4Ruby
|
|
|
438
438
|
end
|
|
439
439
|
|
|
440
440
|
def self.get_instance(service, d)
|
|
441
|
-
if d.
|
|
442
|
-
xml = REXML::Document.new(d
|
|
441
|
+
if d.status == 200
|
|
442
|
+
xml = REXML::Document.new(d).root
|
|
443
443
|
if xml.name == 'feed'
|
|
444
444
|
xml = xml.elements.each("entry"){}[0]
|
|
445
445
|
end
|
data/lib/gcal4ruby/service.rb
CHANGED
|
@@ -92,7 +92,7 @@ module GCal4Ruby
|
|
|
92
92
|
feed_url = options[:only_owner_access_level] ? GCal4Ruby::Calendar::OWN_CALENDARS_FEED : GCal4Ruby::Calendar::ALL_CALENDARS_FEED
|
|
93
93
|
ret = send_request(GData4Ruby::Request.new(:get, feed_url, nil, {"max-results" => "10000"}))
|
|
94
94
|
cals = []
|
|
95
|
-
REXML::Document.new(ret
|
|
95
|
+
REXML::Document.new(ret).root.elements.each("entry"){}.map do |entry|
|
|
96
96
|
entry = GData4Ruby::Utils.add_namespaces(entry)
|
|
97
97
|
cal = Calendar.new(self)
|
|
98
98
|
cal.load(entry.to_s)
|
|
@@ -103,12 +103,12 @@ module GCal4Ruby
|
|
|
103
103
|
|
|
104
104
|
#Returns an array of Event objects for each event in this account
|
|
105
105
|
def events
|
|
106
|
-
if not @auth_token
|
|
106
|
+
if not (@auth_token || @access_token)
|
|
107
107
|
raise NotAuthenticated
|
|
108
108
|
end
|
|
109
109
|
ret = send_request(GData4Ruby::Request.new(:get, Event.event_feed_uri(@account), nil, {"max-results" => "10000"}))
|
|
110
110
|
events = []
|
|
111
|
-
REXML::Document.new(ret
|
|
111
|
+
REXML::Document.new(ret).root.elements.each("entry"){}.map do |entry|
|
|
112
112
|
entry = GData4Ruby::Utils.add_namespaces(entry)
|
|
113
113
|
event = Event.new(self)
|
|
114
114
|
event.load(entry.to_s)
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: intouch-gcal4ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.5.7.
|
|
5
|
+
version: 0.5.7.2
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Mike Reich
|
|
@@ -20,7 +20,7 @@ dependencies:
|
|
|
20
20
|
requirements:
|
|
21
21
|
- - ">="
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: 0.1.5.
|
|
23
|
+
version: 0.1.5.2
|
|
24
24
|
type: :runtime
|
|
25
25
|
version_requirements: *id001
|
|
26
26
|
description: "GCal4Ruby is a Ruby Gem that can be used to interact with the current version of the Google Calendar API. GCal4Ruby provides the following features: Create and edit calendar events, Add and invite users to events, Set reminders, Make recurring events."
|