www-delicious 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +41 -0
- data/{MIT-LICENSE → MIT-LICENSE.rdoc} +0 -0
- data/Manifest +49 -0
- data/{README → README.rdoc} +13 -14
- data/Rakefile +36 -118
- data/TODO +4 -0
- data/lib/www/delicious.rb +527 -446
- data/lib/www/delicious/bundle.rb +41 -22
- data/lib/www/delicious/element.rb +72 -0
- data/lib/www/delicious/errors.rb +2 -2
- data/lib/www/delicious/post.rb +71 -61
- data/lib/www/delicious/tag.rb +43 -62
- data/lib/www/delicious/version.rb +1 -1
- data/test/fixtures/net_response_invalid_account.yml +25 -0
- data/test/fixtures/net_response_success.yml +23 -0
- data/test/helper.rb +19 -79
- data/test/test_all.rb +17 -0
- data/test/test_offline.rb +17 -0
- data/test/test_online.rb +19 -0
- data/test/testcases/element/bundle.xml +1 -0
- data/test/testcases/element/invalid_root.xml +2 -0
- data/test/testcases/element/post.xml +2 -0
- data/test/testcases/element/post_unshared.xml +2 -0
- data/test/testcases/element/tag.xml +1 -0
- data/test/testcases/response/bundles_all.xml +5 -0
- data/test/testcases/response/bundles_all_empty.xml +2 -0
- data/test/testcases/response/bundles_delete.xml +2 -0
- data/test/testcases/response/bundles_set.xml +2 -0
- data/test/testcases/response/bundles_set_error.xml +2 -0
- data/test/testcases/response/posts_add.xml +2 -0
- data/test/testcases/response/posts_all.xml +12 -0
- data/test/testcases/response/posts_dates.xml +14 -0
- data/test/testcases/response/posts_dates_with_tag.xml +14 -0
- data/test/testcases/response/posts_delete.xml +2 -0
- data/test/testcases/response/posts_get.xml +7 -0
- data/test/testcases/response/posts_get_with_tag.xml +6 -0
- data/test/testcases/response/posts_recent.xml +19 -0
- data/test/testcases/response/posts_recent_with_tag.xml +19 -0
- data/test/testcases/response/tags_get.xml +5 -0
- data/test/testcases/response/tags_get_empty.xml +2 -0
- data/test/testcases/response/tags_rename.xml +2 -0
- data/test/testcases/response/update.delicious1.xml +2 -0
- data/test/testcases/response/update.xml +3 -0
- data/test/unit/bundle_test.rb +62 -0
- data/test/unit/delicious_test.rb +186 -238
- data/test/unit/online/online_test.rb +147 -0
- data/test/unit/post_test.rb +67 -0
- data/test/unit/tag_test.rb +68 -0
- data/www-delicious.gemspec +146 -0
- metadata +85 -31
- data/CHANGELOG +0 -5
- data/test/unit/delicious_bundle_test.rb +0 -90
- data/test/unit/delicious_online_test.rb +0 -143
- data/test/unit/delicious_post_test.rb +0 -102
- data/test/unit/delicious_tag_test.rb +0 -140
@@ -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
CHANGED
@@ -16,93 +16,33 @@
|
|
16
16
|
# prepend lib folder
|
17
17
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
18
18
|
|
19
|
+
require 'rubygems'
|
19
20
|
require 'test/unit'
|
20
21
|
require 'www/delicious'
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
TEST_REAL_TESTS = ENV['DUSERNAME'] && ENV['DPASSWORD'] unless defined?(TEST_REAL_TESTS)
|
25
|
-
|
26
|
-
|
27
|
-
module WWW
|
28
|
-
class Delicious
|
29
|
-
module TestCase
|
30
|
-
|
31
|
-
TEST_USERNAME = 'u' unless defined? TEST_USERNAME
|
32
|
-
TEST_PASSWORD = 'p' unless defined? TEST_PASSWORD
|
33
|
-
|
34
|
-
def setup
|
35
|
-
@default_username = ENV['DUSERNAME'] || TEST_USERNAME
|
36
|
-
@default_password = ENV['DPASSWORD'] || TEST_PASSWORD
|
37
|
-
@run_online_tests = false
|
38
|
-
@run_real_tests = TEST_REAL_TESTS
|
39
|
-
end
|
40
|
-
|
41
|
-
protected
|
42
|
-
#
|
43
|
-
# Returns a valid instance of <tt>WWW::Delicious</tt>
|
44
|
-
# initialized with given +options+.
|
45
|
-
#
|
46
|
-
def instance(options = {}, &block)
|
47
|
-
username = options.delete(:username) || @default_username
|
48
|
-
password = options.delete(:password) || @default_password
|
49
|
-
return WWW::Delicious.new(username, password, options, &block)
|
50
|
-
end
|
23
|
+
gem 'mocha'
|
24
|
+
require 'mocha'
|
51
25
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
def skip_online?
|
57
|
-
return !@run_online_tests
|
58
|
-
end
|
26
|
+
# testcase file path
|
27
|
+
TESTCASES_PATH = File.dirname(__FILE__) + '/testcases' unless defined?(TESTCASES_PATH)
|
28
|
+
FIXTURES_PATH = File.dirname(__FILE__) + '/fixtures' unless defined?(FIXTURES_PATH)
|
59
29
|
|
60
|
-
|
61
|
-
|
62
|
-
# Loads a marshaled response for given +path+.
|
63
|
-
#
|
64
|
-
def load_response(path)
|
65
|
-
return Marshal.load(File.read(path))
|
66
|
-
end
|
30
|
+
# prevent online tests to be run automatically
|
31
|
+
RUN_ONLINE_TESTS = (ENV['ONLINE'] == "1") unless defined? RUN_ONLINE_TESTS
|
67
32
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
#
|
72
|
-
def set_response(content, path = nil)
|
73
|
-
path ||= TESTCASE_PATH + '/marshaled_response'
|
74
|
-
response = Marshal.load(File.read(path))
|
75
|
-
response.instance_variable_set(:@body, content)
|
76
|
-
Net::HTTP.response = response
|
77
|
-
end
|
33
|
+
module Test
|
34
|
+
module Unit
|
35
|
+
class TestCase
|
78
36
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
class << self
|
88
|
-
def response()
|
89
|
-
r = @@offline_response ||= Marshal.load(File.read(TESTCASE_PATH + '/marshaled_response'))
|
90
|
-
@@offline_response = nil
|
91
|
-
r
|
92
|
-
end
|
93
|
-
def response=(r)
|
94
|
-
@@offline_response = r
|
37
|
+
# asserts all given attributes match mapped value in +instance+.
|
38
|
+
# +instance+ is the instance to be tested,
|
39
|
+
# +expected_mapping+ is the attribute => value mapping.
|
40
|
+
def assert_attributes(instance, expected_mapping)
|
41
|
+
expected_mapping.each do |key, value|
|
42
|
+
assert_equal(value, instance.send(key.to_sym), "Expected `#{key}` to be `#{value}`")
|
43
|
+
end
|
95
44
|
end
|
45
|
+
|
96
46
|
end
|
97
|
-
|
98
|
-
alias :request_online :request
|
99
|
-
def request_offline(req, body = nil, &block)
|
100
|
-
return self.class.response
|
101
|
-
end
|
102
|
-
|
103
|
-
# prepare for offline tests
|
104
|
-
remove_method :request
|
105
|
-
alias :request :request_offline
|
106
47
|
end
|
107
48
|
end
|
108
|
-
|
data/test/test_all.rb
ADDED
@@ -0,0 +1,17 @@
|
|
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
|
+
#
|
11
|
+
#--
|
12
|
+
# SVN: $Id$
|
13
|
+
#++
|
14
|
+
|
15
|
+
|
16
|
+
require File.dirname(__FILE__) + '/helper'
|
17
|
+
Dir.glob(File.dirname(__FILE__) + '/unit/**/*_test.rb').sort.each { |unit| require unit }
|
@@ -0,0 +1,17 @@
|
|
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
|
+
#
|
11
|
+
#--
|
12
|
+
# SVN: $Id$
|
13
|
+
#++
|
14
|
+
|
15
|
+
|
16
|
+
require File.dirname(__FILE__) + '/helper'
|
17
|
+
Dir.glob(File.dirname(__FILE__) + '/unit/**/*_test.rb').sort.each { |unit| require unit }
|
data/test/test_online.rb
ADDED
@@ -0,0 +1,19 @@
|
|
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
|
+
#
|
11
|
+
#--
|
12
|
+
# SVN: $Id$
|
13
|
+
#++
|
14
|
+
|
15
|
+
|
16
|
+
RUN_ONLINE_TESTS = true
|
17
|
+
|
18
|
+
require File.dirname(__FILE__) + '/helper'
|
19
|
+
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
|
+
<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,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,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,62 @@
|
|
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
|
+
#
|
11
|
+
#--
|
12
|
+
# SVN: $Id$
|
13
|
+
#++
|
14
|
+
|
15
|
+
|
16
|
+
require File.dirname(__FILE__) + '/../helper'
|
17
|
+
require 'www/delicious/bundle'
|
18
|
+
|
19
|
+
|
20
|
+
class BundleTest < Test::Unit::TestCase
|
21
|
+
|
22
|
+
def test_bundle
|
23
|
+
expected = { :name => 'MyTag', :tags => %w(foo bar) }
|
24
|
+
assert_attributes(instance(expected), expected)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_tag_from_rexml
|
28
|
+
dom = REXML::Document.new(File.read(TESTCASES_PATH + '/element/bundle.xml'))
|
29
|
+
expected = { :name => 'music', :tags => %w(ipod mp3 music) }
|
30
|
+
|
31
|
+
element = WWW::Delicious::Bundle.from_rexml(dom.root)
|
32
|
+
assert_attributes(element, expected)
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
def test_bundle_name_strips_whitespaces
|
37
|
+
[' foo ', 'foo ', ' foo ', ' foo'].each do |v|
|
38
|
+
assert_equal('foo', instance(:name => v).name) # => 'foo'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_to_s_returns_name_as_string
|
43
|
+
assert_equal('foobar', instance(:name => 'foobar', :tags => %w(foo bar)).to_s)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_to_s_returns_empty_string_with_name_nil
|
47
|
+
assert_equal('', instance(:name => nil).to_s)
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
# def test_valid
|
52
|
+
# end
|
53
|
+
|
54
|
+
|
55
|
+
protected
|
56
|
+
|
57
|
+
# returns a stub instance
|
58
|
+
def instance(values = {}, &block)
|
59
|
+
WWW::Delicious::Bundle.new(values)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|