Method: CF::App::Files#stream_path

Defined in:
lib/cf/cli/app/files.rb

#stream_path(lines, instance, path) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/cf/cli/app/files.rb', line 113

def stream_path(lines, instance, path)
  if verbose?
    lines << [instance, path, c("streaming...", :good) + "\n"]
  end

  instance.stream_file(*path) do |contents|
    contents.each_line do |line|
      lines << [instance, path, line]
    end
  end

  lines << [instance, path, c("end of file", :bad) + "\n"]
rescue Timeout::Error
  if verbose?
    lines << [
      instance,
      path,
      c("timed out; reconnecting...", :bad) + "\n"
    ]
  end

  retry
end