s33r 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/bin/s3cli.rb +25 -16
  2. data/html/classes/MIME.html +120 -0
  3. data/html/classes/MIME/InvalidContentType.html +119 -0
  4. data/html/classes/MIME/Type.html +1173 -0
  5. data/html/classes/MIME/Types.html +566 -0
  6. data/html/classes/Net.html +108 -0
  7. data/html/classes/Net/HTTPGenericRequest.html +233 -0
  8. data/html/classes/Net/HTTPResponse.html +242 -0
  9. data/html/classes/S33r.html +743 -0
  10. data/html/classes/S33r/BucketListing.html +372 -0
  11. data/html/classes/S33r/Client.html +981 -0
  12. data/html/classes/S33r/NamedBucket.html +620 -0
  13. data/html/classes/S33r/S33rException.html +118 -0
  14. data/html/classes/S33r/S33rException/BucketListingMaxKeysError.html +111 -0
  15. data/html/classes/S33r/S33rException/InvalidBucketListing.html +111 -0
  16. data/html/classes/S33r/S33rException/MalformedBucketName.html +111 -0
  17. data/html/classes/S33r/S33rException/MethodNotAvailable.html +111 -0
  18. data/html/classes/S33r/S33rException/MissingRequiredHeaders.html +111 -0
  19. data/html/classes/S33r/S33rException/MissingResource.html +111 -0
  20. data/html/classes/S33r/S33rException/UnsupportedCannedACL.html +111 -0
  21. data/html/classes/S33r/S33rException/UnsupportedHTTPMethod.html +111 -0
  22. data/html/classes/S33r/S3Object.html +307 -0
  23. data/html/classes/S33r/S3User.html +171 -0
  24. data/html/classes/S33r/Sync.html +151 -0
  25. data/html/classes/XML.html +200 -0
  26. data/html/classes/XML/Document.html +125 -0
  27. data/html/classes/XML/Node.html +124 -0
  28. data/html/created.rid +1 -0
  29. data/html/files/CHANGELOG.html +101 -0
  30. data/html/files/MIT-LICENSE.html +129 -0
  31. data/html/files/README_txt.html +209 -0
  32. data/html/files/lib/s33r/bucket_listing_rb.html +116 -0
  33. data/html/files/lib/s33r/client_rb.html +110 -0
  34. data/html/files/lib/s33r/core_rb.html +113 -0
  35. data/html/files/lib/s33r/libxml_extensions_rb.html +107 -0
  36. data/html/files/lib/s33r/mimetypes_rb.html +120 -0
  37. data/html/files/lib/s33r/named_bucket_rb.html +101 -0
  38. data/html/files/lib/s33r/s33r_exception_rb.html +101 -0
  39. data/html/files/lib/s33r/s33r_http_rb.html +108 -0
  40. data/html/files/lib/s33r/sync_rb.html +101 -0
  41. data/html/files/lib/s33r_rb.html +101 -0
  42. data/html/fr_class_index.html +52 -0
  43. data/html/fr_file_index.html +39 -0
  44. data/html/fr_method_index.html +126 -0
  45. data/html/index.html +24 -0
  46. data/html/rdoc-style.css +208 -0
  47. data/lib/s33r/bucket_listing.rb +69 -60
  48. data/lib/s33r/client.rb +150 -73
  49. data/lib/s33r/core.rb +56 -44
  50. data/lib/s33r/libxml_extensions.rb +10 -5
  51. data/lib/s33r/mimetypes.rb +3 -2
  52. data/lib/s33r/named_bucket.rb +89 -24
  53. data/lib/s33r/{s3_exception.rb → s33r_exception.rb} +2 -2
  54. data/lib/s33r/{net_http_overrides.rb → s33r_http.rb} +29 -21
  55. data/lib/s33r/sync.rb +4 -2
  56. data/test/cases/spec_bucket_listing.rb +10 -13
  57. data/test/cases/spec_client.rb +65 -0
  58. data/test/cases/spec_core.rb +16 -11
  59. data/test/cases/spec_namedbucket.rb +32 -0
  60. data/test/cases/spec_sync.rb +6 -5
  61. data/test/cases/spec_xml.rb +1 -1
  62. data/test/files/client_config.yml +6 -0
  63. data/test/files/namedbucket_config.yml +12 -0
  64. data/test/{s3_test_constants.rb → test_setup.rb} +7 -6
  65. metadata +63 -11
  66. data/LICENSE.txt +0 -22
  67. data/MIT-LICENSE +0 -21
  68. data/README.txt +0 -19
  69. data/bin/config.yml +0 -5
  70. data/test/cases/unit_client.rb +0 -40
  71. data/test/cases/unit_named_bucket.rb +0 -12
