Object
# File lib/couchrest/helper/streamer.rb, line 14 def get(url, &block) open_pipe("curl #{default_curl_opts} \"#{url}\"", &block) end
# File lib/couchrest/helper/streamer.rb, line 24 def escape_quotes(data) data.gsub(/"/, '\"') end
# File lib/couchrest/helper/streamer.rb, line 28 def open_pipe(cmd, &block) first = nil prev = nil IO.popen(cmd) do |f| first = f.gets # discard header while line = f.gets row = parse_line(line) block.call row unless row.nil? # last line "}]" discarded prev = line end end raise RestClient::ServerBrokeConnection if $? && $?.exitstatus != 0 parse_first(first, prev) end
Generated with the Darkfish Rdoc Generator 2.