zerigo_dns 1.0.5 → 1.0.6

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/example/sample.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # First, require the Zerigo DNS library for ActiveResource.
5
5
 
6
- require 'zerigo_ns'
6
+ require 'zerigo_dns'
7
7
 
8
8
  # All API request require a Zerigo account and an Account API key. We'll set
9
9
  # them here for later reference. The 'user' is your regular login email.
@@ -28,7 +28,7 @@ Zerigo::NS::Base.password = 'api_token'
28
28
  # eg: zone.default_ttl, not zone.default-ttl
29
29
 
30
30
  puts '', "Retrieving list of first 20 zones..."
31
- zones = Zerigo::NS::Zone.find(:all, :params=>{:per_page=>20, :page=>1})
31
+ zones = Zerigo::DNS::Zone.find(:all, :params=>{:per_page=>20, :page=>1})
32
32
 
33
33
  # Now print a list of those zones
34
34
  zones.each do |zone|
@@ -49,7 +49,7 @@ end
49
49
  zone = zones.first
50
50
  puts '', "Hosts for zone #{zone.domain} (id: #{zone.id})"
51
51
 
52
- hosts = Zerigo::NS::Host.find(:all, :params=>{:zone_id=>zone.id, :per_page=>20, :page=>1})
52
+ hosts = Zerigo::DNS::Host.find(:all, :params=>{:zone_id=>zone.id, :per_page=>20, :page=>1})
53
53
  hosts.each do |host|
54
54
  puts " #{host.hostname} (id: #{host.id})"
55
55
  end
@@ -62,7 +62,7 @@ end
62
62
  # the last request.
63
63
 
64
64
  puts '', "Loading a single zone..."
65
- zone = Zerigo::NS::Zone.find(zones.first.id)
65
+ zone = Zerigo::DNS::Zone.find(zones.first.id)
66
66
 
67
67
  puts " Loaded zone #{zone.id} (#{zone.domain})"
68
68
 
@@ -71,7 +71,7 @@ puts " Loaded zone #{zone.id} (#{zone.domain})"
71
71
 
72
72
  puts '', "Loading a non-existent zone..."
73
73
  begin
74
- zone2 = Zerigo::NS::Zone.find(987654321)
74
+ zone2 = Zerigo::DNS::Zone.find(987654321)
75
75
  puts " Loaded zone #{zone2.id} (#{zone2.domain})"
76
76
  rescue ActiveResource::ResourceNotFound
77
77
  puts " Zone not found"
@@ -85,7 +85,7 @@ puts '', "Creating a random zone that is invalid..."
85
85
  now = Time.now.to_i
86
86
  vals = {:domain=>"example-#{now}.org", :ns_type=>'not_valid' }
87
87
 
88
- newzone = Zerigo::NS::Zone.create(vals)
88
+ newzone = Zerigo::DNS::Zone.create(vals)
89
89
  if newzone.errors.empty?
90
90
  puts " Zone #{newzone.domain} created successfully with id #{newzone.id}."
91
91
  else
@@ -99,7 +99,7 @@ puts '', "Fixing and resubmitting that random zone..."
99
99
 
100
100
  vals[:ns_type] = 'pri_sec' # options for this are 'pri_sec' (the default and most common), 'pri', and 'sec' -- see the API docs for details
101
101
 
102
- newzone = Zerigo::NS::Zone.create(vals)
102
+ newzone = Zerigo::DNS::Zone.create(vals)
103
103
  if newzone.errors.empty?
104
104
  puts " Zone #{newzone.domain} created successfully with id #{newzone.id}."
105
105
  else
@@ -135,7 +135,7 @@ vals2 = {:hostname=>'www',
135
135
 
136
136
  # A host has to be assigned to a zone. This is done by including 'zone_id'
137
137
  # in the vals2 hash.
138
- newhost = Zerigo::NS::Host.create(vals2)
138
+ newhost = Zerigo::DNS::Host.create(vals2)
139
139
  if newhost.errors.empty?
140
140
  puts " Host #{newhost.hostname} created successfully with id #{newhost.id}."
141
141
  else
@@ -1,4 +1,4 @@
1
- require 'activeresource'
1
+ require 'active_resource'
2
2
 
3
3
  module ActiveResource
4
4
  module CaptureHeaders
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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Wilson