lib/serverspec/setup.rb in serverspec-0.10.10 vs lib/serverspec/setup.rb in serverspec-0.10.11

- old
+ new

@@ -13,25 +13,25 @@ ask_windows_backend end if @backend_type == 'Ssh' print "Vagrant instance y/n: " - @vagrant = gets.chomp + @vagrant = $stdin.gets.chomp if @vagrant =~ (/(true|t|yes|y|1)$/i) @vagrant = true print "Auto-configure Vagrant from Vagrantfile? y/n: " - auto_config = gets.chomp + auto_config = $stdin.gets.chomp if auto_config =~ (/(true|t|yes|y|1)$/i) auto_vagrant_configuration else print("Input vagrant instance name: ") - @hostname = gets.chomp + @hostname = $stdin.gets.chomp end else @vagrant = false print("Input target host name: ") - @hostname = gets.chomp + @hostname = $stdin.gets.chomp end else @hostname = 'localhost' end @@ -50,11 +50,11 @@ Select number: EOF print prompt.chop - num = gets.to_i - 1 + num = $stdin.gets.to_i - 1 puts @os_type = [ 'UN*X', 'Windows' ][num] || 'UN*X' end @@ -66,11 +66,11 @@ 2) Exec (local) Select number: EOF print prompt.chop - num = gets.to_i - 1 + num = $stdin.gets.to_i - 1 puts @backend_type = [ 'Ssh', 'Exec' ][num] || 'Exec' end @@ -82,11 +82,11 @@ 2) Cmd (local) Select number: EOF print prompt.chop - num = gets.to_i - 1 + num = $stdin.gets.to_i - 1 puts @backend_type = [ 'WinRM', 'Cmd' ][num] || 'Exec' end @@ -196,10 +196,10 @@ if list_of_vms.length == 1 @hostname = list_of_vms[0] else list_of_vms.each_with_index { |vm, index | puts "#{index}) #{vm}\n" } print "Choose a VM from the Vagrantfile: " - chosen_vm = gets.chomp + chosen_vm = $stdin.gets.chomp @hostname = list_of_vms[chosen_vm.to_i] end else $stderr.puts "Vagrant status error - Check your Vagrantfile or .vagrant" exit 1