gcalapi 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -1,8 +1,8 @@
1
+ require "rubygems"
1
2
  require "googlecalendar/calendar"
2
3
  require "win32ole"
3
4
  require "nkf"
4
5
 
5
-
6
6
  # google calendar Feed URL
7
7
  FEED_URL = "http://www.google.com/calendar/feeds/XXXXXXXXXXXXXXXX@group.calendar.google.com/private/full"
8
8
  # email address
@@ -37,12 +37,16 @@ GoogleCalendar::Service.proxy_port="8080"
37
37
 
38
38
  # Delete All Future Data Of Google Calendar
39
39
  now = Time.now
40
- @cal.events(now, nil).each do |ev| ev.destroy! end
40
+ @cal.events(:'start-min' => now, :orderby => "starttime").each do |ev|
41
+ p ev if $DEBUG
42
+ ev.destroy!
43
+ end
41
44
 
42
45
  # Insert All Future Data Of Outlook
43
46
  @nstr = now.strftime("%Y/%m/%d %H:%M:%S")
44
47
  each_event do |oev|
45
- if oev.Start > @nstr
48
+ if oev.End > @nstr
49
+ p oev.Subject if $DEBUG
46
50
  gev = @cal.create_event
47
51
  #NKF is used for japanese charcter code conversion
48
52
  gev.title = NKF.nkf("-w", oev.Subject)
@@ -215,7 +215,7 @@ belongs to this clandar instance.
215
215
  send query to get events and returns an array of <a
216
216
  href="GoogleCalendar/Event.html">Event</a> objects. if any conditions are
217
217
  given, recent 25 entries are retrieved. For detail, see <a
218
- href="GoogleCalendar/Service.html#M000020">Service#query</a>
218
+ href="GoogleCalendar/Service.html#M000024">Service#query</a>
219
219
  </p>
220
220
  <p><a class="source-toggle" href="#"
221
221
  onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
@@ -92,17 +92,21 @@ This class interacts with google calendar service.
92
92
  <h3 class="section-bar">Methods</h3>
93
93
 
94
94
  <div class="name-list">
95
- <a href="#M000018">calendar_list</a>&nbsp;&nbsp;
96
- <a href="#M000019">calendars</a>&nbsp;&nbsp;
97
- <a href="#M000021">delete</a>&nbsp;&nbsp;
98
- <a href="#M000022">insert</a>&nbsp;&nbsp;
99
- <a href="#M000017">new</a>&nbsp;&nbsp;
95
+ <a href="#M000022">calendar_list</a>&nbsp;&nbsp;
96
+ <a href="#M000023">calendars</a>&nbsp;&nbsp;
97
+ <a href="#M000025">delete</a>&nbsp;&nbsp;
98
+ <a href="#M000026">insert</a>&nbsp;&nbsp;
99
+ <a href="#M000021">new</a>&nbsp;&nbsp;
100
100
  <a href="#M000013">proxy_addr</a>&nbsp;&nbsp;
101
101
  <a href="#M000014">proxy_addr=</a>&nbsp;&nbsp;
102
+ <a href="#M000019">proxy_pass</a>&nbsp;&nbsp;
103
+ <a href="#M000020">proxy_pass=</a>&nbsp;&nbsp;
102
104
  <a href="#M000015">proxy_port</a>&nbsp;&nbsp;
103
105
  <a href="#M000016">proxy_port=</a>&nbsp;&nbsp;
104
- <a href="#M000020">query</a>&nbsp;&nbsp;
105
- <a href="#M000023">update</a>&nbsp;&nbsp;
106
+ <a href="#M000017">proxy_user</a>&nbsp;&nbsp;
107
+ <a href="#M000018">proxy_user=</a>&nbsp;&nbsp;
108
+ <a href="#M000024">query</a>&nbsp;&nbsp;
109
+ <a href="#M000027">update</a>&nbsp;&nbsp;
106
110
  </div>
107
111
  </div>
108
112
 
@@ -162,21 +166,21 @@ URL to get calendar list
162
166
  <div id="methods">
163
167
  <h3 class="section-bar">Public Class methods</h3>
164
168
 
165
- <div id="method-M000017" class="method-detail">
166
- <a name="M000017"></a>
169
+ <div id="method-M000021" class="method-detail">
170
+ <a name="M000021"></a>
167
171
 
168
172
  <div class="method-heading">
