ideaoforder-www-delicious 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/CHANGELOG.rdoc +46 -0
  2. data/Manifest +49 -0
  3. data/README.rdoc +209 -0
  4. data/Rakefile +55 -0
  5. data/lib/www/delicious/bundle.rb +73 -0
  6. data/lib/www/delicious/element.rb +73 -0
  7. data/lib/www/delicious/errors.rb +46 -0
  8. data/lib/www/delicious/post.rb +123 -0
  9. data/lib/www/delicious/tag.rb +101 -0
  10. data/lib/www/delicious/version.rb +29 -0
  11. data/lib/www/delicious.rb +949 -0
  12. data/setup.rb +1585 -0
  13. data/test/fixtures/net_response_invalid_account.yml +25 -0
  14. data/test/fixtures/net_response_success.yml +23 -0
  15. data/test/helper.rb +49 -0
  16. data/test/test_all.rb +18 -0
  17. data/test/test_offline.rb +18 -0
  18. data/test/test_online.rb +20 -0
  19. data/test/testcases/element/bundle.xml +1 -0
  20. data/test/testcases/element/invalid_root.xml +2 -0
  21. data/test/testcases/element/post.xml +2 -0
  22. data/test/testcases/element/post_unshared.xml +2 -0
  23. data/test/testcases/element/tag.xml +1 -0
  24. data/test/testcases/response/bundles_all.xml +5 -0
  25. data/test/testcases/response/bundles_all_empty.xml +2 -0
  26. data/test/testcases/response/bundles_delete.xml +2 -0
  27. data/test/testcases/response/bundles_set.xml +2 -0
  28. data/test/testcases/response/bundles_set_error.xml +2 -0
  29. data/test/testcases/response/posts_add.xml +2 -0
  30. data/test/testcases/response/posts_all.xml +12 -0
  31. data/test/testcases/response/posts_dates.xml +14 -0
  32. data/test/testcases/response/posts_dates_with_tag.xml +14 -0
  33. data/test/testcases/response/posts_delete.xml +2 -0
  34. data/test/testcases/response/posts_get.xml +7 -0
  35. data/test/testcases/response/posts_get_with_tag.xml +6 -0
  36. data/test/testcases/response/posts_recent.xml +19 -0
  37. data/test/testcases/response/posts_recent_with_tag.xml +19 -0
  38. data/test/testcases/response/tags_get.xml +5 -0
  39. data/test/testcases/response/tags_get_empty.xml +2 -0
  40. data/test/testcases/response/tags_rename.xml +2 -0
  41. data/test/testcases/response/update.delicious1.xml +2 -0
  42. data/test/testcases/response/update.xml +3 -0
  43. data/test/unit/bundle_test.rb +63 -0
  44. data/test/unit/delicious_test.rb +369 -0
  45. data/test/unit/online/online_test.rb +148 -0
  46. data/test/unit/post_test.rb +68 -0
  47. data/test/unit/tag_test.rb +69 -0
  48. data/www-delicious.gemspec +146 -0
  49. metadata +143 -0
