magnolia 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ BIN_FILES = %w( )
20
20
 
21
21
  NAME = "magnolia"
22
22
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
23
- VERS = ENV['VERSION'] || (Magnolium::VERSION::STRING + (REV ? ".#{REV}" : ""))
23
+ VERS = ENV['VERSION'] || (Magnolia::VERSION::STRING + (REV ? ".#{REV}" : ""))
24
24
  CLEAN.include ['**/.*.sw?', '*.gem', '.config']
25
25
  RDOC_OPTS = ['--quiet', '--title', "magnolia documentation",
26
26
  "--opname", "index.html",
@@ -0,0 +1,576 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Magnolia</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Magnolia</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/magnolia/magnolia_rb.html">
59
+ lib/magnolia/magnolia.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000005">add</a>&nbsp;&nbsp;
90
+ <a href="#M000006">delete</a>&nbsp;&nbsp;
91
+ <a href="#M000004">get</a>&nbsp;&nbsp;
92
+ <a href="#M000001">new</a>&nbsp;&nbsp;
93
+ <a href="#M000003">search</a>&nbsp;&nbsp;
94
+ <a href="#M000002">set_api_key</a>&nbsp;&nbsp;
95
+ <a href="#M000008">tags_add</a>&nbsp;&nbsp;
96
+ <a href="#M000009">tags_delete</a>&nbsp;&nbsp;
97
+ <a href="#M000011">tags_find</a>&nbsp;&nbsp;
98
+ <a href="#M000010">tags_replace</a>&nbsp;&nbsp;
99
+ <a href="#M000007">update</a>&nbsp;&nbsp;
100
+ </div>
101
+ </div>
102
+
103
+ </div>
104
+
105
+
106
+ <!-- if includes -->
107
+
108
+ <div id="section">
109
+
110
+ <div id="class-list">
111
+ <h3 class="section-bar">Classes and Modules</h3>
112
+
113
+ Class <a href="Magnolia/Mark.html" class="link">Magnolia::Mark</a><br />
114
+ Class <a href="Magnolia/Tag.html" class="link">Magnolia::Tag</a><br />
115
+
116
+ </div>
117
+
118
+
119
+ <div id="aliases-list">
120
+ <h3 class="section-bar">External Aliases</h3>
121
+
122
+ <div class="name-list">
123
+ <table summary="aliases">
124
+ <tr class="top-aligned-row context-row">
125
+ <td class="context-item-name">get</td>
126
+ <td>-&gt;</td>
127
+ <td class="context-item-value">find</td>
128
+ </tr>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">add</td>
131
+ <td>-&gt;</td>
132
+ <td class="context-item-value">create</td>
133
+ </tr>
134
+ <tr class="top-aligned-row context-row">
135
+ <td class="context-item-name">delete</td>
136
+ <td>-&gt;</td>
137
+ <td class="context-item-value">destroy</td>
138
+ </tr>
139
+ <tr class="top-aligned-row context-row">
140
+ <td class="context-item-name">update</td>
141
+ <td>-&gt;</td>
142
+ <td class="context-item-value">edit</td>
143
+ </tr>
144
+ <tr class="top-aligned-row context-row">
145
+ <td class="context-item-name">tags_add</td>
146
+ <td>-&gt;</td>
147
+ <td class="context-item-value">add_tags</td>
148
+ </tr>
149
+ <tr class="top-aligned-row context-row">
150
+ <td class="context-item-name">tags_delete</td>
151
+ <td>-&gt;</td>
152
+ <td class="context-item-value">delete_tags</td>
153
+ </tr>
154
+ <tr class="top-aligned-row context-row">
155
+ <td class="context-item-name">tags_replace</td>
156
+ <td>-&gt;</td>
157
+ <td class="context-item-value">replace_tags</td>
158
+ </tr>
159
+ <tr class="top-aligned-row context-row">
160
+ <td class="context-item-name">tags_replace</td>
161
+ <td>-&gt;</td>
162
+ <td class="context-item-value">rename_tags</td>
163
+ </tr>
164
+ <tr class="top-aligned-row context-row">
165
+ <td class="context-item-name">tags_replace</td>
166
+ <td>-&gt;</td>
167
+ <td class="context-item-value">tags_rename</td>
168
+ </tr>
169
+ <tr class="top-aligned-row context-row">
170
+ <td class="context-item-name">tags_find</td>
171
+ <td>-&gt;</td>
172
+ <td class="context-item-value">find_tags</td>
173
+ </tr>
174
+ </table>
175
+ </div>
176
+ </div>
177
+
178
+
179
+
180
+
181
+
182
+ <!-- if method_list -->
183
+ <div id="methods">
184
+ <h3 class="section-bar">Public Class methods</h3>
185
+
186
+ <div id="method-M000005" class="method-detail">
187
+ <a name="M000005"></a>
188
+
189
+ <div class="method-heading">
190
+ <a href="Magnolia.src/M000005.html" target="Code" class="method-signature"
191
+ onclick="popupCode('Magnolia.src/M000005.html');return false;">
192
+ <span class="method-name">add</span><span class="method-args">(mark = {})</span>
193
+ </a>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+ <h2>Examples</h2>
198
+ <pre>
199
+ Magnolia.add(:title =&gt; 'Addicted To New',
200
+ :description =&gt; 'A great site!',
201
+ :url =&gt; 'http://addictedtonew.com/',
202
+ :private =&gt; 'false',
203
+ :tags =&gt; 'cool dude, lame tag, addicting',
204
+ :rating =&gt; 5)
205
+ </pre>
206
+ <h2>Options</h2>
207
+ <pre>
208
+ :url - A URL string. Must be valid (required)
209
+ :title - A title string (optional)
210
+ :description - A description string (optional)
211
+ :private - The bookmark’s privacy status; either 'true' or 'false' (optional)
212
+ :tags - A list of tags. This will completely replace any existing tags for each specified bookmark (optional)
213
+ :rating - An integer representing a star rating; 1-5 (optional)
214
+ </pre>
215
+ <h2>Return Value</h2>
216
+ <p>
217
+ Returns an array containing the added mark
218
+ </p>
219
+ </div>
220
+ </div>
221
+
222
+ <div id="method-M000006" class="method-detail">
223
+ <a name="M000006"></a>
224
+
225
+ <div class="method-heading">
226
+ <a href="Magnolia.src/M000006.html" target="Code" class="method-signature"
227
+ onclick="popupCode('Magnolia.src/M000006.html');return false;">
228
+ <span class="method-name">delete</span><span class="method-args">(marks = {})</span>
229
+ </a>
230
+ </div>
231
+
232
+ <div class="method-description">
233
+ <h2>Examples</h2>
234
+ <pre>
235
+ delone = Magnolia.delete(:id =&gt; 'java')
236
+ delmultiple = Magnolia.delete(:id =&gt; 'java,perl,someotherid')
237
+ deldiff = Magnolia.destroy(:id =&gt; 'someid')
238
+ </pre>
239
+ <h2>Options</h2>
240
+ <pre>
241
+ :id - The short name for one or more bookmarks; seperate multiples with commas (required)
242
+ </pre>
243
+ <h2>Return Value</h2>
244
+ <p>
245
+ Nuttin
246
+ </p>
247
+ </div>
248
+ </div>
249
+
250
+ <div id="method-M000004" class="method-detail">
251
+ <a name="M000004"></a>
252
+
253
+ <div class="method-heading">
254
+ <a href="Magnolia.src/M000004.html" target="Code" class="method-signature"
255
+ onclick="popupCode('Magnolia.src/M000004.html');return false;">
256
+ <span class="method-name">get</span><span class="method-args">(marks = {})</span>
257
+ </a>
258
+ </div>
259
+
260
+ <div class="method-description">
261
+ <p>
262
+ This method is basically like a Ruby on Rails <tt>find</tt> method. Pass it
263
+ a short name (which is basically an id) or comma-seperated short names and
264
+ it will return each mark that is found. Because it is similar to rails
265
+ <tt>find</tt> method, I have aliased it.
266
+ </p>
267
+ <h2>Examples</h2>
268
+ <pre>
269
+ getone = Magnolia.get(:id =&gt; 'rubyonrails')
270
+ getmultiple = Magnolia.get(:id =&gt; 'rubyonrails,ruby,someotherid')
271
+ </pre>
272
+ <p>
273
+ If you like Ruby on Rails and think <tt>find</tt> is a more appropriate
274
+ name for the method, feel free to use it.
275
+ </p>
276
+ <pre>
277
+ getdiff = Magnolia.find(:id =&gt; 'id1')
278
+ </pre>
279
+ <h2>Options</h2>
280
+ <pre>
281
+ :id - The short name for one or more bookmarks; seperate multiples with commas (required)
282
+ </pre>
283
+ <h2>Return Value</h2>
284
+ <p>
285
+ Returns an array of Marks.
286
+ </p>
287
+ </div>
288
+ </div>
289
+
290
+ <div id="method-M000001" class="method-detail">
291
+ <a name="M000001"></a>
292
+
293
+ <div class="method-heading">
294
+ <a href="Magnolia.src/M000001.html" target="Code" class="method-signature"
295
+ onclick="popupCode('Magnolia.src/M000001.html');return false;">
296
+ <span class="method-name">new</span><span class="method-args">(api_key)</span>
297
+ </a>
298
+ </div>
299
+
300
+ <div class="method-description">
301
+ <p>
302
+ This must be called before any of the other methods can be used. It sets a
303
+ class variable named <tt>api_key</tt> which all the other class methods use
304
+ when making requests.
305
+ </p>
306
+ <h2>Example</h2>
307
+ <pre>
308
+ Magnolia.new('yourgreatsuperapikey')
309
+ </pre>
310
+ </div>
311
+ </div>
312
+
313
+ <div id="method-M000003" class="method-detail">
314
+ <a name="M000003"></a>
315
+
316
+ <div class="method-heading">
317
+ <a href="Magnolia.src/M000003.html" target="Code" class="method-signature"
318
+ onclick="popupCode('Magnolia.src/M000003.html');return false;">
319
+ <span class="method-name">search</span><span class="method-args">(options = {})</span>
320
+ </a>
321
+ </div>
322
+
323
+ <div class="method-description">
324
+ <p>
325
+ This method searches for bookmarks that match certain criteria provided by
326
+ you. Ma.gnolia named this method <tt>bookmarks_find</tt> but I thought it
327
+ was more appropriately named <tt><a
328
+ href="Magnolia.html#M000003">search</a></tt>.
329
+ </p>
330
+ <h2>Examples</h2>
331
+ <pre>
332
+ latest = Magnolia.find(:person =&gt; 'jnunemaker') # will find my last ten bookmarks
333
+ recent = Magnolia.find(:person =&gt; 'jnunemaker', :limit =&gt; 20) # will find my last 20 bookmarks
334
+ nice = Magnolia.find(:person =&gt; 'jnunemaker', :tags =&gt; 'nice', :limit =&gt; 5) # will find my last 5 bookmarks tagged 'nice'
335
+ </pre>
336
+ <p>
337
+ Let&#8216;s <a href="Magnolia.html#M000004">get</a> a bit trickier. Below
338
+ will rescue from a request error such as not enough information or person
339
+ not found, etc.
340
+ </p>
341
+ <pre>
342
+ begin
343
+ marks = Magnolia.search(:person =&gt; 'jnunemaker')
344
+ marks.each do |mark|
345
+ puts mark.title, &quot; #{mark.id}&quot;
346
+ end
347
+ rescue Magnolia::RequestError =&gt; msg
348
+ puts msg
349
+ end
350
+ </pre>
351
+ <h2>Options</h2>
352
+ <pre>
353
+ :tags - Multiple tags are treated as an AND search; seperate multiples with commas
354
+ :person - Multiple screen names are treated as an ‘OR’ search; seperate multiples with commas
355
+ :group - Multiple groups are treated as an ‘OR’ search; seperate multiples with commas
356
+ :rating - Only bookmarks rated this value or higher will be returned
357
+ :from - Only bookmarks created after this date time will be returned
358
+ :to - Only bookmarks created before this date time will be returned
359
+ :url - Only return bookmarks with this url
360
+ :limit - A maximum number of bookmarks to return from search
361
+ </pre>
362
+ <h2>Return Value</h2>
363
+ <p>
364
+ Returns an array of Marks.
365
+ </p>
366
+ </div>
367
+ </div>
368
+
369
+ <div id="method-M000002" class="method-detail">
370
+ <a name="M000002"></a>
371
+
372
+ <div class="method-heading">
373
+ <a href="Magnolia.src/M000002.html" target="Code" class="method-signature"
374
+ onclick="popupCode('Magnolia.src/M000002.html');return false;">
375
+ <span class="method-name">set_api_key</span><span class="method-args">(api_key)</span>
376
+ </a>
377
+ </div>
378
+
379
+ <div class="method-description">
380
+ <p>
381
+ Sets the api key for all requests
382
+ </p>
383
+ </div>
384
+ </div>
385
+
386
+ <div id="method-M000008" class="method-detail">
387
+ <a name="M000008"></a>
388
+
389
+ <div class="method-heading">
390
+ <a href="Magnolia.src/M000008.html" target="Code" class="method-signature"
391
+ onclick="popupCode('Magnolia.src/M000008.html');return false;">
392
+ <span class="method-name">tags_add</span><span class="method-args">(mark = {})</span>
393
+ </a>
394
+ </div>
395
+
396
+ <div class="method-description">
397
+ <h2>Examples</h2>
398
+ <pre>
399
+ Magnolia.tags_add(:id =&gt; 'rubyonrails', :tags =&gt; 'fast,simple')
400
+ </pre>
401
+ <p>
402
+ You can also use add_tags if <a href="Magnolia.html#M000008">tags_add</a>
403
+ seems backwards.
404
+ </p>
405
+ <pre>
406
+ Magnolia.add_tags(:id =&gt; 'rubyonrails', :tags =&gt; 'fast,simple')
407
+ </pre>
408
+ <h2>Options</h2>
409
+ <pre>
410
+ :id - One or more bookmark short names to which the specified tags should be added
411
+ :tags - Tags to be added to the specified bookmarks
412
+ </pre>
413
+ <h2>Return Value</h2>
414
+ <p>
415
+ Nuttin
416
+ </p>
417
+ </div>
418
+ </div>
419
+
420
+ <div id="method-M000009" class="method-detail">
421
+ <a name="M000009"></a>
422
+
423
+ <div class="method-heading">
424
+ <a href="Magnolia.src/M000009.html" target="Code" class="method-signature"
425
+ onclick="popupCode('Magnolia.src/M000009.html');return false;">
426
+ <span class="method-name">tags_delete</span><span class="method-args">(mark = {})</span>
427
+ </a>
428
+ </div>
429
+
430
+ <div class="method-description">
431
+ <h2>Examples</h2>
432
+ <pre>
433
+ Magnolia.tags_delete(:id =&gt; 'java', :tags =&gt; 'cool,fun')
434
+ </pre>
435
+ <p>
436
+ You can also use add_tags if <a href="Magnolia.html#M000008">tags_add</a>
437
+ seems backwards.
438
+ </p>
439
+ <pre>
440
+ Magnolia.add_tags(:id =&gt; 'id1', :tags =&gt; 'newtag1,newtag2')
441
+ </pre>
442
+ <h2>Options</h2>
443
+ <pre>
444
+ :id - One or more bookmark short names to which the specified tags should be added
445
+ :tags - Tags to be added to the specified bookmarks
446
+ </pre>
447
+ <h2>Return Value</h2>
448
+ <p>
449
+ Nuttin
450
+ </p>
451
+ </div>
452
+ </div>
453
+
454
+ <div id="method-M000011" class="method-detail">
455
+ <a name="M000011"></a>
456
+
457
+ <div class="method-heading">
458
+ <a href="Magnolia.src/M000011.html" target="Code" class="method-signature"
459
+ onclick="popupCode('Magnolia.src/M000011.html');return false;">
460
+ <span class="method-name">tags_find</span><span class="method-args">(mark = {})</span>
461
+ </a>
462
+ </div>
463
+
464
+ <div class="method-description">
465
+ <h2>Examples</h2>
466
+ <pre>
467
+ tags = Magnolia.tags_find(:person =&gt; 'jnunemaker')
468
+ tags.each do |tag|
469
+ puts tag.name
470
+ end
471
+ </pre>
472
+ <p>
473
+ You can also use the alias of find_tags if it makes more sense to you
474
+ </p>
475
+ <pre>
476
+ tags = Magnolia.find_tags(:person =&gt; 'jnunemaker')
477
+ </pre>
478
+ <h2>Options</h2>
479
+ <pre>
480
+ :person - The person whose tags you would like to find
481
+ </pre>
482
+ <h2>Return Value</h2>
483
+ <p>
484
+ An array of <a href="Magnolia/Tag.html">Tag</a> objects
485
+ </p>
486
+ </div>
487
+ </div>
488
+
489
+ <div id="method-M000010" class="method-detail">
490
+ <a name="M000010"></a>
491
+
492
+ <div class="method-heading">
493
+ <a href="Magnolia.src/M000010.html" target="Code" class="method-signature"
494
+ onclick="popupCode('Magnolia.src/M000010.html');return false;">
495
+ <span class="method-name">tags_replace</span><span class="method-args">(mark = {})</span>
496
+ </a>
497
+ </div>
498
+
499
+ <div class="method-description">
500
+ <h2>Examples</h2>
501
+ <pre>
502
+ Magnolia.tags_replace(:id =&gt; 'languages', :old =&gt; 'java', :new =&gt; 'rubyonrails')
503
+ </pre>
504
+ <p>
505
+ You can also use any of these below if you don&#8216;t like <a
506
+ href="Magnolia.html#M000009">tags_delete</a>
507
+ </p>
508
+ <pre>
509
+ Magnolia.replace_tags(:id =&gt; 'languages', :old =&gt; 'java', :new =&gt; 'rubyonrails')
510
+ Magnolia.rename_tags(:id =&gt; 'languages', :old =&gt; 'java', :new =&gt; 'rubyonrails')
511
+ Magnolia.tags_rename(:id =&gt; 'languages', :old =&gt; 'java', :new =&gt; 'rubyonrails')
512
+ </pre>
513
+ <h2>Options</h2>
514
+ <pre>
515
+ :id - One or more bookmark short names to which the specified tags should be added
516
+ :old - Existing tag to be replaced
517
+ :new - New tag to replace existing tag
518
+ </pre>
519
+ <h2>Return Value</h2>
520
+ <p>
521
+ Nuttin
522
+ </p>
523
+ </div>
524
+ </div>
525
+
526
+ <div id="method-M000007" class="method-detail">
527
+ <a name="M000007"></a>
528
+
529
+ <div class="method-heading">
530
+ <a href="Magnolia.src/M000007.html" target="Code" class="method-signature"
531
+ onclick="popupCode('Magnolia.src/M000007.html');return false;">
532
+ <span class="method-name">update</span><span class="method-args">(mark = {})</span>
533
+ </a>
534
+ </div>
535
+
536
+ <div class="method-description">
537
+ <h2>Examples</h2>
538
+ <pre>
539
+ Magnolia.update(:id =&gt; 'someid',
540
+ :title =&gt; 'Addicted To New',
541
+ :description =&gt; 'A great site!',
542
+ :url =&gt; 'http://addictedtonew.com/',
543
+ :private =&gt; 'false',
544
+ :tags =&gt; 'cool dude, lame tag, addicting',
545
+ :rating =&gt; 5)
546
+ </pre>
547
+ <h2>Options</h2>
548
+ <pre>
549
+ :id - The short name for one bookmark (required)
550
+ :url - A URL string. Must be valid (optional)
551
+ :title - A title string (optional)
552
+ :description - A description string (optional)
553
+ :private - The bookmark’s privacy status; either 'true' or 'false' (optional)
554
+ :tags - A list of tags. This will completely replace any existing tags for each specified bookmark (optional)
555
+ :rating - An integer representing a star rating; 1-5 (optional)
556
+ </pre>
557
+ <h2>Return Value</h2>
558
+ <p>
559
+ Returns an array containing the updated mark.
560
+ </p>
561
+ </div>
562
+ </div>
563
+
564
+
565
+ </div>
566
+
567
+
568
+ </div>
569
+
570
+
571
+ <div id="validator-badges">
572
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
573
+ </div>
574
+
575
+ </body>
576
+ </html>