Module: VagrantPlugins::Skytap::Command::Helpers
- Included in:
- PublishUrl::Create, PublishUrl::Delete, PublishUrl::Show
- Defined in:
- lib/vagrant-skytap/command/helpers.rb
Instance Method Summary collapse
- #fetch_environment ⇒ Object
- #machine_names(vm_ids) ⇒ Object
- #target_skytap_vms ⇒ Object
- #target_vms ⇒ Object
Instance Method Details
#fetch_environment ⇒ Object
11 12 13 14 15 |
# File 'lib/vagrant-skytap/command/helpers.rb', line 11 def fetch_environment if machine = target_vms.first @environment ||= machine.action(:fetch_environment)[:environment] end end |
#machine_names(vm_ids) ⇒ Object
21 22 23 |
# File 'lib/vagrant-skytap/command/helpers.rb', line 21 def machine_names(vm_ids) target_vms.select{|m| vm_ids.include?(m.id)}.collect{|m| m.name.to_s} end |
#target_skytap_vms ⇒ Object
17 18 19 |
# File 'lib/vagrant-skytap/command/helpers.rb', line 17 def target_skytap_vms fetch_environment.get_vms_by_id(target_vms.collect(&:id)) end |
#target_vms ⇒ Object
5 6 7 8 9 |
# File 'lib/vagrant-skytap/command/helpers.rb', line 5 def target_vms @target_vms ||= [].tap do |ret| with_target_vms{|machine| ret << machine} end end |