Class: Mccloud::Command::ForwardCommand
- Defined in:
- lib/mccloud/command/forward.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Methods included from Helpers
Constructor Details
This class inherits a constructor from Mccloud::Command::Base
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mccloud/command/forward.rb', line 8 def execute env.load! threads=Array.new env.config.providers.each do |name,provider| env.logger.debug("Asking provider #{name} to forward ports from #{selection} to localhost") trap("INT") { puts "You've hit CTRL-C . Stopping server now"; exit } provider.on_selected_components("vm",selection) do |id,vm| fwds=vm.forward() unless fwds.nil? fwds.each do |f| threads << f end end threads.each { |thr| thr.join} end end end |