Sha256: 48292842cabdd5634cb42c9adf91eb9c9ea8eed42fdc4418b54ce523f3b0d1e0

Contents?: true

Size: 867 Bytes

Versions: 5

Compression:

Stored size: 867 Bytes

Contents

command :list do |c|
  c.summary = 'List all droplet creation parameters'
  c.syntax = 'ops list'
  c.description = "This shows a list in the format '- [id] =>  [description]'. Use [id] values to create your host file in #{Ops::DIR}/hosts/[dns_name].yml "
  c.action do |args, options|
    cli = DigitalOcean::client
    say "\nDESCRIPTION: #{c.description}\n"

    say "\nSizes:"
    cli.sizes.all.each do |i|
      say "   - #{i.slug.ljust(6)} =>   $#{i.price_monthly}/mo"
    end

    say "\nRegions:"
    cli.regions.all.each do |i|
      say "   - #{i.slug.ljust(6)} =>   #{i.name}"
    end

    say "\nImages:"
    cli.images.all.each do |i|
      say "   - #{i.slug.ljust(20)} =>   #{i.distribution} #{i.name}" unless i.slug.nil?
    end

    say "\nSSH Keys:"
    cli.ssh_keys.all.each do |i|
      say "   - #{i.fingerprint} =>   #{i.name}"
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
open-dock-0.0.10 lib/open-dock/commands/list.rb
prun-ops-0.0.9 lib/prun-ops/commands/list.rb
prun-ops-0.0.8 lib/prun-ops/commands/list.rb
prun-ops-0.0.7 lib/prun-ops/commands/list.rb
prun-ops-0.0.6 lib/prun-ops/commands/list.rb