dnsimple-ruby 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +40 -1
- data/README.textile +48 -3
- data/VERSION +1 -1
- data/lib/dnsimple/domain.rb +2 -2
- metadata +3 -3
data/README
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
A Ruby wrapper for the DNSimple API.
|
1
|
+
A Ruby command line utility and wrapper for the DNSimple API.
|
2
|
+
|
3
|
+
DNSimple is a hosted DNS service that can be found at http://dnsimple.com/
|
2
4
|
|
3
5
|
== Credentials
|
4
6
|
|
@@ -11,6 +13,14 @@ password: YOUR_PASSWORD
|
|
11
13
|
|
12
14
|
== Commands
|
13
15
|
|
16
|
+
There are two ways to interact with the DNSimple Ruby wrapper. The first is
|
17
|
+
to use the command line utility that is included. The commands available
|
18
|
+
are as follows:
|
19
|
+
|
20
|
+
For help:
|
21
|
+
|
22
|
+
* dnsimple help
|
23
|
+
|
14
24
|
The following commands are available for domains:
|
15
25
|
|
16
26
|
* dnsimple list
|
@@ -24,3 +34,32 @@ The following commands are available for records:
|
|
24
34
|
* dnsimple record:create [--prio=priority] domain.com name type content [ttl]
|
25
35
|
* dnsimple record:list domain.com
|
26
36
|
* dnsimple record:delete domain.com record_id
|
37
|
+
|
38
|
+
== Wrapper Classes
|
39
|
+
|
40
|
+
In addition to the command line utility you may also use the included Ruby
|
41
|
+
classes directly in your Ruby applications.
|
42
|
+
|
43
|
+
Sample:
|
44
|
+
|
45
|
+
require 'rubygems'
|
46
|
+
require 'dnsimple'
|
47
|
+
|
48
|
+
DNSimple::Client.username = 'YOUR_USERNAME'
|
49
|
+
DNSimple::Client.password = 'YOUR_PASSWORD'
|
50
|
+
|
51
|
+
puts "Domains..."
|
52
|
+
Domain.all.each do |domain|
|
53
|
+
puts " #{domain.name}"
|
54
|
+
end
|
55
|
+
|
56
|
+
domain = Domain.find("example.com")
|
57
|
+
domain.apply("template") # applies a standard or custom template to the domain
|
58
|
+
|
59
|
+
domain = Domain.create("newdomain.com")
|
60
|
+
puts "Added #{domain.name}"
|
61
|
+
domain.delete # removes from DNSimple
|
62
|
+
|
63
|
+
The complete RDoc for the wrapper classes can be found here:
|
64
|
+
|
65
|
+
http://rdoc.info/projects/aetrion/dnsimple-ruby
|
data/README.textile
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
A Ruby wrapper for the DNSimple API.
|
1
|
+
A Ruby command line utility and wrapper for the DNSimple API.
|
2
|
+
|
3
|
+
DNSimple is a hosted DNS service that can be found at "http://dnsimple.com/":http://dnsimple.com/
|
4
|
+
|
5
|
+
h2. Installation
|
6
|
+
|
7
|
+
<pre><code>[sudo] gem install dnsimple-ruby</code></pre>
|
2
8
|
|
3
9
|
h2. Credentials
|
4
10
|
|
@@ -6,11 +12,20 @@ Create a file in your home directory called .dnsimple
|
|
6
12
|
|
7
13
|
In this file add the following:
|
8
14
|
|
9
|
-
|
10
|
-
|
15
|
+
<pre><code>username: YOUR_USERNAME
|
16
|
+
password: YOUR_PASSWORD
|
17
|
+
</code></pre>
|
11
18
|
|
12
19
|
h2. Commands
|
13
20
|
|
21
|
+
There are two ways to interact with the DNSimple Ruby wrapper. The first is
|
22
|
+
to use the command line utility that is included. The commands available
|
23
|
+
are as follows:
|
24
|
+
|
25
|
+
For help:
|
26
|
+
|
27
|
+
* dnsimple help
|
28
|
+
|
14
29
|
The following commands are available for domains:
|
15
30
|
|
16
31
|
* dnsimple list
|
@@ -25,3 +40,33 @@ The following commands are available for records:
|
|
25
40
|
* dnsimple record:list domain.com
|
26
41
|
* dnsimple record:delete domain.com record_id
|
27
42
|
|
43
|
+
h2. Wrapper Classes
|
44
|
+
|
45
|
+
In addition to the command line utility you may also use the included Ruby
|
46
|
+
classes directly in your Ruby applications.
|
47
|
+
|
48
|
+
Sample:
|
49
|
+
|
50
|
+
<pre><code>
|
51
|
+
require 'rubygems'
|
52
|
+
require 'dnsimple'
|
53
|
+
|
54
|
+
DNSimple::Client.username = 'YOUR_USERNAME'
|
55
|
+
DNSimple::Client.password = 'YOUR_PASSWORD'
|
56
|
+
|
57
|
+
puts "Domains..."
|
58
|
+
Domain.all.each do |domain|
|
59
|
+
puts " #{domain.name}"
|
60
|
+
end
|
61
|
+
|
62
|
+
domain = Domain.find("example.com")
|
63
|
+
domain.apply("template") # applies a standard or custom template to the domain
|
64
|
+
|
65
|
+
domain = Domain.create("newdomain.com")
|
66
|
+
puts "Added #{domain.name}"
|
67
|
+
domain.delete # removes from DNSimple
|
68
|
+
</pre></code>
|
69
|
+
|
70
|
+
The complete RDoc for the wrapper classes can be found here:
|
71
|
+
|
72
|
+
"http://rdoc.info/projects/aetrion/dnsimple-ruby":http://rdoc.info/projects/aetrion/dnsimple-ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/lib/dnsimple/domain.rb
CHANGED
@@ -37,7 +37,7 @@ module DNSimple #:nodoc:
|
|
37
37
|
def apply(template_name, options={})
|
38
38
|
template = DNSimple::Template.find(template_name)
|
39
39
|
options.merge!({:basic_auth => Client.credentials})
|
40
|
-
self.class.post("#{Client.base_uri}/domains/#{id}/templates/#{template.id}/apply", options)
|
40
|
+
self.class.post("#{Client.base_uri}/domains/#{id}/templates/#{template.id}/apply.json", options)
|
41
41
|
end
|
42
42
|
|
43
43
|
# Create the domain with the given name in DNSimple. This
|
@@ -46,7 +46,7 @@ module DNSimple #:nodoc:
|
|
46
46
|
def self.create(name, options={})
|
47
47
|
domain_hash = {:name => name}
|
48
48
|
|
49
|
-
options.merge!({:
|
49
|
+
options.merge!({:body => {:domain => domain_hash}})
|
50
50
|
options.merge!({:basic_auth => Client.credentials})
|
51
51
|
|
52
52
|
response = self.post("#{Client.base_uri}/domains.json", options)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Anthony Eden
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-15 00:00:00 -10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|