gandirb 1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/CHANGELOG +1 -0
  2. data/LICENSE +19 -0
  3. data/README +35 -0
  4. data/Rakefile +32 -0
  5. data/gandirb.gemspec +34 -0
  6. data/lib/gandi/base.rb +121 -0
  7. data/lib/gandi/domain.rb +134 -0
  8. data/lib/gandi/domain_modules/contact.rb +36 -0
  9. data/lib/gandi/domain_modules/host.rb +29 -0
  10. data/lib/gandi/domain_modules/mail.rb +80 -0
  11. data/lib/gandi/domain_modules/name_servers.rb +28 -0
  12. data/lib/gandi/domain_modules/operations.rb +30 -0
  13. data/lib/gandi/domain_modules/redirection.rb +25 -0
  14. data/lib/gandi.rb +9 -0
  15. data/rdoc/classes/Gandi/Base.html +397 -0
  16. data/rdoc/classes/Gandi/DataError.html +111 -0
  17. data/rdoc/classes/Gandi/Domain.html +623 -0
  18. data/rdoc/classes/Gandi/DomainModules/Contact.html +246 -0
  19. data/rdoc/classes/Gandi/DomainModules/Host.html +227 -0
  20. data/rdoc/classes/Gandi/DomainModules/NameServers.html +226 -0
  21. data/rdoc/classes/Gandi/DomainModules/Operations.html +229 -0
  22. data/rdoc/classes/Gandi/DomainModules/Redirection.html +215 -0
  23. data/rdoc/classes/Gandi/DomainModules.html +136 -0
  24. data/rdoc/classes/Gandi/ServerError.html +111 -0
  25. data/rdoc/classes/Gandi.html +153 -0
  26. data/rdoc/created.rid +1 -0
  27. data/rdoc/files/README.html +162 -0
  28. data/rdoc/files/lib/gandi/base_rb.html +109 -0
  29. data/rdoc/files/lib/gandi/domain_modules/contact_rb.html +101 -0
  30. data/rdoc/files/lib/gandi/domain_modules/host_rb.html +101 -0
  31. data/rdoc/files/lib/gandi/domain_modules/name_servers_rb.html +101 -0
  32. data/rdoc/files/lib/gandi/domain_modules/operations_rb.html +101 -0
  33. data/rdoc/files/lib/gandi/domain_modules/redirection_rb.html +101 -0
  34. data/rdoc/files/lib/gandi/domain_rb.html +101 -0
  35. data/rdoc/files/lib/gandi_rb.html +101 -0
  36. data/rdoc/fr_class_index.html +38 -0
  37. data/rdoc/fr_file_index.html +36 -0
  38. data/rdoc/fr_method_index.html +83 -0
  39. data/rdoc/index.html +24 -0
  40. data/rdoc/rdoc-style.css +208 -0
  41. data/test/gandi/base_test.rb +188 -0
  42. data/test/gandi/domain_test.rb +302 -0
  43. data/test/gandi_test.rb +9 -0
  44. data/test/test_helper.rb +9 -0
  45. metadata +124 -0
