dnsimple-ruby 1.3.2 → 1.4.0
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 +15 -0
- data/.gitignore +9 -2
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +20 -0
- data/Gemfile +0 -2
- data/LICENSE +2 -2
- data/README.md +121 -0
- data/Rakefile +30 -14
- data/bin/dnsimple.rb +1 -1
- data/dnsimple-ruby.gemspec +9 -8
- data/features/README +1 -1
- data/features/step_definitions/cli_steps.rb +1 -1
- data/features/support/env.rb +4 -4
- data/fixtures/vcr_cassettes/DNSimple_Certificate/_all.yml +45 -32
- data/fixtures/vcr_cassettes/DNSimple_Certificate/_purchase.yml +45 -32
- data/fixtures/vcr_cassettes/DNSimple_Certificate/_submit.yml +45 -32
- data/fixtures/vcr_cassettes/DNSimple_Contact/a_new_contact.yml +39 -31
- data/fixtures/vcr_cassettes/DNSimple_Contact/an_existing_contact.yml +39 -31
- data/fixtures/vcr_cassettes/DNSimple_Domain/_all.yml +113 -94
- data/fixtures/vcr_cassettes/DNSimple_Domain/applying_templates.yml +186 -156
- data/fixtures/vcr_cassettes/DNSimple_Domain/creating_a_new_domain.yml +39 -32
- data/fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_id.yml +39 -32
- data/fixtures/vcr_cassettes/DNSimple_Domain/finding_an_existing_domain/by_name.yml +39 -32
- data/fixtures/vcr_cassettes/DNSimple_Domain/registration/with_a_new_registrant_contact.yml +40 -32
- data/fixtures/vcr_cassettes/DNSimple_Domain/registration/with_an_existing_contact.yml +40 -32
- data/fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_ca.yml +262 -29
- data/fixtures/vcr_cassettes/DNSimple_ExtendedAttribute/list_extended_attributes/for_com.yml +35 -29
- data/fixtures/vcr_cassettes/DNSimple_Record/_all.yml +147 -125
- data/fixtures/vcr_cassettes/DNSimple_Record/creating_a_new_record.yml +39 -32
- data/fixtures/vcr_cassettes/DNSimple_Record/find_a_record.yml +39 -32
- data/fixtures/vcr_cassettes/DNSimple_Template/a_template.yml +41 -32
- data/fixtures/vcr_cassettes/DNSimple_User/_me.yml +38 -31
- data/lib/dnsimple.rb +14 -1
- data/lib/dnsimple/base.rb +7 -5
- data/lib/dnsimple/certificate.rb +100 -95
- data/lib/dnsimple/cli.rb +92 -93
- data/lib/dnsimple/client.rb +109 -99
- data/lib/dnsimple/commands/{describe_certificate.rb → certificate_describe.rb} +2 -2
- data/lib/dnsimple/commands/{list_certificates.rb → certificate_list.rb} +2 -2
- data/lib/dnsimple/commands/{purchase_certificate.rb → certificate_purchase.rb} +3 -5
- data/lib/dnsimple/commands/{submit_certificate.rb → certificate_submit.rb} +3 -5
- data/lib/dnsimple/commands/{create_contact.rb → contact_create.rb} +8 -6
- data/lib/dnsimple/commands/{delete_contact.rb → contact_delete.rb} +2 -2
- data/lib/dnsimple/commands/{describe_contact.rb → contact_describe.rb} +2 -2
- data/lib/dnsimple/commands/{list_contacts.rb → contact_list.rb} +2 -2
- data/lib/dnsimple/commands/{update_contact.rb → contact_update.rb} +2 -2
- data/lib/dnsimple/commands/{apply_template.rb → domain_apply_template.rb} +2 -2
- data/lib/dnsimple/commands/{check_domain.rb → domain_check.rb} +2 -2
- data/lib/dnsimple/commands/{clear_domain.rb → domain_clear.rb} +2 -2
- data/lib/dnsimple/commands/{create_domain.rb → domain_create.rb} +2 -2
- data/lib/dnsimple/commands/{delete_domain.rb → domain_delete.rb} +2 -2
- data/lib/dnsimple/commands/{describe_domain.rb → domain_describe.rb} +2 -2
- data/lib/dnsimple/commands/{list_domains.rb → domain_list.rb} +2 -2
- data/lib/dnsimple/commands/{register_domain.rb → domain_register.rb} +2 -2
- data/lib/dnsimple/commands/{transfer_domain.rb → domain_transfer.rb} +2 -2
- data/lib/dnsimple/commands/{list_extended_attributes.rb → extended_attribute_list.rb} +2 -2
- data/lib/dnsimple/commands/{describe_user.rb → me.rb} +2 -2
- data/lib/dnsimple/commands/{create_record.rb → record_create.rb} +5 -7
- data/lib/dnsimple/commands/{delete_record.rb → record_delete.rb} +2 -2
- data/lib/dnsimple/commands/{describe_record.rb → record_describe.rb} +2 -2
- data/lib/dnsimple/commands/{list_records.rb → record_list.rb} +4 -6
- data/lib/dnsimple/commands/{update_record.rb → record_update.rb} +2 -2
- data/lib/dnsimple/commands/{add_service.rb → service_add.rb} +3 -5
- data/lib/dnsimple/commands/{describe_service.rb → service_describe.rb} +2 -2
- data/lib/dnsimple/commands/{list_services.rb → service_list.rb} +2 -2
- data/lib/dnsimple/commands/{list_applied_services.rb → service_list_applied.rb} +2 -2
- data/lib/dnsimple/commands/{list_available_services.rb → service_list_available.rb} +2 -2
- data/lib/dnsimple/commands/{remove_service.rb → service_remove.rb} +2 -2
- data/lib/dnsimple/commands/{create_template.rb → template_create.rb} +2 -2
- data/lib/dnsimple/commands/{delete_template.rb → template_delete.rb} +2 -2
- data/lib/dnsimple/commands/{add_template_record.rb → template_record_create.rb} +2 -2
- data/lib/dnsimple/commands/{delete_template_record.rb → template_record_delete.rb} +2 -2
- data/lib/dnsimple/commands/{list_template_records.rb → template_record_list.rb} +2 -2
- data/lib/dnsimple/commands/{list_templates.rb → templates_list.rb} +2 -2
- data/lib/dnsimple/contact.rb +115 -110
- data/lib/dnsimple/domain.rb +134 -132
- data/lib/dnsimple/error.rb +8 -19
- data/lib/dnsimple/extended_attribute.rb +39 -33
- data/lib/dnsimple/record.rb +71 -67
- data/lib/dnsimple/service.rb +31 -24
- data/lib/dnsimple/template.rb +52 -46
- data/lib/dnsimple/template_record.rb +61 -53
- data/lib/dnsimple/transfer_order.rb +24 -18
- data/lib/dnsimple/user.rb +22 -18
- data/lib/dnsimple/version.rb +1 -1
- data/spec/README +1 -1
- data/spec/ci/.dnsimple.test +3 -0
- data/spec/commands/{purchase_certificate_spec.rb → certificate_purchase_spec.rb} +3 -4
- data/spec/commands/{submit_certificate_spec.rb → certificate_submit_spec.rb} +3 -4
- data/spec/commands/{create_record_spec.rb → record_create_spec.rb} +4 -4
- data/spec/commands/{list_records_spec.rb → records_list_spec.rb} +2 -13
- data/spec/commands/{add_service_spec.rb → service_add_spec.rb} +3 -12
- data/spec/{certificate_spec.rb → dnsimple/certificate_spec.rb} +0 -0
- data/spec/dnsimple/client_spec.rb +45 -18
- data/spec/{contact_spec.rb → dnsimple/contact_spec.rb} +3 -1
- data/spec/{domain_spec.rb → dnsimple/domain_spec.rb} +2 -0
- data/spec/{extended_attributes_spec.rb → dnsimple/extended_attributes_spec.rb} +4 -0
- data/spec/{record_spec.rb → dnsimple/record_spec.rb} +2 -0
- data/spec/{template_spec.rb → dnsimple/template_spec.rb} +0 -0
- data/spec/{user_spec.rb → dnsimple/user_spec.rb} +2 -0
- data/spec/spec_helper.rb +24 -10
- metadata +96 -99
- data/Gemfile.lock +0 -71
- data/README +0 -108
- data/README.rdoc +0 -108
- data/README.textile +0 -138
- data/lib/dnsimple/command.rb +0 -10
- data/spec/command_spec.rb +0 -19
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'dnsimple/command'
|
2
|
-
|
3
1
|
module DNSimple
|
4
2
|
module Commands
|
5
|
-
class
|
6
|
-
def execute(args, options={})
|
3
|
+
class CertificatePurchase
|
4
|
+
def execute(args, options = {})
|
7
5
|
domain_name = args.shift
|
8
6
|
name = args.shift
|
9
7
|
contact_id = args.shift
|
@@ -12,7 +10,7 @@ module DNSimple
|
|
12
10
|
contact = Contact.find(contact_id)
|
13
11
|
|
14
12
|
certificate = Certificate.purchase(domain, name, contact)
|
15
|
-
|
13
|
+
puts "Purchased certificate for #{certificate.fqdn}"
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'dnsimple/command'
|
2
|
-
|
3
1
|
module DNSimple
|
4
2
|
module Commands
|
5
|
-
class
|
6
|
-
def execute(args, options={})
|
3
|
+
class CertificateSubmit
|
4
|
+
def execute(args, options = {})
|
7
5
|
domain_name = args.shift
|
8
6
|
certificate_id = args.shift
|
9
7
|
approver_email = args.shift
|
@@ -12,7 +10,7 @@ module DNSimple
|
|
12
10
|
certificate = DNSimple::Certificate.find(domain, certificate_id)
|
13
11
|
certificate.submit(approver_email)
|
14
12
|
|
15
|
-
|
13
|
+
puts "Certificate submitted, authorization by email required"
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module DNSimple
|
2
2
|
module Commands
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
|
4
|
+
# Command to create a contact.
|
5
|
+
#
|
6
|
+
# contact:create [ name:value name:value ... ]
|
7
|
+
#
|
8
|
+
class ContactCreate
|
9
|
+
def execute(args, options = {})
|
9
10
|
attributes = {}
|
10
11
|
attributes['state_province_choice'] = 'S'
|
11
12
|
args.each do |arg|
|
@@ -17,5 +18,6 @@ module DNSimple
|
|
17
18
|
puts "Created contact #{contact.name} (id: #{contact.id})"
|
18
19
|
end
|
19
20
|
end
|
21
|
+
|
20
22
|
end
|
21
23
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module DNSimple
|
2
2
|
module Commands
|
3
|
-
class
|
3
|
+
class ContactUpdate
|
4
4
|
# Execute the contact:update command.
|
5
5
|
#
|
6
6
|
# Args expected:
|
7
7
|
# id [name:value name:value ...]
|
8
|
-
def execute(args, options={})
|
8
|
+
def execute(args, options = {})
|
9
9
|
attributes = {}
|
10
10
|
id = args.shift
|
11
11
|
args.each do |arg|
|
@@ -1,19 +1,17 @@
|
|
1
|
-
require 'dnsimple/command'
|
2
|
-
|
3
1
|
module DNSimple
|
4
2
|
module Commands
|
5
|
-
class
|
6
|
-
def execute(args, options={})
|
3
|
+
class RecordCreate
|
4
|
+
def execute(args, options = {})
|
7
5
|
name = args.shift
|
8
6
|
record_name = args.shift
|
9
7
|
record_type = args.shift
|
10
8
|
content = args.shift
|
11
9
|
ttl = args.shift
|
12
|
-
|
10
|
+
|
13
11
|
domain = Domain.find(name)
|
14
12
|
record = Record.create(domain, record_name, record_type, content, :ttl => ttl, :prio => options[:prio])
|
15
|
-
|
16
|
-
|
13
|
+
|
14
|
+
puts "Created #{record.record_type} record for #{domain.name} (id:#{record.id})"
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
@@ -1,19 +1,17 @@
|
|
1
|
-
require 'dnsimple/command'
|
2
|
-
|
3
1
|
module DNSimple
|
4
2
|
module Commands
|
5
|
-
class
|
6
|
-
def execute(args, options={})
|
3
|
+
class RecordList
|
4
|
+
def execute(args, options = {})
|
7
5
|
domain_name = args.shift
|
8
6
|
|
9
7
|
records = Record.all(DNSimple::Domain.new(:name => domain_name))
|
10
8
|
|
11
|
-
|
9
|
+
puts "Found #{records.length} records for #{domain_name}"
|
12
10
|
records.each do |record|
|
13
11
|
extra = ["ttl:#{record.ttl}", "id:#{record.id}"]
|
14
12
|
extra << "prio:#{record.prio}" if record.record_type == "MX"
|
15
13
|
extra = "(#{extra.join(', ')})"
|
16
|
-
|
14
|
+
puts "\t#{record.name}.#{record.domain.name} (#{record.record_type})-> #{record.content} #{extra}"
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
@@ -1,15 +1,13 @@
|
|
1
|
-
require 'dnsimple/command'
|
2
|
-
|
3
1
|
module DNSimple
|
4
2
|
module Commands
|
5
|
-
class
|
6
|
-
def execute(args, options={})
|
3
|
+
class ServiceAdd
|
4
|
+
def execute(args, options = {})
|
7
5
|
domain_name = args.shift
|
8
6
|
domain = Domain.find(domain_name)
|
9
7
|
short_name = args.shift
|
10
8
|
service = Service.find(short_name)
|
11
9
|
domain.add_service(short_name)
|
12
|
-
|
10
|
+
puts "Added #{service.name} to #{domain_name}"
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module DNSimple
|
2
2
|
module Commands
|
3
|
-
class
|
4
|
-
def execute(args, options={})
|
3
|
+
class ServiceDescribe
|
4
|
+
def execute(args, options = {})
|
5
5
|
short_name = args.shift
|
6
6
|
service = Service.find(short_name)
|
7
7
|
puts "\t#{service.name} (short: #{service.short_name}, id: #{service.id})"
|