@@ -0,0 +1,151 @@
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>Module: S33r::Sync</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>Module</strong></td>
53
+ <td class="class-name-in-header">S33r::Sync</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/s33r/sync_rb.html">
59
+ lib/s33r/sync.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ Woefully incomplete module for performing sync operations. Aim is to enable
78
+ s33r to compare files on the filesystem to S3 objects.
79
+ </p>
80
+
81
+ </div>
82
+
83
+
84
+ </div>
85
+
86
+ <div id="method-list">
87
+ <h3 class="section-bar">Methods</h3>
88
+
89
+ <div class="name-list">
90
+ <a href="#M000053">md5sum</a>&nbsp;&nbsp;
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <!-- if method_list -->
109
+ <div id="methods">
110
+ <h3 class="section-bar">Public Instance methods</h3>
111
+
112
+ <div id="method-M000053" class="method-detail">
113
+ <a name="M000053"></a>
114
+
115
+ <div class="method-heading">
116
+ <a href="#M000053" class="method-signature">
117
+ <span class="method-name">md5sum</span><span class="method-args">(filename)</span>
118
+ </a>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+ <p>
123
+ Get the MD5 checksum for a file (comparable to the ETag on S3 objects).
124
+ </p>
125
+ <p><a class="source-toggle" href="#"
126
+ onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
127
+ <div class="method-source-code" id="M000053-source">
128
+ <pre>
129
+ <span class="ruby-comment cmt"># File lib/s33r/sync.rb, line 7</span>
130
+ 7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">md5sum</span>(<span class="ruby-identifier">filename</span>)
131
+ 8: <span class="ruby-identifier">f</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">binmode</span>
132
+ 9: <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>)
133
+ 10: <span class="ruby-keyword kw">end</span>
134
+ </pre>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+
143
+ </div>
144
+
145
+
146
+ <div id="validator-badges">
147
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
148
+ </div>
149
+
150
+ </body>
151
+ </html>
@@ -0,0 +1,200 @@
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>Module: XML</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>Module</strong></td>
53
+ <td class="class-name-in-header">XML</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/s33r/libxml_extensions_rb.html">
59
+ lib/s33r/libxml_extensions.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ Convenience methods for libxml classes.
78
+ </p>
79
+
80
+ </div>
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="#M000002">get_xml_doc</a>&nbsp;&nbsp;
90
+ <a href="#M000001">xget</a>&nbsp;&nbsp;
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+ <div id="class-list">
102
+ <h3 class="section-bar">Classes and Modules</h3>
103
+
104
+ Class <a href="XML/Document.html" class="link">XML::Document</a><br />
105
+ Class <a href="XML/Node.html" class="link">XML::Node</a><br />
106
+
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ <!-- if method_list -->
116
+ <div id="methods">
117
+ <h3 class="section-bar">Public Class methods</h3>
118
+
119
+ <div id="method-M000002" class="method-detail">
120
+ <a name="M000002"></a>
121
+
122
+ <div class="method-heading">
123
+ <a href="#M000002" class="method-signature">
124
+ <span class="method-name">get_xml_doc</span><span class="method-args">(xml_str)</span>
125
+ </a>
126
+ </div>
127
+
128
+ <div class="method-description">
129
+ <p>
130
+ Parse an <a href="XML.html">XML</a> string into an <a
131
+ href="XML/Document.html">XML::Document</a> instance.
132
+ </p>
133
+ <p><a class="source-toggle" href="#"
134
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
135
+ <div class="method-source-code" id="M000002-source">
136
+ <pre>
137
+ <span class="ruby-comment cmt"># File lib/s33r/libxml_extensions.rb, line 19</span>
138
+ 19: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">XML</span>.<span class="ruby-identifier">get_xml_doc</span>(<span class="ruby-identifier">xml_str</span>)
139
+ 20: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">new</span>
140
+ 21: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">string</span> = <span class="ruby-identifier">xml_str</span>
141
+ 22: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>
142
+ 23: <span class="ruby-keyword kw">end</span>
143
+ </pre>
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <h3 class="section-bar">Public Instance methods</h3>
149
+
150
+ <div id="method-M000001" class="method-detail">
151
+ <a name="M000001"></a>
152
+
153
+ <div class="method-heading">
154
+ <a href="#M000001" class="method-signature">
155
+ <span class="method-name">xget</span><span class="method-args">(xpath)</span>
156
+ </a>
157
+ </div>
158
+
159
+ <div class="method-description">
160
+ <p>
161
+ Find first matching element and return its content (intended for use as a
162
+ mixed-in method for <a href="XML/Document.html">Document</a> instances).
163
+ </p>
164
+ <p>
165
+ <tt>xpath</tt>: XPath query to run against self.
166
+ </p>
167
+ <p>
168
+ Returns nil if no element matches <tt>xpath</tt>.
169
+ </p>
170
+ <p><a class="source-toggle" href="#"
171
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
172
+ <div class="method-source-code" id="M000001-source">
173
+ <pre>
174
+ <span class="ruby-comment cmt"># File lib/s33r/libxml_extensions.rb, line 9</span>
175
+ 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xget</span>(<span class="ruby-identifier">xpath</span>)
176
+ 10: <span class="ruby-identifier">nodes</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">xpath</span>).<span class="ruby-identifier">to_a</span>
177
+ 11: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">empty?</span>
178
+ 12: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
179
+ 13: <span class="ruby-keyword kw">else</span>
180
+ 14: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">content</span>
181
+ 15: <span class="ruby-keyword kw">end</span>
182
+ 16: <span class="ruby-keyword kw">end</span>
183
+ </pre>
184
+ </div>
185
+ </div>
186
+ </div>
187
+
188
+
189
+ </div>
190
+
191
+
192
+ </div>
193
+
194
+
195
+ <div id="validator-badges">
196
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
197
+ </div>
198
+
199
+ </body>
200
+ </html>
@@ -0,0 +1,125 @@
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: XML::Document</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">XML::Document</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/s33r/libxml_extensions_rb.html">
59
+ lib/s33r/libxml_extensions.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
+ <div id="description">
82
+ <p>
83
+ Make custom methods accessible to <a href="Document.html">Document</a>
84
+ class.
85
+ </p>
86
+
87
+ </div>
88
+
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <!-- if includes -->
97
+ <div id="includes">
98
+ <h3 class="section-bar">Included Modules</h3>
99
+
100
+ <div id="includes-list">
101
+ <span class="include-name"><a href="../XML.html">XML</a></span>
102
+ </div>
103
+ </div>
104
+
105
+ <div id="section">
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <!-- if method_list -->
115
+
116
+
117
+ </div>
118
+
119
+
120
+ <div id="validator-badges">
121
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
122
+ </div>
123
+
124
+ </body>
125
+ </html>