-
Notifications
You must be signed in to change notification settings - Fork 35
/
Rakefile
42 lines (35 loc) · 893 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'yajl'
require 'dimensions'
require_relative 'lib/dnsimple_services'
## The following are used by Rake
task default: [:verify]
desc "Generate a new service"
task :generate, :name do |t, args|
name = args[:name]
label = args[:label]
begin
DnsimpleServices.generate(name, label)
rescue DnsimpleServices::GeneratorError => e
puts "Error: #{e}"
end
end
desc "Verify a service"
task :verify, :name do |t, args|
name = args[:name]
if name
begin
DnsimpleServices.verify(name)
rescue DnsimpleServices::VerifierError => e
puts "Error: #{e}"
end
else
Dir.entries("services").reject { |n| n == "." || n == ".." }.each do |service_name|
puts "Checking #{service_name}"
begin
DnsimpleServices.verify(service_name)
rescue DnsimpleServices::VerifierError => e
puts "Error: #{e}"
end
end
end
end