gcal4ruby 0.2.4 → 0.2.5
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 +2 -0
- data/README +1 -1
- data/lib/gcal4ruby/calendar.rb +2 -4
- data/lib/gcal4ruby/service.rb +4 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -52,7 +52,7 @@
|
|
52
52
|
# event.save
|
53
53
|
#
|
54
54
|
#2. Find an existing Event
|
55
|
-
# event = Event.find(cal, "Soccer Game", :first)
|
55
|
+
# event = Event.find(cal, "Soccer Game", {:scope => :first})
|
56
56
|
#
|
57
57
|
#3. Find all events containing the search term
|
58
58
|
# event = Event.find(cal, "Soccer Game")
|
data/lib/gcal4ruby/calendar.rb
CHANGED
@@ -355,7 +355,6 @@ class Calendar
|
|
355
355
|
when :width then output += "width=#{value}"
|
356
356
|
when :title then output += "title=#{CGI.escape(value)}"
|
357
357
|
when :bgcolor then output += "bgcolor=#{CGI.escape(value)}"
|
358
|
-
when :color then output += "color=#{CGI.escape(value)}"
|
359
358
|
when :showTitle then output += value
|
360
359
|
when :showDate then output += value
|
361
360
|
when :showNav then output += value
|
@@ -370,7 +369,7 @@ class Calendar
|
|
370
369
|
output += "&"
|
371
370
|
end
|
372
371
|
|
373
|
-
output += "src=#{params[:id]}&"
|
372
|
+
output += "src=#{params[:id]}&color=#{CGI.escape(params[:color])}"
|
374
373
|
|
375
374
|
"<iframe src='http://www.google.com/calendar/embed?#{output}' style='#{params[:border]} px solid;' width='#{params[:width]}' height='#{params[:height]}' frameborder='#{params[:border]}' scrolling='no'></iframe>"
|
376
375
|
end
|
@@ -415,7 +414,6 @@ class Calendar
|
|
415
414
|
when :width then output += "width=#{value}"
|
416
415
|
when :title then output += "title=#{CGI.escape(value)}"
|
417
416
|
when :bgcolor then output += "bgcolor=#{CGI.escape(value)}"
|
418
|
-
when :color then output += "color=#{CGI.escape(value)}"
|
419
417
|
when :showTitle then output += value
|
420
418
|
when :showDate then output += value
|
421
419
|
when :showNav then output += value
|
@@ -430,7 +428,7 @@ class Calendar
|
|
430
428
|
output += "&"
|
431
429
|
end
|
432
430
|
|
433
|
-
output += "src=#{params[:id]}&"
|
431
|
+
output += "src=#{params[:id]}&color=#{CGI.escape(params[:color])}"
|
434
432
|
|
435
433
|
"<iframe src='http://www.google.com/calendar/embed?#{output}' style='#{params[:border]} px solid;' width='#{params[:width]}' height='#{params[:height]}' frameborder='#{params[:border]}' scrolling='no'></iframe>"
|
436
434
|
end
|
data/lib/gcal4ruby/service.rb
CHANGED
@@ -85,6 +85,7 @@ class Service < Base
|
|
85
85
|
# border:: the border width in pixels
|
86
86
|
# dates:: a range of dates to display in the format of 'yyyymmdd/yyyymmdd'. Example: 20090820/20091001
|
87
87
|
# privateKey:: use to display a private calendar. You can find this key under the calendar settings pane of the Google Calendar website.
|
88
|
+
# colors:: a hash of calendar ids as key and color values as associated hash values. Example: {'test@gmail.com' => '#7A367A'}
|
88
89
|
def to_iframe(cals, params = {})
|
89
90
|
params[:height] ||= "600"
|
90
91
|
params[:width] ||= "600"
|
@@ -128,6 +129,9 @@ class Service < Base
|
|
128
129
|
if cals.is_a?(Array)
|
129
130
|
for c in cals
|
130
131
|
output += "src=#{c}&"
|
132
|
+
if params[:colors] and params[:colors][c]
|
133
|
+
output += "color=#{CGI.escape(params[:colors][c])}&"
|
134
|
+
end
|
131
135
|
end
|
132
136
|
elsif cals == :all
|
133
137
|
cal_list = calendars()
|
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.2.
|
4
|
+
version: 0.2.5
|
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-
|
12
|
+
date: 2009-09-01 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|