@@ -0,0 +1,246 @@
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: Gandi::DomainModules::Contact</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">Gandi::DomainModules::Contact</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/gandi/domain_modules/contact_rb.html">
59
+ lib/gandi/domain_modules/contact.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
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000001">contact_create</a>&nbsp;&nbsp;
84
+ <a href="#M000003">contact_del</a>&nbsp;&nbsp;
85
+ <a href="#M000004">contact_info</a>&nbsp;&nbsp;
86
+ <a href="#M000002">contact_update</a>&nbsp;&nbsp;
87
+ </div>
88
+ </div>
89
+
90
+ </div>
91
+
92
+
93
+ <!-- if includes -->
94
+
95
+ <div id="section">
96
+
97
+
98
+ <div id="constants-list">
99
+ <h3 class="section-bar">Constants</h3>
100
+
101
+ <div class="name-list">
102
+ <table summary="Constants">
103
+ <tr class="top-aligned-row context-row">
104
+ <td class="context-item-name">CONTACT_CLASSES</td>
105
+ <td>=</td>
106
+ <td class="context-item-value">['individual', 'company', 'public', 'association']</td>
107
+ </tr>
108
+ </table>
109
+ </div>
110
+ </div>
111
+
112
+
113
+
114
+
115
+
116
+
117
+ <!-- if method_list -->
118
+ <div id="methods">
119
+ <h3 class="section-bar">Public Instance methods</h3>
120
+
121
+ <div id="method-M000001" class="method-detail">
122
+ <a name="M000001"></a>
123
+
124
+ <div class="method-heading">
125
+ <a href="#M000001" class="method-signature">
126
+ <span class="method-name">contact_create</span><span class="method-args">(contact_class, firstname, lastname, address, zipcode, city, country, phone, email, params = {})</span>
127
+ </a>
128
+ </div>
129
+
130
+ <div class="method-description">
131
+ <p>
132
+ Create a <a href="../../Gandi.html">Gandi</a> contact of a given type. See
133
+ glossary, Account. Return the <a href="../../Gandi.html">Gandi</a> handle
134
+ of the created contact TODO check contact class
135
+ </p>
136
+ <p><a class="source-toggle" href="#"
137
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
138
+ <div class="method-source-code" id="M000001-source">
139
+ <pre>
140
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/contact.rb, line 9</span>
141
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contact_create</span>(<span class="ruby-identifier">contact_class</span>, <span class="ruby-identifier">firstname</span>, <span class="ruby-identifier">lastname</span>, <span class="ruby-identifier">address</span>, <span class="ruby-identifier">zipcode</span>, <span class="ruby-identifier">city</span>, <span class="ruby-identifier">country</span>, <span class="ruby-identifier">phone</span>, <span class="ruby-identifier">email</span>, <span class="ruby-identifier">params</span> = {})
142
+ <span class="ruby-comment cmt">#Note: contact_class argument is used instead of class (due to a ruby keyword conflict)</span>
143
+ <span class="ruby-identifier">args</span> = [<span class="ruby-identifier">contact_class</span>, <span class="ruby-identifier">firstname</span>, <span class="ruby-identifier">lastname</span>, <span class="ruby-identifier">address</span>, <span class="ruby-identifier">zipcode</span>, <span class="ruby-identifier">city</span>, <span class="ruby-identifier">country</span>, <span class="ruby-identifier">phone</span>, <span class="ruby-identifier">email</span>, <span class="ruby-identifier">params</span>]
144
+ <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">empty?</span>
145
+
146
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'contact_create'</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
147
+ <span class="ruby-keyword kw">end</span>
148
+ </pre>
149
+ </div>
150
+ </div>
151
+ </div>
152
+
153
+ <div id="method-M000003" class="method-detail">
154
+ <a name="M000003"></a>
155
+
156
+ <div class="method-heading">
157
+ <a href="#M000003" class="method-signature">
158
+ <span class="method-name">contact_del</span><span class="method-args">(handle)</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p>
164
+ Delete a <a href="../../Gandi.html">Gandi</a> contact Return the operation
165
+ attributed ID
166
+ </p>
167
+ <p><a class="source-toggle" href="#"
168
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
169
+ <div class="method-source-code" id="M000003-source">
170
+ <pre>
171
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/contact.rb, line 26</span>
172
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contact_del</span>(<span class="ruby-identifier">handle</span>)
173
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'contact_del'</span>, <span class="ruby-identifier">handle</span>)
174
+ <span class="ruby-keyword kw">end</span>
175
+ </pre>
176
+ </div>
177
+ </div>
178
+ </div>
179
+
180
+ <div id="method-M000004" class="method-detail">
181
+ <a name="M000004"></a>
182
+
183
+ <div class="method-heading">
184
+ <a href="#M000004" class="method-signature">
185
+ <span class="method-name">contact_info</span><span class="method-args">(handle)</span>
186
+ </a>
187
+ </div>
188
+
189
+ <div class="method-description">
190
+ <p>
191
+ Retrieve a hash of <a href="../../Gandi.html">Gandi</a> contact
192
+ informations
193
+ </p>
194
+ <p><a class="source-toggle" href="#"
195
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
196
+ <div class="method-source-code" id="M000004-source">
197
+ <pre>
198
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/contact.rb, line 31</span>
199
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contact_info</span>(<span class="ruby-identifier">handle</span>)
200
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'contact_info'</span>, <span class="ruby-identifier">handle</span>)
201
+ <span class="ruby-keyword kw">end</span>
202
+ </pre>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <div id="method-M000002" class="method-detail">
208
+ <a name="M000002"></a>
209
+
210
+ <div class="method-heading">
211
+ <a href="#M000002" class="method-signature">
212
+ <span class="method-name">contact_update</span><span class="method-args">(handle, params)</span>
213
+ </a>
214
+ </div>
215
+
216
+ <div class="method-description">
217
+ <p>
218
+ Update a <a href="../../Gandi.html">Gandi</a> contact Return the operation
219
+ attributed ID TODO: check for frozen params
220
+ </p>
221
+ <p><a class="source-toggle" href="#"
222
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
223
+ <div class="method-source-code" id="M000002-source">
224
+ <pre>
225
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/contact.rb, line 20</span>
226
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contact_update</span>(<span class="ruby-identifier">handle</span>, <span class="ruby-identifier">params</span>)
227
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'contact_update'</span>, <span class="ruby-identifier">handle</span>, <span class="ruby-identifier">params</span>)
228
+ <span class="ruby-keyword kw">end</span>
229
+ </pre>
230
+ </div>
231
+ </div>
232
+ </div>
233
+
234
+
235
+ </div>
236
+
237
+
238
+ </div>
239
+
240
+
241
+ <div id="validator-badges">
242
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
243
+ </div>
244
+
245
+ </body>
246
+ </html>
@@ -0,0 +1,227 @@
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: Gandi::DomainModules::Host</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">Gandi::DomainModules::Host</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/gandi/domain_modules/host_rb.html">
59
+ lib/gandi/domain_modules/host.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
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000031">host_create</a>&nbsp;&nbsp;
84
+ <a href="#M000032">host_delete</a>&nbsp;&nbsp;
85
+ <a href="#M000030">host_info</a>&nbsp;&nbsp;
86
+ <a href="#M000029">host_list</a>&nbsp;&nbsp;
87
+ </div>
88
+ </div>
89
+
90
+ </div>
91
+
92
+
93
+ <!-- if includes -->
94
+
95
+ <div id="section">
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ <!-- if method_list -->
105
+ <div id="methods">
106
+ <h3 class="section-bar">Public Instance methods</h3>
107
+
108
+ <div id="method-M000031" class="method-detail">
109
+ <a name="M000031"></a>
110
+
111
+ <div class="method-heading">
112
+ <a href="#M000031" class="method-signature">
113
+ <span class="method-name">host_create</span><span class="method-args">(host, ip)</span>
114
+ </a>
115
+ </div>
116
+
117
+ <div class="method-description">
118
+ <p>
119
+ Create a glue record with the specified IP addresses. This implementation
120
+ does not respect the original API specifications and allow for a single IP
121
+ to be provided. An array of IPs can be provided but only the first IP is
122
+ used (this is an API limitation). Return the operation attributed ID
123
+ </p>
124
+ <p><a class="source-toggle" href="#"
125
+ onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
126
+ <div class="method-source-code" id="M000031-source">
127
+ <pre>
128
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/host.rb, line 18</span>
129
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host_create</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">ip</span>)
130
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'host_create'</span>, <span class="ruby-identifier">host</span>, [<span class="ruby-identifier">ip</span>].<span class="ruby-identifier">flatten</span>)
131
+ <span class="ruby-keyword kw">end</span>
132
+ </pre>
133
+ </div>
134
+ </div>
135
+ </div>
136
+
137
+ <div id="method-M000032" class="method-detail">
138
+ <a name="M000032"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="#M000032" class="method-signature">
142
+ <span class="method-name">host_delete</span><span class="method-args">(host)</span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ <p>
148
+ Delete a host. Return the operation attributed ID
149
+ </p>
150
+ <p><a class="source-toggle" href="#"
151
+ onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
152
+ <div class="method-source-code" id="M000032-source">
153
+ <pre>
154
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/host.rb, line 24</span>
155
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host_delete</span>(<span class="ruby-identifier">host</span>)
156
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'host_delete'</span>, <span class="ruby-identifier">host</span>)
157
+ <span class="ruby-keyword kw">end</span>
158
+ </pre>
159
+ </div>
160
+ </div>
161
+ </div>
162
+
163
+ <div id="method-M000030" class="method-detail">
164
+ <a name="M000030"></a>
165
+
166
+ <div class="method-heading">
167
+ <a href="#M000030" class="method-signature">
168
+ <span class="method-name">host_info</span><span class="method-args">(fqdn)</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p>
174
+ Retrieve an array of the IP addresses linked to this hostname.
175
+ </p>
176
+ <p><a class="source-toggle" href="#"
177
+ onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
178
+ <div class="method-source-code" id="M000030-source">
179
+ <pre>
180
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/host.rb, line 10</span>
181
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host_info</span>(<span class="ruby-identifier">fqdn</span>)
182
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'host_info'</span>, <span class="ruby-identifier">fqdn</span>)
183
+ <span class="ruby-keyword kw">end</span>
184
+ </pre>
185
+ </div>
186
+ </div>
187
+ </div>
188
+
189
+ <div id="method-M000029" class="method-detail">
190
+ <a name="M000029"></a>
191
+
192
+ <div class="method-heading">
193
+ <a href="#M000029" class="method-signature">
194
+ <span class="method-name">host_list</span><span class="method-args">(domain)</span>
195
+ </a>
196
+ </div>
197
+
198
+ <div class="method-description">
199
+ <p>
200
+ Returns the array of glue records for the specified domain.
201
+ </p>
202
+ <p><a class="source-toggle" href="#"
203
+ onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
204
+ <div class="method-source-code" id="M000029-source">
205
+ <pre>
206
+ <span class="ruby-comment cmt"># File lib/gandi/domain_modules/host.rb, line 5</span>
207
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host_list</span>(<span class="ruby-identifier">domain</span>)
208
+ <span class="ruby-identifier">call</span>(<span class="ruby-value str">'host_list'</span>, <span class="ruby-identifier">domain</span>)
209
+ <span class="ruby-keyword kw">end</span>
210
+ </pre>
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+
216
+ </div>
217
+
218
+
219
+ </div>
220
+
221
+
222
+ <div id="validator-badges">
223
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
224
+ </div>
225
+
226
+ </body>
227
+ </html>