Sha256: 615d20d8fd036c358f1deed002f681e109bc61870efb62dd6953643c9fb91c53

Contents?: true

Size: 667 Bytes

Versions: 7

Compression:

Stored size: 667 Bytes

Contents

module VagrantPlugins
  module Skytap
    module Command
      module Helpers
        def target_vms
          @target_vms ||= [].tap do |ret|
            with_target_vms{|machine| ret << machine}
          end
        end

        def fetch_environment
          if machine = target_vms.first
            @environment ||= machine.action(:fetch_environment)[:environment]
          end
        end

        def target_skytap_vms
          fetch_environment.get_vms_by_id(target_vms.collect(&:id))
        end

        def machine_names(vm_ids)
          target_vms.select{|m| vm_ids.include?(m.id)}.collect{|m| m.name.to_s}
        end
      end
    end
  end
end



Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-skytap-0.2.3 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.2.2 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.2.1 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.2.0 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.1.11 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.1.10 lib/vagrant-skytap/command/helpers.rb
vagrant-skytap-0.1.9 lib/vagrant-skytap/command/helpers.rb