169
- <a href="#M000017" class="method-signature">
173
+ <a href="#M000021" class="method-signature">
170
174
  <span class="method-name">new</span><span class="method-args">(email, pass)</span>
171
175
  </a>
172
176
  </div>
173
177
 
174
178
  <div class="method-description">
175
179
  <p><a class="source-toggle" href="#"
176
- onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
177
- <div class="method-source-code" id="M000017-source">
180
+ onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
181
+ <div class="method-source-code" id="M000021-source">
178
182
  <pre>
179
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 48</span>
183
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 69</span>
180
184
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">email</span>, <span class="ruby-identifier">pass</span>)
181
185
  <span class="ruby-ivar">@email</span> = <span class="ruby-identifier">email</span>
182
186
  <span class="ruby-ivar">@pass</span> = <span class="ruby-identifier">pass</span>
@@ -235,6 +239,52 @@ URL to get calendar list
235
239
  </div>
236
240
  </div>
237
241
 
242
+ <div id="method-M000019" class="method-detail">
243
+ <a name="M000019"></a>
244
+
245
+ <div class="method-heading">
246
+ <a href="#M000019" class="method-signature">
247
+ <span class="method-name">proxy_pass</span><span class="method-args">()</span>
248
+ </a>
249
+ </div>
250
+
251
+ <div class="method-description">
252
+ <p><a class="source-toggle" href="#"
253
+ onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
254
+ <div class="method-source-code" id="M000019-source">
255
+ <pre>
256
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 60</span>
257
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_pass</span>
258
+ <span class="ruby-ivar">@@proxy_pass</span>
259
+ <span class="ruby-keyword kw">end</span>
260
+ </pre>
261
+ </div>
262
+ </div>
263
+ </div>
264
+
265
+ <div id="method-M000020" class="method-detail">
266
+ <a name="M000020"></a>
267
+
268
+ <div class="method-heading">
269
+ <a href="#M000020" class="method-signature">
270
+ <span class="method-name">proxy_pass=</span><span class="method-args">(pass)</span>
271
+ </a>
272
+ </div>
273
+
274
+ <div class="method-description">
275
+ <p><a class="source-toggle" href="#"
276
+ onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
277
+ <div class="method-source-code" id="M000020-source">
278
+ <pre>
279
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 64</span>
280
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_pass=</span>(<span class="ruby-identifier">pass</span>)
281
+ <span class="ruby-ivar">@@proxy_pass</span> = <span class="ruby-identifier">pass</span>
282
+ <span class="ruby-keyword kw">end</span>
283
+ </pre>
284
+ </div>
285
+ </div>
286
+ </div>
287
+
238
288
  <div id="method-M000015" class="method-detail">
239
289
  <a name="M000015"></a>
240
290
 
@@ -281,13 +331,59 @@ URL to get calendar list
281
331
  </div>
282
332
  </div>
283
333
 
284
- <h3 class="section-bar">Public Instance methods</h3>
334
+ <div id="method-M000017" class="method-detail">
335
+ <a name="M000017"></a>
336
+
337
+ <div class="method-heading">
338
+ <a href="#M000017" class="method-signature">
339
+ <span class="method-name">proxy_user</span><span class="method-args">()</span>
340
+ </a>
341
+ </div>
342
+
343
+ <div class="method-description">
344
+ <p><a class="source-toggle" href="#"
345
+ onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
346
+ <div class="method-source-code" id="M000017-source">
347
+ <pre>
348
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 50</span>
349
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_user</span>
350
+ <span class="ruby-ivar">@@proxy_user</span>
351
+ <span class="ruby-keyword kw">end</span>
352
+ </pre>
353
+ </div>
354
+ </div>
355
+ </div>
285
356
 
286
357
  <div id="method-M000018" class="method-detail">
287
358
  <a name="M000018"></a>
288
359
 
289
360
  <div class="method-heading">
290
361
  <a href="#M000018" class="method-signature">
362
+ <span class="method-name">proxy_user=</span><span class="method-args">(user)</span>
363
+ </a>
364
+ </div>
365
+
366
+ <div class="method-description">
367
+ <p><a class="source-toggle" href="#"
368
+ onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
369
+ <div class="method-source-code" id="M000018-source">
370
+ <pre>
371
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 54</span>
372
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">proxy_user=</span>(<span class="ruby-identifier">user</span>)
373
+ <span class="ruby-ivar">@@proxy_user</span> = <span class="ruby-identifier">user</span>
374
+ <span class="ruby-keyword kw">end</span>
375
+ </pre>
376
+ </div>
377
+ </div>
378
+ </div>
379
+
380
+ <h3 class="section-bar">Public Instance methods</h3>
381
+
382
+ <div id="method-M000022" class="method-detail">
383
+ <a name="M000022"></a>
384
+
385
+ <div class="method-heading">
386
+ <a href="#M000022" class="method-signature">
291
387
  <span class="method-name">calendar_list</span><span class="method-args">()</span>
