Sha256: 8ffca19cf22acebc680a201294bcb353c3a2302a9228f5c49d41decc5d73da3a

Contents?: true

Size: 669 Bytes

Versions: 8

Compression:

Stored size: 669 Bytes

Contents

require 'terminal-table'

module VagrantPlugins
  module Deltacloud
    module Command
      module Utils
        def display_item_list(env, items)
          rows = []
          items.each do |item|
            rows << [item.id, item.name]
          end
          display_table(env, %w(Id Name), rows)
        end

        def display_table(env, headers, rows)
          table = Terminal::Table.new headings: headers, rows: rows
          env[:ui].info("\n#{table}")
        end

        def get_ip_address(env)
          details = env[:deltacloud_client].get_instance_details(env, env[:machine].id)
          details.ip_address
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-deltacloud-provider-0.0.9 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.8 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.7 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.6 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.5 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.4 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.3 lib/vagrant-deltacloud-provider/command/utils.rb
vagrant-deltacloud-provider-0.0.2 lib/vagrant-deltacloud-provider/command/utils.rb