zerigo_dns 1.0.3 → 1.0.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.
- data/Rakefile +2 -0
- data/lib/zerigo_dns.rb +52 -0
- metadata +2 -7
- data/.document +0 -5
- data/.gitignore +0 -21
- data/VERSION +0 -1
- data/zerigo_dns.gemspec +0 -57
data/Rakefile
CHANGED
@@ -12,6 +12,8 @@ begin
|
|
12
12
|
gem.authors = ["Tom Wilson"]
|
13
13
|
gem.add_dependency "activeresource"
|
14
14
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
|
+
gem.files = FileList['example/*.rb'] + FileList['lib/**/*.rb'] + ['README.rdoc', 'LICENSE', 'VERSION.yml', 'Rakefile']
|
16
|
+
|
15
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
18
|
end
|
17
19
|
Jeweler::GemcutterTasks.new
|
data/lib/zerigo_dns.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Copyright 2009 Zerigo, Inc. See MIT-LICENSE for license information.
|
2
|
+
# Visit http://www.zerigo.com/docs/managed-dns for updates and documentation.
|
3
|
+
|
4
|
+
require 'activeresource-ext'
|
5
|
+
|
6
|
+
module Zerigo
|
7
|
+
module DNS
|
8
|
+
|
9
|
+
class Base < ActiveResource::Base
|
10
|
+
self.site='http://ns.zerigo.com/api/1.1/'
|
11
|
+
self.user = 'test@example.com'
|
12
|
+
self.password = 'ca01ffae311a7854ea366b05cd02bd50'
|
13
|
+
self.timeout = 5 # timeout after 5 seconds
|
14
|
+
|
15
|
+
|
16
|
+
# fix load() so that it no longer clobbers @prefix_options
|
17
|
+
# also fix bug exposed by reload() where attributes is effectively parsed twice, causing the first line to raise an exception the 2nd time
|
18
|
+
def load(attributes)
|
19
|
+
raise ArgumentError, "expected an attributes Hash, got #{attributes.inspect}" unless attributes.is_a?(Hash)
|
20
|
+
new_prefix_options, attributes = split_options(attributes)
|
21
|
+
@prefix_options.merge!(new_prefix_options)
|
22
|
+
attributes.each do |key, value|
|
23
|
+
@attributes[key.to_s] =
|
24
|
+
case value
|
25
|
+
when Array
|
26
|
+
if value.all?{|v2| v2.kind_of?(ActiveResource::Base)}
|
27
|
+
value.dup rescue value
|
28
|
+
else
|
29
|
+
resource = find_or_create_resource_for_collection(key)
|
30
|
+
value.map { |attrs| attrs.is_a?(String) ? attrs.dup : resource.new(attrs) }
|
31
|
+
end
|
32
|
+
when Hash
|
33
|
+
resource = find_or_create_resource_for(key)
|
34
|
+
resource.new(value)
|
35
|
+
else
|
36
|
+
value.dup rescue value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
class Zone < Base
|
46
|
+
end
|
47
|
+
|
48
|
+
class Host < Base
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zerigo_dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Wilson
|
@@ -42,16 +42,11 @@ extra_rdoc_files:
|
|
42
42
|
- LICENSE
|
43
43
|
- README.rdoc
|
44
44
|
files:
|
45
|
-
- .document
|
46
|
-
- .gitignore
|
47
45
|
- LICENSE
|
48
46
|
- README.rdoc
|
49
47
|
- Rakefile
|
50
|
-
- VERSION
|
51
48
|
- example/sample.rb
|
52
|
-
-
|
53
|
-
- test/test_zerigo_dns.rb
|
54
|
-
- zerigo_dns.gemspec
|
49
|
+
- lib/zerigo_dns.rb
|
55
50
|
has_rdoc: true
|
56
51
|
homepage: http://github.com/twilson63/zerigo_dns
|
57
52
|
licenses: []
|
data/.document
DELETED
data/.gitignore
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.3
|
data/zerigo_dns.gemspec
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{zerigo_dns}
|
8
|
-
s.version = "1.0.3"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Tom Wilson"]
|
12
|
-
s.date = %q{2010-02-06}
|
13
|
-
s.description = %q{This gem is a resource wrapper of the example provide by zerigo dns}
|
14
|
-
s.email = %q{tom@jackhq.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"example/sample.rb",
|
27
|
-
"test/helper.rb",
|
28
|
-
"test/test_zerigo_dns.rb",
|
29
|
-
"zerigo_dns.gemspec"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/twilson63/zerigo_dns}
|
32
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
-
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.5}
|
35
|
-
s.summary = %q{Zerigo DNS Gem}
|
36
|
-
s.test_files = [
|
37
|
-
"test/helper.rb",
|
38
|
-
"test/test_zerigo_dns.rb"
|
39
|
-
]
|
40
|
-
|
41
|
-
if s.respond_to? :specification_version then
|
42
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version = 3
|
44
|
-
|
45
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
|
-
s.add_runtime_dependency(%q<activeresource>, [">= 0"])
|
47
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
48
|
-
else
|
49
|
-
s.add_dependency(%q<activeresource>, [">= 0"])
|
50
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
51
|
-
end
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<activeresource>, [">= 0"])
|
54
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|