292
388
  </a>
293
389
  </div>
@@ -297,10 +393,10 @@ URL to get calendar list
297
393
  get the list of user&#8217;s calendars and returns http response object
298
394
  </p>
299
395
  <p><a class="source-toggle" href="#"
300
- onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
301
- <div class="method-source-code" id="M000018-source">
396
+ onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
397
+ <div class="method-source-code" id="M000022-source">
302
398
  <pre>
303
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 59</span>
399
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 80</span>
304
400
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calendar_list</span>
305
401
  <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
306
402
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-constant">CALENDAR_LIST_PATH</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@email</span>)
@@ -311,8 +407,8 @@ get the list of user&#8217;s calendars and returns http response object
311
407
  </div>
312
408
  </div>
313
409
 
314
- <div id="method-M000019" class="method-detail">
315
- <a name="M000019"></a>
410
+ <div id="method-M000023" class="method-detail">
411
+ <a name="M000023"></a>
316
412
 
317
413
  <div class="method-heading">
318
414
  <span class="method-name">calendars</span><span class="method-args">()</span>
@@ -320,16 +416,16 @@ get the list of user&#8217;s calendars and returns http response object
320
416
 
321
417
  <div class="method-description">
322
418
  <p>
323
- Alias for <a href="Service.html#M000018">calendar_list</a>
419
+ Alias for <a href="Service.html#M000022">calendar_list</a>
324
420
  </p>
325
421
  </div>
326
422
  </div>
327
423
 
328
- <div id="method-M000021" class="method-detail">
329
- <a name="M000021"></a>
424
+ <div id="method-M000025" class="method-detail">
425
+ <a name="M000025"></a>
330
426
 
331
427
  <div class="method-heading">
332
- <a href="#M000021" class="method-signature">
428
+ <a href="#M000025" class="method-signature">
333
429
  <span class="method-name">delete</span><span class="method-args">(feed)</span>
334
430
  </a>
335
431
  </div>
@@ -339,10 +435,10 @@ Alias for <a href="Service.html#M000018">calendar_list</a>
339
435
  delete an event.
340
436
  </p>
341
437
  <p><a class="source-toggle" href="#"
342
- onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
343
- <div class="method-source-code" id="M000021-source">
438
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
439
+ <div class="method-source-code" id="M000025-source">
344
440
  <pre>
345
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 92</span>
441
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 115</span>
346
442
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">feed</span>)
347
443
  <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
348
444
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
@@ -356,11 +452,11 @@ delete an event.
356
452
  </div>
357
453
  </div>
358
454
 
359
- <div id="method-M000022" class="method-detail">
360
- <a name="M000022"></a>
455
+ <div id="method-M000026" class="method-detail">
456
+ <a name="M000026"></a>
361
457
 
362
458
  <div class="method-heading">
363
- <a href="#M000022" class="method-signature">
459
+ <a href="#M000026" class="method-signature">
364
460
  <span class="method-name">insert</span><span class="method-args">(feed, event)</span>
365
461
  </a>
366
462
  </div>
@@ -370,10 +466,10 @@ delete an event.
370
466
  insert an event
371
467
  </p>
372
468
  <p><a class="source-toggle" href="#"
373
- onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
374
- <div class="method-source-code" id="M000022-source">
469
+ onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
470
+ <div class="method-source-code" id="M000026-source">
375
471
  <pre>
376
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 104</span>
472
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 127</span>
377
473
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">event</span>)
378
474
  <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
379
475
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
@@ -387,11 +483,11 @@ insert an event
387
483
  </div>
388
484
  </div>
389
485
 
390
- <div id="method-M000020" class="method-detail">
391
- <a name="M000020"></a>
486
+ <div id="method-M000024" class="method-detail">
487
+ <a name="M000024"></a>
392
488
 
393
489
  <div class="method-heading">
394
- <a href="#M000020" class="method-signature">
490
+ <a href="#M000024" class="method-signature">
395
491
  <span class="method-name">query</span><span class="method-args">(cal_url, conditions)</span>
