Sha256: 21fa526a6848cba3c7d3d0b0527f149628ec72e1ef3b429ebde585bd1e787b85
Contents?: true
Size: 529 Bytes
Versions: 15
Compression:
Stored size: 529 Bytes
Contents
module Rmpd class ResponseSplitter def self.split(lines, responses=[]) known_keys = [] response_lines = [] lines.each do |line| if KEY_VALUE_RE === line key, value = $~.values_at(1..2) if known_keys.include?(key) yield responses, response_lines response_lines.clear known_keys.clear end response_lines << line known_keys << key end end yield responses, response_lines end end end
Version data entries
15 entries across 15 versions & 1 rubygems