domrobot 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/domrobot/cli.rb +9 -0
- data/lib/domrobot/types/record.rb +1 -1
- data/lib/domrobot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a9359c7f01f20c9620084c1999299cd38db8093
|
|
4
|
+
data.tar.gz: db5f613bdc92d2a0d5dc7f74f93a276b4669e32c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58d9b4a7212e98a3ef16756ce4f94fbc70c535055ab1614e8a460cbbb7d9983d78d9db7ade90df9d6c9741c5310f13c9879deb32e4a0d95b18c6a6b1dabbdcb1
|
|
7
|
+
data.tar.gz: 06d44e7ad2ea0fc70a1177669fb3ffa4edef93888bfc96881e8cd95d1a7311406b946c31330b94941703e3808bd2ac8cd8bd6dda0ccd18febe7e6395ac4ed77c
|
data/lib/domrobot/cli.rb
CHANGED
|
@@ -60,6 +60,7 @@ module Domrobot
|
|
|
60
60
|
name = [name,subdomain,domain].join(".")
|
|
61
61
|
type = options["type"]
|
|
62
62
|
record = Record.find_by domain:domain, name:name
|
|
63
|
+
|
|
63
64
|
unless record
|
|
64
65
|
puts "NEW"
|
|
65
66
|
record = Record.new domain:domain,name:name,type:type,content:address
|
|
@@ -76,6 +77,14 @@ module Domrobot
|
|
|
76
77
|
puts m
|
|
77
78
|
success_callbacks.map{|cb| cb.call(m,d) } and exit 0
|
|
78
79
|
end
|
|
80
|
+
record.content = address
|
|
81
|
+
result = record.update
|
|
82
|
+
if result["code"] = 1000
|
|
83
|
+
m,d = "OK CREATE","#{address} A #{name}."
|
|
84
|
+
puts m
|
|
85
|
+
success_callbacks.map{|cb| cb.call(m,d)} and exit 0
|
|
86
|
+
end
|
|
87
|
+
exit 1
|
|
79
88
|
end
|
|
80
89
|
end
|
|
81
90
|
end
|
|
@@ -22,7 +22,7 @@ module Domrobot
|
|
|
22
22
|
Domrobot.nameserver.createRecord Util.stringify_keys(self.to_h).reject{|k,v|k=="id"}
|
|
23
23
|
end
|
|
24
24
|
def update
|
|
25
|
-
Domrobot.nameserver.updateRecord Util.stringify_keys(self.to_h)
|
|
25
|
+
Domrobot.nameserver.updateRecord Util.stringify_keys(self.to_h).reject{|k,v|%w{type domain}.include? k}
|
|
26
26
|
end
|
|
27
27
|
def delete
|
|
28
28
|
Domrobot.nameserver.deleteRecord({"id" => self.id})
|
data/lib/domrobot/version.rb
CHANGED