396
492
  </a>
397
493
  </div>
@@ -399,19 +495,46 @@ insert an event
399
495
  <div class="method-description">
400
496
  <p>
401
497
  send query for events of a calendar and returns http response object.
402
- available condtions: :q =&gt; query string :max-results =&gt; max contents
403
- count. (default: 25) :start-index =&gt; 1-based index of the first result
404
- to be retrieved :orderby =&gt; the order of retrieved data. :published-min
405
- =&gt; Bounds on the entry publication date(oldest) :published-max =&gt;
406
- Bounds on the entry publication date(newest) :updated-min =&gt; Bounds on
407
- the entry update date(oldest) :updated-max =&gt; Bounds on the entry update
408
- date(newest) :author =&gt; Entry author
498
+ available condtions are
499
+ </p>
500
+ <ul>
501
+ <li>:q =&gt; query string
502
+
503
+ </li>
504
+ <li>:max-results =&gt; max contents count. (default: 25)
505
+
506
+ </li>
507
+ <li>:start-index =&gt; 1-based index of the first result to be retrieved
508
+
509
+ </li>
510
+ <li>:orderby =&gt; the order of retrieved data.
511
+
512
+ </li>
513
+ <li>:published-min =&gt; Bounds on the entry publication date(oldest)
514
+
515
+ </li>
516
+ <li>:published-max =&gt; Bounds on the entry publication date(newest)
517
+
518
+ </li>
519
+ <li>:updated-min =&gt; Bounds on the entry update date(oldest)
520
+
521
+ </li>
522
+ <li>:updated-max =&gt; Bounds on the entry update date(newest)
523
+
524
+ </li>
525
+ <li>:author =&gt; Entry author
526
+
527
+ </li>
528
+ </ul>
529
+ <p>
530
+ For detail, see <a
531
+ href="http://code.google.com/apis/gdata/protocol.html#Queries">code.google.com/apis/gdata/protocol.html#Queries</a>
409
532
  </p>
410
533
  <p><a class="source-toggle" href="#"
411
- onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
412
- <div class="method-source-code" id="M000020-source">
534
+ onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
535
+ <div class="method-source-code" id="M000024-source">
413
536
  <pre>
414
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 80</span>
537
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 103</span>
415
538
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query</span>(<span class="ruby-identifier">cal_url</span>, <span class="ruby-identifier">conditions</span>)
416
539
  <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
417
540
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">cal_url</span>)
@@ -425,11 +548,11 @@ date(newest) :author =&gt; Entry author
425
548
  </div>
426
549
  </div>
427
550
 
428
- <div id="method-M000023" class="method-detail">
429
- <a name="M000023"></a>
551
+ <div id="method-M000027" class="method-detail">
552
+ <a name="M000027"></a>
430
553
 
431
554
  <div class="method-heading">
432
- <a href="#M000023" class="method-signature">
555
+ <a href="#M000027" class="method-signature">
433
556
  <span class="method-name">update</span><span class="method-args">(feed, event)</span>
434
557
  </a>
435
558
  </div>
@@ -439,10 +562,10 @@ date(newest) :author =&gt; Entry author
439
562
  update an event.
440
563
  </p>
441
564
  <p><a class="source-toggle" href="#"
442
- onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
443
- <div class="method-source-code" id="M000023-source">
565
+ onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
566
+ <div class="method-source-code" id="M000027-source">
444
567
  <pre>
445
- <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 116</span>
568
+ <span class="ruby-comment cmt"># File lib/googlecalendar/service.rb, line 139</span>
446
569
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">feed</span>, <span class="ruby-identifier">event</span>)
447
570
  <span class="ruby-identifier">auth</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@auth</span>
448
571
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">feed</span>)
@@ -1 +1 @@
1
- Thu Nov 09 01:53:38 JST 2006
1
+ Thu Dec 28 17:59:29 JST 2006
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Nov 09 01:18:09 JST 2006</td>
59
+ <td>Thu Dec 28 17:22:48 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -20,29 +20,33 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/GoogleCalendar/Service.html#M000018">calendar_list (GoogleCalendar::Service)</a><br />
23
+ <a href="classes/GoogleCalendar/Service.html#M000022">calendar_list (GoogleCalendar::Service)</a><br />
24
24
  <a href="classes/GoogleCalendar/Calendar.html#M000012">calendars (GoogleCalendar::Calendar)</a><br />
