dnsimple-ruby 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/Gemfile.lock +8 -13
- data/VERSION +1 -1
- data/features/cli/domains/delete_domain.feature +11 -0
- data/features/cli/records/create_record.feature +1 -0
- data/features/cli/records/delete_record.feature +14 -0
- data/features/step_definitions/domain_steps.rb +14 -0
- data/features/step_definitions/record_steps.rb +21 -0
- data/features/support/env.rb +2 -2
- data/lib/dnsimple/commands/create_record.rb +1 -1
- data/lib/dnsimple/record.rb +10 -10
- metadata +22 -6
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,13 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/aeden/aruba.git
|
3
|
-
revision: cff8218
|
4
|
-
specs:
|
5
|
-
aruba (0.3.3)
|
6
|
-
childprocess (~> 0.1.7)
|
7
|
-
cucumber (~> 0.10)
|
8
|
-
rspec (~> 2.5)
|
9
|
-
|
10
1
|
GEM
|
11
2
|
remote: http://rubygems.org/
|
12
3
|
specs:
|
4
|
+
aruba (0.3.5)
|
5
|
+
childprocess (>= 0.1.7)
|
6
|
+
cucumber (>= 0.10.0)
|
7
|
+
rspec (>= 2.5.0)
|
13
8
|
builder (3.0.0)
|
14
|
-
childprocess (0.1.
|
15
|
-
ffi (~> 0.6
|
9
|
+
childprocess (0.1.8)
|
10
|
+
ffi (~> 1.0.6)
|
16
11
|
columnize (0.3.2)
|
17
12
|
crack (0.1.8)
|
18
13
|
cucumber (0.10.0)
|
@@ -22,7 +17,7 @@ GEM
|
|
22
17
|
json (~> 1.4.6)
|
23
18
|
term-ansicolor (~> 1.0.5)
|
24
19
|
diff-lcs (1.1.2)
|
25
|
-
ffi (0.
|
20
|
+
ffi (1.0.7)
|
26
21
|
rake (>= 0.8.7)
|
27
22
|
gherkin (2.3.4)
|
28
23
|
json (~> 1.4.6)
|
@@ -55,7 +50,7 @@ PLATFORMS
|
|
55
50
|
ruby
|
56
51
|
|
57
52
|
DEPENDENCIES
|
58
|
-
aruba
|
53
|
+
aruba
|
59
54
|
cucumber
|
60
55
|
httparty
|
61
56
|
jeweler
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.3
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: delete a domain with the CLI
|
2
|
+
As a user
|
3
|
+
In order to remove a domain from my account
|
4
|
+
I should be able to use the CLI to delete domains
|
5
|
+
|
6
|
+
@announce-cmd @skip-delete
|
7
|
+
Scenario:
|
8
|
+
Given I have set up my credentials
|
9
|
+
When I run `dnsimple delete` with a domain I created
|
10
|
+
Then the output should show that the domain was deleted
|
11
|
+
|
@@ -9,3 +9,4 @@ Feature: add a record with the CLI
|
|
9
9
|
When I run `dnsimple create` with a new domain
|
10
10
|
And I run `dnsimple record:create` with the domain I added and no name and the type "A" and the content "1.2.3.4"
|
11
11
|
Then the output should show that the "A" record was created
|
12
|
+
And the output should include the record id
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: delete a record with the CLI
|
2
|
+
As a user
|
3
|
+
In order to remove a record from a domain in my account
|
4
|
+
I should be able to use the CLI to delete a record
|
5
|
+
|
6
|
+
@announce-cmd @announce-stdout
|
7
|
+
Scenario:
|
8
|
+
Given I have set up my credentials
|
9
|
+
When I run `dnsimple create` with a new domain
|
10
|
+
And I run `dnsimple record:create` with the domain I added and no name and the type "A" and the content "1.2.3.4"
|
11
|
+
And I note the id of the record I added
|
12
|
+
And I run `dnsimple record:delete` with the id of the record
|
13
|
+
Then the output should show that the record was deleted
|
14
|
+
|
@@ -8,6 +8,20 @@ When /^I run `(.*)` with a in\-addr\.arpa domain$/ do |cmd|
|
|
8
8
|
steps %Q(When I run `#{cmd} #{@domain_name}`)
|
9
9
|
end
|
10
10
|
|
11
|
+
When /^I run `dnsimple delete` with a domain I created$/ do
|
12
|
+
steps %Q(
|
13
|
+
When I run `dnsimple create` with a new domain
|
14
|
+
)
|
15
|
+
steps %Q(
|
16
|
+
And I run `dnsimple delete #{@domain_name}`
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
11
20
|
Then /^the output should show that the domain was created$/ do
|
12
21
|
steps %Q(Then the output should contain "Created #{@domain_name}")
|
13
22
|
end
|
23
|
+
|
24
|
+
Then /^the output should show that the domain was deleted$/ do
|
25
|
+
steps %Q(Then the output should contain "Deleted #{@domain_name}")
|
26
|
+
end
|
27
|
+
|
@@ -6,6 +6,27 @@ When /^I run `(.*)` with the domain I added and the name "([^\"]*)" and the type
|
|
6
6
|
steps %Q(When I run `#{cmd} #{@domain_name} #{name} #{type} #{content}`)
|
7
7
|
end
|
8
8
|
|
9
|
+
When /^I run `(.*)` with the id of the record$/ do |cmd|
|
10
|
+
steps %Q(When I run `#{cmd} #{@domain_name} #{@record_id}`)
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^I note the id of the record I added$/ do
|
14
|
+
ps = only_processes.last
|
15
|
+
fail "No last process" unless ps
|
16
|
+
m = ps.stdout.match(/id:(\d+)/)
|
17
|
+
fail "Unable to find ID of record" unless m
|
18
|
+
@record_id = m[1]
|
19
|
+
end
|
20
|
+
|
9
21
|
Then /^the output should show that the "([^\"]*)" record was created$/ do |type|
|
10
22
|
steps %Q(Then the output should contain "Created #{type} record for #{@domain_name}")
|
11
23
|
end
|
24
|
+
|
25
|
+
Then /^the output should include the record id$/ do
|
26
|
+
steps %Q(Then the output should match /id:(\\d+)/)
|
27
|
+
end
|
28
|
+
|
29
|
+
Then /^the output should show that the record was deleted$/ do
|
30
|
+
steps %Q(Then the output should contain "Deleted #{@record_id} from #{@domain_name}")
|
31
|
+
end
|
32
|
+
|
data/features/support/env.rb
CHANGED
@@ -4,8 +4,8 @@ Before do
|
|
4
4
|
@aruba_timeout_seconds = 10
|
5
5
|
end
|
6
6
|
|
7
|
-
After do
|
8
|
-
unless ENV['NODELETE']
|
7
|
+
After do |scenario|
|
8
|
+
unless ENV['NODELETE'] || scenario.source_tag_names.include?('@skip-delete')
|
9
9
|
if @domain_name && (@domain_name =~ /^cli-/ || @domain_name =~ /in-addr\.arpa/)
|
10
10
|
steps %Q(When I run `dnsimple delete #{@domain_name}`)
|
11
11
|
end
|
@@ -11,7 +11,7 @@ module DNSimple
|
|
11
11
|
domain = Domain.find(name)
|
12
12
|
record = Record.create(domain.name, record_name, record_type, content, :ttl => ttl, :prio => options[:prio])
|
13
13
|
|
14
|
-
puts "Created #{record.record_type} record for #{domain.name}"
|
14
|
+
puts "Created #{record.record_type} record for #{domain.name} (id:#{record.id})"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/lib/dnsimple/record.rb
CHANGED
@@ -34,7 +34,7 @@ module DNSimple
|
|
34
34
|
record_hash[Record.resolve(attribute)] = self.send(attribute)
|
35
35
|
end
|
36
36
|
|
37
|
-
options.merge!(
|
37
|
+
options.merge!(DNSimple::Client.standard_options)
|
38
38
|
options.merge!(:body => {:record => record_hash})
|
39
39
|
|
40
40
|
response = self.class.put("#{Client.base_uri}/domains/#{domain.id}/records/#{id}.json", options)
|
@@ -52,8 +52,8 @@ module DNSimple
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def delete(options={})
|
55
|
-
options.merge!(
|
56
|
-
self.class.delete("#{Client.base_uri}/domains/#{domain.id}/records/#{id}
|
55
|
+
options.merge!(DNSimple::Client.standard_options)
|
56
|
+
self.class.delete("#{Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
|
57
57
|
end
|
58
58
|
alias :destroy :delete
|
59
59
|
|
@@ -72,11 +72,11 @@ module DNSimple
|
|
72
72
|
record_hash[:ttl] = options.delete(:ttl) || 3600
|
73
73
|
record_hash[:prio] = options.delete(:priority)
|
74
74
|
record_hash[:prio] = options.delete(:prio) || ''
|
75
|
-
|
75
|
+
|
76
|
+
options.merge!(DNSimple::Client.standard_options)
|
76
77
|
options.merge!({:query => {:record => record_hash}})
|
77
|
-
options.merge!({:basic_auth => Client.credentials})
|
78
78
|
|
79
|
-
response = self.post("#{Client.base_uri}/domains/#{domain.id}/records
|
79
|
+
response = self.post("#{Client.base_uri}/domains/#{domain.id}/records", options)
|
80
80
|
|
81
81
|
pp response if Client.debug?
|
82
82
|
|
@@ -94,8 +94,8 @@ module DNSimple
|
|
94
94
|
|
95
95
|
def self.find(domain_name, id, options={})
|
96
96
|
domain = Domain.find(domain_name)
|
97
|
-
options.merge!(
|
98
|
-
response = self.get("#{Client.base_uri}/domains/#{domain.id}/records/#{id}
|
97
|
+
options.merge!(DNSimple::Client.standard_options)
|
98
|
+
response = self.get("#{Client.base_uri}/domains/#{domain.id}/records/#{id}", options)
|
99
99
|
|
100
100
|
pp response if Client.debug?
|
101
101
|
|
@@ -113,8 +113,8 @@ module DNSimple
|
|
113
113
|
|
114
114
|
def self.all(domain_name, options={})
|
115
115
|
domain = Domain.find(domain_name)
|
116
|
-
options.merge!(
|
117
|
-
response = self.get("#{Client.base_uri}/domains/#{domain.id}/records
|
116
|
+
options.merge!(DNSimple::Client.standard_options)
|
117
|
+
response = self.get("#{Client.base_uri}/domains/#{domain.id}/records", options)
|
118
118
|
|
119
119
|
pp response if Client.debug?
|
120
120
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dnsimple-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 3
|
10
|
+
version: 0.9.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Anthony Eden
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-24 00:00:00 +01:00
|
19
19
|
default_executable: dnsimple
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -119,9 +119,9 @@ dependencies:
|
|
119
119
|
version: "0"
|
120
120
|
requirement: *id007
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
|
-
type: :
|
122
|
+
type: :development
|
123
123
|
prerelease: false
|
124
|
-
name:
|
124
|
+
name: ruby-debug
|
125
125
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
126
126
|
none: false
|
127
127
|
requirements:
|
@@ -132,6 +132,20 @@ dependencies:
|
|
132
132
|
- 0
|
133
133
|
version: "0"
|
134
134
|
requirement: *id008
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
type: :runtime
|
137
|
+
prerelease: false
|
138
|
+
name: httparty
|
139
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
hash: 3
|
145
|
+
segments:
|
146
|
+
- 0
|
147
|
+
version: "0"
|
148
|
+
requirement: *id009
|
135
149
|
description: A ruby wrapper for the DNSimple API that also includes a command-line client.
|
136
150
|
email: anthony.eden@dnsimple.com
|
137
151
|
executables:
|
@@ -159,8 +173,10 @@ files:
|
|
159
173
|
- dnsimple-ruby.gemspec
|
160
174
|
- features/cli/domains/check_domain.feature
|
161
175
|
- features/cli/domains/create_domain.feature
|
176
|
+
- features/cli/domains/delete_domain.feature
|
162
177
|
- features/cli/records/create_ptr_record.feature
|
163
178
|
- features/cli/records/create_record.feature
|
179
|
+
- features/cli/records/delete_record.feature
|
164
180
|
- features/step_definitions/cli_steps.rb
|
165
181
|
- features/step_definitions/domain_steps.rb
|
166
182
|
- features/step_definitions/record_steps.rb
|