@@ -0,0 +1,25 @@
1
+ --- !ruby/object:Net::HTTPUnauthorized
2
+ body: |
3
+ <?xml version="1.0" standalone="yes"?>
4
+ <result code="access denied" />
5
+ <!-- fe02.api.del.ac4.yahoo.net uncompressed/chunked Tue Jul 29 13:53:52 PDT 2008 -->
6
+
7
+ body_exist: true
8
+ code: "401"
9
+ header:
10
+ connection:
11
+ - close
12
+ p3p:
13
+ - policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
14
+ content-type:
15
+ - text/xml; charset=utf-8
16
+ date:
17
+ - Tue, 29 Jul 2008 20:53:52 GMT
18
+ www-authenticate:
19
+ - Basic realm="del.icio.us API"
20
+ transfer-encoding:
21
+ - chunked
22
+ http_version: "1.1"
23
+ message: Unauthorized
24
+ read: true
25
+ socket:
@@ -0,0 +1,23 @@
1
+ --- !ruby/object:Net::HTTPOK
2
+ body: |
3
+ <?xml version="1.0" encoding="UTF-8"?>
4
+ <update time="2008-07-29T19:29:39Z" inboxnew="0"/>
5
+ <!-- fe01.api.del.ac4.yahoo.net uncompressed/chunked Tue Jul 29 13:51:05 PDT 2008 -->
6
+
7
+ body_exist: true
8
+ code: "200"
9
+ header:
10
+ connection:
11
+ - close
12
+ p3p:
13
+ - policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
14
+ content-type:
15
+ - text/xml; charset=utf-8
16
+ date:
17
+ - Tue, 29 Jul 2008 20:51:05 GMT
18
+ transfer-encoding:
19
+ - chunked
20
+ http_version: "1.1"
21
+ message: OK
22
+ read: true
23
+ socket:
data/test/helper.rb ADDED
@@ -0,0 +1,49 @@
1
+ #
2
+ # = WWW::Delicious
3
+ #
4
+ # Ruby client for del.icio.us API.
5
+ #
6
+ #
7
+ # Category:: WWW
8
+ # Package:: WWW::Delicious
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ # SVN: $Id$
14
+ #++
15
+
16
+
17
+ # prepend lib folder
18
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
19
+
20
+ require 'rubygems'
21
+ require 'test/unit'
22
+ require 'www/delicious'
23
+
24
+ gem 'mocha'
25
+ require 'mocha'
26
+
27
+ # testcase file path
28
+ TESTCASES_PATH = File.dirname(__FILE__) + '/testcases' unless defined?(TESTCASES_PATH)
29
+ FIXTURES_PATH = File.dirname(__FILE__) + '/fixtures' unless defined?(FIXTURES_PATH)
30
+
31
+ # prevent online tests to be run automatically
32
+ RUN_ONLINE_TESTS = (ENV['ONLINE'] == "1") unless defined? RUN_ONLINE_TESTS
33
+
34
+ module Test
35
+ module Unit
36
+ class TestCase
37
+
38
+ # asserts all given attributes match mapped value in +instance+.
39
+ # +instance+ is the instance to be tested,
40
+ # +expected_mapping+ is the attribute => value mapping.
41
+ def assert_attributes(instance, expected_mapping)
42
+ expected_mapping.each do |key, value|
43
+ assert_equal(value, instance.send(key.to_sym), "Expected `#{key}` to be `#{value}`")
44
+ end
45
+ end
46
+
47
+ end
48
+ end
49
+ end
data/test/test_all.rb ADDED
@@ -0,0 +1,18 @@
1
+ #
2
+ # = WWW::Delicious
3
+ #
4
+ # Ruby client for del.icio.us API.
5
+ #
6
+ #
7
+ # Category:: WWW
8
+ # Package:: WWW::Delicious
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ # SVN: $Id$
14
+ #++
15
+
16
+
17
+ require File.dirname(__FILE__) + '/helper'
18
+ Dir.glob(File.dirname(__FILE__) + '/unit/**/*_test.rb').sort.each { |unit| require unit }
@@ -0,0 +1,18 @@
1
+ #
2
+ # = WWW::Delicious
3
+ #
4
+ # Ruby client for del.icio.us API.
5
+ #
6
+ #
7
+ # Category:: WWW
8
+ # Package:: WWW::Delicious
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ # SVN: $Id$
14
+ #++
15
+
16
+
17
+ require File.dirname(__FILE__) + '/helper'
18
+ Dir.glob(File.dirname(__FILE__) + '/unit/**/*_test.rb').sort.each { |unit| require unit }
@@ -0,0 +1,20 @@
1
+ #
2
+ # = WWW::Delicious
3
+ #
4
+ # Ruby client for del.icio.us API.
5
+ #
6
+ #
7
+ # Category:: WWW
8
+ # Package:: WWW::Delicious
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ # SVN: $Id$
14
+ #++
15
+
16
+
17
+ RUN_ONLINE_TESTS = true
18
+
19
+ require File.dirname(__FILE__) + '/helper'
20
+ Dir.glob(File.dirname(__FILE__) + '/unit/online/*_test.rb').sort.each { |unit| require unit }
@@ -0,0 +1 @@
1
+ <bundle name="music" tags="ipod mp3 music" />
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <foo />
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0"?>
2
+ <post href="http://www.howtocreate.co.uk/tutorials/texterise.php?dom=1" description="JavaScript DOM reference" extended="dom reference" hash="c0238dc0c44f07daedd9a1fd9bbdeebd" others="55" tag="dom javascript webdev" time="2005-11-28T05:26:09Z"/>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <post href="http://stacktrace.it/articoli/2008/03/i-7-peccati-capitali-del-recruitment-di-hacker/" description="Stacktrace.it: I 7 peccati capitali del recruitment di hacker" hash="2ebd5cea7e3ab24f967c07994703bb4b" others="1" tag="recruitment" time="2008-03-12T08:41:19Z" shared="no" />
@@ -0,0 +1 @@
1
+ <tag count="1" tag="activedesktop" />
@@ -0,0 +1,5 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <bundles>
3
+ <bundle name="music" tags="ipod mp3 music" />
4
+ <bundle name="pc" tags="computer software hardware" />
5
+ </bundles>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <bundles></bundles>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result>done</result>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result>ok</result>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result>you must supply a bundle name and at least one tag</result>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result code="done" />
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <posts user="weppos" update="2008-08-02T11:55:35Z" tag="" total="1702">
3
+ <post href="http://github.com/blog/120-new-to-git" hash="eca1f8a028417349f71077adf64faee8" description="New to Git? — GitHub" tag="scm git" time="2008-07-31T15:44:54Z" others="-1" extended=""/>
4
+ <post href="http://arthurkoziel.com/2008/05/02/git-configuration/" hash="fd68cebf1efc8267755fffdf83d34a65" description="Git Configuration — Arthur Koziel’s Blog" tag="scm git" time="2008-07-31T15:44:19Z" others="-1" extended="Here are some useful configuration options for Git."/>
5
+ <post href="http://whytheluckystiff.net/articles/theFullyUpturnedBin.html" hash="02ae7e6473e6ad87d6d5a8fc254dd274" description=".c( whytheluckystiff )o. -- The Fully Upturned Bin" tag="programming ruby garbagecollection" time="2008-07-31T13:09:26Z" others="-1" extended="About memory management and Garbage Collection in Ruby."/>
6
+ <post href="http://www.learnasp.com/learn/subgetrows.asp" hash="14f798447ad0e8b3f98d6c89773ce345" description="dbtable" tag="programming asp vbscript database" time="2008-07-29T19:29:38Z" others="-1" extended=""/>
7
+ <post href="http://www.xmlfiles.com/articles/seth/xmldatatransfer/default.asp" hash="e3dfcc0f5cf9ce519783b7a9b1904998" description="XML Files - An ASP Class for XML Data Transfer" tag="programming asp vbscript classes xml" time="2008-07-29T19:29:17Z" others="-1" extended=""/>
8
+ <post href="http://aspalliance.com/113" hash="0919ac3a92f0ded1df657459b5e899d7" description="Database Class in Classic ASP: ASP Alliance" tag="programming asp vbscript classes database" time="2008-07-29T19:28:46Z" others="-1" extended=""/>
9
+ <post href="http://www.devguru.com/technologies/vbscript/quickref/classstatement.html" hash="f03f96952bc57d0bb928a174dd47b60c" description="DevGuru VBScript Statement: Class" tag="programming asp vbscript classes" time="2008-07-29T19:28:30Z" others="-1" extended=""/>
10
+ <post href="http://www.asp101.com/articles/richard/ooasp/default.asp" hash="27e4d04e916fa6128c8e75dbf0ee8ab4" description="ASP 101 - Object Oriented ASP: Using Classes in Classic ASP" tag="programming asp vbscript classes" time="2008-07-29T19:28:11Z" others="-1" extended=""/>
11
+ </posts>
12
+ <!-- fe04.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:59:59 PDT 2008 -->
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <dates tag="" user="weppos">
3
+ <date count="3" date="2008-07-31"/>
4
+ <date count="6" date="2008-07-29"/>
5
+ <date count="5" date="2008-07-27"/>
6
+ <date count="1" date="2008-07-25"/>
7
+ <date count="1" date="2008-07-22"/>
8
+ <date count="2" date="2008-07-20"/>
9
+ <date count="3" date="2008-07-19"/>
10
+ <date count="1" date="2008-07-16"/>
11
+ <date count="1" date="2008-07-15"/>
12
+ <date count="2" date="2008-07-14"/>
13
+ </dates>
14
+ <!-- fe02.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:39:33 PDT 2008 -->
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <dates tag="ruby" user="weppos">
3
+ <date count="1" date="2008-07-31"/>
4
+ <date count="1" date="2008-07-29"/>
5
+ <date count="1" date="2008-07-27"/>
6
+ <date count="1" date="2008-07-25"/>
7
+ <date count="2" date="2008-07-20"/>
8
+ <date count="1" date="2008-07-15"/>
9
+ <date count="2" date="2008-07-12"/>
10
+ <date count="1" date="2008-07-11"/>
11
+ <date count="3" date="2008-07-01"/>
12
+ <date count="1" date="2008-06-26"/>
13
+ </dates>
14
+ <!-- fe05.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:40:48 PDT 2008 -->
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result code="done" />
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <posts user="weppos" dt="2008-07-31" tag="">
3
+ <post href="http://github.com/blog/120-new-to-git" hash="eca1f8a028417349f71077adf64faee8" description="New to Git? — GitHub" tag="scm git" time="2008-07-31T15:44:54Z" others="264" extended=""/>
4
+ <post href="http://arthurkoziel.com/2008/05/02/git-configuration/" hash="fd68cebf1efc8267755fffdf83d34a65" description="Git Configuration — Arthur Koziel’s Blog" tag="scm git" time="2008-07-31T15:44:19Z" others="17" extended="Here are some useful configuration options for Git."/>
5
+ <post href="http://whytheluckystiff.net/articles/theFullyUpturnedBin.html" hash="02ae7e6473e6ad87d6d5a8fc254dd274" description=".c( whytheluckystiff )o. -- The Fully Upturned Bin" tag="programming ruby garbagecollection" time="2008-07-31T13:09:26Z" others="317" extended="About memory management and Garbage Collection in Ruby."/>
6
+ </posts>
7
+ <!-- fe02.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:37:09 PDT 2008 -->
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <posts user="weppos" dt="2008-07-31" tag="git">
3
+ <post href="http://github.com/blog/120-new-to-git" hash="eca1f8a028417349f71077adf64faee8" description="New to Git? — GitHub" tag="scm git" time="2008-07-31T15:44:54Z" others="264" extended=""/>
4
+ <post href="http://arthurkoziel.com/2008/05/02/git-configuration/" hash="fd68cebf1efc8267755fffdf83d34a65" description="Git Configuration — Arthur Koziel’s Blog" tag="scm git" time="2008-07-31T15:44:19Z" others="17" extended="Here are some useful configuration options for Git."/>
5
+ </posts>
6
+ <!-- fe05.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:34:47 PDT 2008 -->
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <posts user="weppos" tag="">
3
+ <post href="http://github.com/blog/120-new-to-git" hash="eca1f8a028417349f71077adf64faee8" description="New to Git? — GitHub" tag="scm git" time="2008-07-31T15:44:54Z" others="265" extended=""/>
4
+ <post href="http://arthurkoziel.com/2008/05/02/git-configuration/" hash="fd68cebf1efc8267755fffdf83d34a65" description="Git Configuration — Arthur Koziel’s Blog" tag="scm git" time="2008-07-31T15:44:19Z" others="17" extended="Here are some useful configuration options for Git."/>
5
+ <post href="http://whytheluckystiff.net/articles/theFullyUpturnedBin.html" hash="02ae7e6473e6ad87d6d5a8fc254dd274" description=".c( whytheluckystiff )o. -- The Fully Upturned Bin" tag="programming ruby garbagecollection" time="2008-07-31T13:09:26Z" others="317" extended="About memory management and Garbage Collection in Ruby."/>
6
+ <post href="http://www.learnasp.com/learn/subgetrows.asp" hash="14f798447ad0e8b3f98d6c89773ce345" description="dbtable" tag="programming asp vbscript database" time="2008-07-29T19:29:38Z" others="0" extended=""/>
7
+ <post href="http://www.xmlfiles.com/articles/seth/xmldatatransfer/default.asp" hash="e3dfcc0f5cf9ce519783b7a9b1904998" description="XML Files - An ASP Class for XML Data Transfer" tag="programming asp vbscript classes xml" time="2008-07-29T19:29:17Z" others="14" extended=""/>
8
+ <post href="http://aspalliance.com/113" hash="0919ac3a92f0ded1df657459b5e899d7" description="Database Class in Classic ASP: ASP Alliance" tag="programming asp vbscript classes database" time="2008-07-29T19:28:46Z" others="1" extended=""/>
9
+ <post href="http://www.devguru.com/technologies/vbscript/quickref/classstatement.html" hash="f03f96952bc57d0bb928a174dd47b60c" description="DevGuru VBScript Statement: Class" tag="programming asp vbscript classes" time="2008-07-29T19:28:30Z" others="0" extended=""/>
10
+ <post href="http://www.asp101.com/articles/richard/ooasp/default.asp" hash="27e4d04e916fa6128c8e75dbf0ee8ab4" description="ASP 101 - Object Oriented ASP: Using Classes in Classic ASP" tag="programming asp vbscript classes" time="2008-07-29T19:28:11Z" others="55" extended=""/>
11
+ <post href="http://jonathan.tron.name/2006/07/15/capistrano-password-prompt-tips" hash="c6d91d6ac60b981888b7c03f30c2cfe4" description="Capistrano tips : Jonathan.inspect" tag="programming ruby rails capistrano repository" time="2008-07-29T19:26:21Z" others="5" extended=""/>
12
+ <post href="http://blogoscoped.com/archive/2008-07-24-n43.html" hash="0b25bea7b8c7156b7d6bfcf2a196681a" description="Google Account Phishing Attempt Using Orkut" tag="google account phishing" time="2008-07-27T22:38:41Z" others="1" extended=""/>
13
+ <post href="http://blogoscoped.com/archive/2008-07-24-n24.html" hash="a5b1fe14228bbe7a0b0d2677a071afc8" description="Unicode Graphic Domains" tag="domains unicode" time="2008-07-27T22:38:26Z" others="23" extended=""/>
14
+ <post href="http://www.activexperts.com/axscript/vbscriptclasses/" hash="a7febc77ea1f6f5b8c33220d8bbf0b0d" description="Creating Classes with VBScript" tag="programming asp vbscript classes" time="2008-07-27T10:23:53Z" others="12" extended=""/>
15
+ <post href="http://trac.edgewall.org/wiki/TracTicketTriage" hash="913a5c2326dec39b5d5742e9319f7ba7" description="TracTicketTriage – The Trac Project – Trac" tag="issuetrackers trac project-management workflow tickets" time="2008-07-27T10:21:38Z" others="3" extended="This page lists guidelines and conventions used within the Trac project for triage of tickets."/>
16
+ <post href="http://rails-doc.org/" hash="c2e2bff1c2c263fd11418893d0a9ff32" description="Rails-doc.org: The Rails Documentation App" tag="programming ruby rails documentation" time="2008-07-27T09:19:36Z" others="562" extended="Rails-doc is about accessibility and improvement of Ruby on Rails documentation. Rails-doc provides easy access to documentation for a full line of Rails versions."/>
17
+ <post href="http://www.ricroberts.com/articles/2008/06/26/lightview-for-modal-dialogs-on-rails" hash="4538ebd7cd8c7a680650641e0af5af20" description="RichText | Lightview for modal dialogs on Rails" tag="programming ruby rails lightview javascript ajax" time="2008-07-25T08:59:00Z" others="9" extended=""/>
18
+ </posts>
19
+ <!-- fe01.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:56:16 PDT 2008 -->
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <posts user="weppos" tag="ruby">
3
+ <post href="http://whytheluckystiff.net/articles/theFullyUpturnedBin.html" hash="02ae7e6473e6ad87d6d5a8fc254dd274" description=".c( whytheluckystiff )o. -- The Fully Upturned Bin" tag="programming ruby garbagecollection" time="2008-07-31T13:09:26Z" others="317" extended="About memory management and Garbage Collection in Ruby."/>
4
+ <post href="http://jonathan.tron.name/2006/07/15/capistrano-password-prompt-tips" hash="c6d91d6ac60b981888b7c03f30c2cfe4" description="Capistrano tips : Jonathan.inspect" tag="programming ruby rails capistrano repository" time="2008-07-29T19:26:21Z" others="5" extended=""/>
5
+ <post href="http://rails-doc.org/" hash="c2e2bff1c2c263fd11418893d0a9ff32" description="Rails-doc.org: The Rails Documentation App" tag="programming ruby rails documentation" time="2008-07-27T09:19:36Z" others="562" extended="Rails-doc is about accessibility and improvement of Ruby on Rails documentation. Rails-doc provides easy access to documentation for a full line of Rails versions."/>
6
+ <post href="http://www.ricroberts.com/articles/2008/06/26/lightview-for-modal-dialogs-on-rails" hash="4538ebd7cd8c7a680650641e0af5af20" description="RichText | Lightview for modal dialogs on Rails" tag="programming ruby rails lightview javascript ajax" time="2008-07-25T08:59:00Z" others="9" extended=""/>
7
+ <post href="http://blog.citrusbyte.com/2008/7/18/automate-your-rails-deployment" hash="4ae5b450d116e931964fbbf7d2e7f01a" description="CitrusByte Automate Your Rails Deployment" tag="programming ruby rails capistrano sprinkle mod_rails deployment" time="2008-07-20T08:44:45Z" others="51" extended=""/>
8
+ <post href="http://st-on-it.blogspot.com/2008/07/rails-gettext-crashcourse.html" hash="b77129c8c74e810eaa95628193df5621" description="St. on IT: Rails + Gettext Crash Course" tag="programming ruby rails gettext i18n" time="2008-07-20T08:37:39Z" others="19" extended="This article is a short guide to how use gettext with ruby-on-rails."/>
9
+ <post href="http://google-code-updates.blogspot.com/2008/07/take-your-rails-application-offline.html" hash="4f1e21a58ee016ea3a8061eaeea990af" description="Google Code Blog: Take your Rails application offline with the Gears on Rails project" tag="programming ruby rails offline google gears" time="2008-07-15T22:23:58Z" others="51" extended="Michael Marcus and Rui Ma, two recent graduates from a masters program at NYU, join us to discuss Gears on Rails, their open source framework that makes it easier than ever to take a Rails code-base offline."/>
10
+ <post href="http://ruby.netbeans.org/codetemplates-rhtml.html" hash="81073cfa9d9ab7613c5921076bc10144" description="NetBeans Code Templates For RHTML" tag="programming ruby netbeans textmate cheatsheet" time="2008-07-12T13:28:15Z" others="21" extended=""/>
11
+ <post href="http://ruby.netbeans.org/codetemplates-ruby.html" hash="fc66159d110cf019369280b19d2044be" description="NetBeans Code Templates For Ruby" tag="programming ruby netbeans textmate cheatsheet" time="2008-07-12T13:27:59Z" others="45" extended=""/>
12
+ <post href="http://effectif.com/2008/3/29/opening-ruby-gems-in-textmate" hash="64ea48c10c367ca90e1fcc1899201cbc" description="Opening Ruby gems in TextMate" tag="programming ruby gems textmate shell" time="2008-07-11T19:06:56Z" others="44" extended="How often do you find yourself wanting to check the source code of a locally installed Ruby gem?"/>
13
+ <post href="http://www-128.ibm.com/developerworks/library/wa-mockrails/" hash="9e26ffcae64533e2b6aa87ccf7f26d7d" description="Mocking and stubbing in Ruby on Rails" tag="programming ruby testing mocha mocking stubbing" time="2008-07-01T14:06:13Z" others="11" extended="Understand the basic foundations behind stubbing and mocking techniques and strategies with this hands-on walkthrough using the three most popular mocking frameworks for Ruby."/>
14
+ <post href="http://blog.jasoncrystal.com/?p=7" hash="affa9ca23155fc17e6af63654d8baab7" description="Hexagonal Close-Packed: Packaging Rails apps for offline use" tag="programming ruby rails offline" time="2008-07-01T07:46:13Z" others="95" extended="To package an existing Ruby on Rails application into an executable Mac OS X desktop application. This process (and the result) requires OS X 10.5 (”Leopard”) or later."/>
15
+ <post href="http://giantrobots.thoughtbot.com/2008/6/19/gotchas-when-upgrading-to-rails-2-1" hash="fe59f91a8e76e93c756172d7244f295a" description="Gotchas When Upgrading to Rails 2.1" tag="programming ruby rails rails2.1" time="2008-07-01T07:43:53Z" others="148" extended="We’ve upgraded several Rails 2.0 application to Rails 2.1 now, and we’ve compiled a list of little things to keep in mind as you upgrade. Hopefully this list will help you avoid banging your head against a wall."/>
16
+ <post href="http://weblog.jamisbuck.org/2008/6/13/capistrano-2-4-0" hash="5c74e3d1d99dfee9c0c4eeb00b9fa62c" description="Capistrano 2.4.0" tag="programming ruby rails gems capistrano" time="2008-06-26T21:57:24Z" others="27" extended=""/>
17
+ <post href="http://www.jointheconversation.org/rubygit/" hash="56e75a11bde9394a100f4be17450667f" description="Ruby/Git" tag="programming ruby gems git" time="2008-06-08T20:24:47Z" others="103" extended="Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories."/>
18
+ </posts>
19
+ <!-- fe02.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:56:49 PDT 2008 -->
@@ -0,0 +1,5 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <tags>
3
+ <tag count="1" tag="activedesktop" />
4
+ <tag count="14" tag="business" />
5
+ </tags>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <tags></tags>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <result>done</result>
@@ -0,0 +1,2 @@
1
+ <?xml version='1.0' standalone='yes'?>
2
+ <update time="2008-03-12T08:41:20Z" />
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <update time="2008-08-02T11:55:35Z" inboxnew="0"/>
3
+ <!-- fe04.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 2 13:45:44 PDT 2008 -->
@@ -0,0 +1,63 @@
1
+ #
2
+ # = WWW::Delicious
3
+ #
4
+ # Ruby client for del.icio.us API.
5
+ #
6
+ #
7
+ # Category:: WWW
8
+ # Package:: WWW::Delicious
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ # SVN: $Id$
14
+ #++
15
+
16
+
17
+ require File.dirname(__FILE__) + '/../helper'
18
+ require 'www/delicious/bundle'
19
+
20
+
21
+ class BundleTest < Test::Unit::TestCase
22
+
23
+ def test_bundle
24
+ expected = { :name => 'MyTag', :tags => %w(foo bar) }
25
+ assert_attributes(instance(expected), expected)
26
+ end
27
+
28
+ def test_tag_from_rexml
29
+ dom = REXML::Document.new(File.read(TESTCASES_PATH + '/element/bundle.xml'))
30
+ expected = { :name => 'music', :tags => %w(ipod mp3 music) }
31
+
32
+ element = WWW::Delicious::Bundle.from_rexml(dom.root)
33
+ assert_attributes(element, expected)
34
+ end
35
+
36
+
37
+ def test_bundle_name_strips_whitespaces
38
+ [' foo ', 'foo ', ' foo ', ' foo'].each do |v|
39
+ assert_equal('foo', instance(:name => v).name) # => 'foo'
40
+ end
41
+ end
42
+
43
+ def test_to_s_returns_name_as_string
44
+ assert_equal('foobar', instance(:name => 'foobar', :tags => %w(foo bar)).to_s)
45
+ end
46
+
47
+ def test_to_s_returns_empty_string_with_name_nil
48
+ assert_equal('', instance(:name => nil).to_s)
49
+ end
50
+
51
+
52
+ # def test_valid
53
+ # end
54
+
55
+
56
+ protected
57
+
58
+ # returns a stub instance
59
+ def instance(values = {}, &block)
60
+ WWW::Delicious::Bundle.new(values)
61
+ end
62
+
63
+ end