25
- <a href="classes/GoogleCalendar/Service.html#M000019">calendars (GoogleCalendar::Service)</a><br />
25
+ <a href="classes/GoogleCalendar/Service.html#M000023">calendars (GoogleCalendar::Service)</a><br />
26
26
  <a href="classes/GoogleCalendar.html#M000004">create_event (GoogleCalendar)</a><br />
27
- <a href="classes/GoogleCalendar/Service.html#M000021">delete (GoogleCalendar::Service)</a><br />
27
+ <a href="classes/GoogleCalendar/Service.html#M000025">delete (GoogleCalendar::Service)</a><br />
28
28
  <a href="classes/GoogleCalendar/Event.html#M000009">destroy (GoogleCalendar::Event)</a><br />
29
29
  <a href="classes/GoogleCalendar/Event.html#M000010">destroy! (GoogleCalendar::Event)</a><br />
30
30
  <a href="classes/GoogleCalendar.html#M000003">events (GoogleCalendar)</a><br />
31
- <a href="classes/GoogleCalendar/Service.html#M000022">insert (GoogleCalendar::Service)</a><br />
31
+ <a href="classes/GoogleCalendar/Service.html#M000026">insert (GoogleCalendar::Service)</a><br />
32
32
  <a href="classes/GoogleCalendar/Event.html#M000006">load_xml (GoogleCalendar::Event)</a><br />
33
33
  <a href="classes/GoogleCalendar.html#M000001">new (GoogleCalendar)</a><br />
34
34
  <a href="classes/GoogleCalendar/Event.html#M000005">new (GoogleCalendar::Event)</a><br />
35
- <a href="classes/GoogleCalendar/Service.html#M000017">new (GoogleCalendar::Service)</a><br />
35
+ <a href="classes/GoogleCalendar/Service.html#M000021">new (GoogleCalendar::Service)</a><br />
36
36
  <a href="classes/GoogleCalendar/Service.html#M000013">proxy_addr (GoogleCalendar::Service)</a><br />
37
37
  <a href="classes/GoogleCalendar/Service.html#M000014">proxy_addr= (GoogleCalendar::Service)</a><br />
38
+ <a href="classes/GoogleCalendar/Service.html#M000019">proxy_pass (GoogleCalendar::Service)</a><br />
39
+ <a href="classes/GoogleCalendar/Service.html#M000020">proxy_pass= (GoogleCalendar::Service)</a><br />
38
40
  <a href="classes/GoogleCalendar/Service.html#M000015">proxy_port (GoogleCalendar::Service)</a><br />
39
41
  <a href="classes/GoogleCalendar/Service.html#M000016">proxy_port= (GoogleCalendar::Service)</a><br />
40
- <a href="classes/GoogleCalendar/Service.html#M000020">query (GoogleCalendar::Service)</a><br />
42
+ <a href="classes/GoogleCalendar/Service.html#M000017">proxy_user (GoogleCalendar::Service)</a><br />
43
+ <a href="classes/GoogleCalendar/Service.html#M000018">proxy_user= (GoogleCalendar::Service)</a><br />
44
+ <a href="classes/GoogleCalendar/Service.html#M000024">query (GoogleCalendar::Service)</a><br />
41
45
  <a href="classes/GoogleCalendar/Event.html#M000007">save (GoogleCalendar::Event)</a><br />
42
46
  <a href="classes/GoogleCalendar/Event.html#M000008">save! (GoogleCalendar::Event)</a><br />
43
47
  <a href="classes/GoogleCalendar.html#M000002">source (GoogleCalendar)</a><br />
44
48
  <a href="classes/GoogleCalendar/Event.html#M000011">to_s (GoogleCalendar::Event)</a><br />
45
- <a href="classes/GoogleCalendar/Service.html#M000023">update (GoogleCalendar::Service)</a><br />
49
+ <a href="classes/GoogleCalendar/Service.html#M000027">update (GoogleCalendar::Service)</a><br />
46
50
  </div>
47
51
  </div>
48
52
  </body>
@@ -0,0 +1 @@
1
+ require "googlecalendar/calendar"
@@ -44,6 +44,27 @@ module GoogleCalendar
44
44
  def self.proxy_port=(port)
45
45
  @@proxy_port = port
46
46
  end
