Sha256: 320775d0257d3247dbc8cac468ed7d0b60a28fedc02ca8189e0cfd0673711850

Contents?: true

Size: 655 Bytes

Versions: 9

Compression:

Stored size: 655 Bytes

Contents

command :'create domain' do |c|
  c.summary = 'Create a domain in your DigitalOcean account'
  c.syntax = 'ops create domain [domain name] [ip address]'
  c.description = "Create the domain with #{DigitalOcean::CONFIG_FILE} credentials"
  c.example 'Create the domain example.com in your DigitalOcean console', 'ops create domain example.com'
  c.action do |args, options|
    ip = (args[1].nil?)? '1.1.1.1':args[1]
    domain = DropletKit::Domain.new(ip_address: ip, name: args[0])
    resp = DigitalOcean::client.domains.create domain
    if domain == resp
      say "Domain #{resp.name} succesfully created!"
    else
      raise resp
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
open-dock-0.0.10 lib/open-dock/commands/create_domain.rb
prun-ops-0.0.9 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.8 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.7 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.6 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.5 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.4 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.3 lib/prun-ops/commands/create_domain.rb
prun-ops-0.0.2 lib/prun-ops/commands/create_domain.rb