# File lib/vagrant/ui.rb, line 75 def initialize super @lock = Mutex.new end
# File lib/vagrant/ui.rb, line 81 def ask(*args) super # Machine-readable can't ask for input raise Errors::UIExpectsTTY end
# File lib/vagrant/ui.rb, line 88 def machine(type, *data) opts = {} opts = data.pop if data.last.kind_of?(Hash) target = opts[:target] || "" # Prepare the data by replacing characters that aren't outputted data.each_index do |i| data[i] = data[i].to_s.dup data[i].gsub!(",", "%!(VAGRANT_COMMA)") data[i].gsub!("\n", "\\n") data[i].gsub!("\r", "\\r") end @lock.synchronize do safe_puts("#{Time.now.utc.to_i},#{target},#{type},#{data.join(",")}") end end