47
+
48
+ # proxy server username
49
+ @@proxy_user = nil
50
+ def self.proxy_user
51
+ @@proxy_user
52
+ end
53
+
54
+ def self.proxy_user=(user)
55
+ @@proxy_user = user
56
+ end
57
+
58
+ # proxy server password
59
+ @@proxy_pass = nil
60
+ def self.proxy_pass
61
+ @@proxy_pass
62
+ end
63
+
64
+ def self.proxy_pass=(pass)
65
+ @@proxy_pass = pass
66
+ end
67
+
47
68
 
48
69
  def initialize(email, pass)
49
70
  @email = email
@@ -66,16 +87,18 @@ module GoogleCalendar
66
87
 
67
88
  #
68
89
  # send query for events of a calendar and returns http response object.
69
- # available condtions:
70
- # :q => query string
71
- # :max-results => max contents count. (default: 25)
72
- # :start-index => 1-based index of the first result to be retrieved
73
- # :orderby => the order of retrieved data.
74
- # :published-min => Bounds on the entry publication date(oldest)
75
- # :published-max => Bounds on the entry publication date(newest)
76
- # :updated-min => Bounds on the entry update date(oldest)
77
- # :updated-max => Bounds on the entry update date(newest)
78
- # :author => Entry author
90
+ # available condtions are
91
+ # * :q => query string
92
+ # * :max-results => max contents count. (default: 25)
93
+ # * :start-index => 1-based index of the first result to be retrieved
94
+ # * :orderby => the order of retrieved data.
95
+ # * :published-min => Bounds on the entry publication date(oldest)
96
+ # * :published-max => Bounds on the entry publication date(newest)
97
+ # * :updated-min => Bounds on the entry update date(oldest)
98
+ # * :updated-max => Bounds on the entry update date(newest)
99
+ # * :author => Entry author
100
+ #
101
+ # For detail, see http://code.google.com/apis/gdata/protocol.html#Queries
79
102
  #
80
103
  def query(cal_url, conditions)
81
104
  auth unless @auth
@@ -127,7 +150,7 @@ module GoogleCalendar
127
150
 
128
151
  # authencate
129
152
  def auth
130
- https = Net::HTTP.new(AUTH_SERVER, 443, @@proxy_addr, @@proxy_port)
153
+ https = Net::HTTP.new(AUTH_SERVER, 443, @@proxy_addr, @@proxy_port, @@proxy_user, @@proxy_pass)
131
154
  https.use_ssl = true
132
155
  https.verify_mode = OpenSSL::SSL::VERIFY_NONE
133
156
  head = {'Content-Type' => 'application/x-www-form-urlencoded'}
@@ -160,7 +183,7 @@ module GoogleCalendar
160
183
 
161
184
  def try_http(uri, header, *args)
162
185
  res = nil
163
- Net::HTTP.start(uri.host, uri.port, @@proxy_addr, @@proxy_port) do |http|
186
+ Net::HTTP.start(uri.host, uri.port, @@proxy_addr, @@proxy_port, @@proxy_user, @@proxy_pass) do |http|
164
187
  header["Cookie"] = @cookie if @cookie
165
188
  res = yield(http, path_with_authorized_query(uri), header, args)
166
189
  if res.code == "302"
@@ -0,0 +1,5 @@
1
+ # This file is a template for parameters.rb
2
+ # Copy this file and change variables below.
3
+ MAIL="user.name@gmail.com"
4
+ PASS="password for gmail account"
5
+ FEED="http://www.google.com/calendar/feeds/XXXXXXXXXXXXXXXXXXXXXXXXXX@group.calendar.google.com/private/full"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: gcalapi
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.3
7
- date: 2006-11-09
6
+ version: 0.0.4
7
+ date: 2006-12-28
8
8
  summary: Google Calendar API
9
9
  require_paths:
10
10
  - lib
@@ -35,6 +35,7 @@ files:
35
35
  - example
36
36
  - VERSION
37
37
  - lib/googlecalendar
38
+ - lib/gcalapi.rb
38
39
  - lib/googlecalendar/calendar.rb
39
40
  - lib/googlecalendar/event.rb
40
41
  - lib/googlecalendar/service.rb
@@ -64,6 +65,7 @@ files:
64
65
  - html/classes/GoogleCalendar/AuthenticationFailed.html
65
66
  - test/each.sh
66
67
  - test/00_service_test.rb
68
+ - test/template.parameters.rb
67
69
  - test/all.sh
68
70
  - test/base_unit.rb
69
71
  - test/01_calendar_test.rb