vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/lib/memcache.rb
def parse_stats( reply )

		# Trim off the footer
		reply.sub!( /#{CRLF}END#{CRLF}/, '' )

		# Make a hash out of the other values
		pairs = reply.split( /#{CRLF}/ ).collect {|line|
			stat, name, val = line.split(/\s+/, 3)
			name = name.to_sym

			if StatConverters.key?( name )
				val = StatConverters[ name ].call( val )
			else
				val = StatConverters[ :__default__ ].call( val )
			end

			[name,val]
		}

		return Hash[ *(pairs.flatten) ]
	end
### Parse raw statistics lines from a memcached 'stats' +reply+ and return a
### Hash.
Parse raw statistics lines from a memcached 'stats' +reply+ and return a
Hash.
Parse raw statistics lines from a memcached ' stats ' + reply + and return a Hash .
def parse_stats( reply )
		reply.sub!( /#{CRLF}END#{CRLF}/, '' )
		pairs = reply.split( /#{CRLF}/ ).collect {|line|
			stat, name, val = line.split(/\s+/, 3)
			name = name.to_sym
			if StatConverters.key?( name )
				val = StatConverters[ name ].call( val )
			else
				val = StatConverters[ :__default__ ].call( val )
			end
			[name,val]
		}
		return Hash[ *(pairs.flatten) ]
	end
def parse_stats ( reply ) reply . sub! ( / #{ CRLF } END #{ CRLF } / , '' ) pairs = reply . split ( / #{ CRLF } / ) . collect { | line | stat , name , val = line . split ( / \s + / , 3 ) name = name . to_sym if StatConverters . key? ( name ) val = StatConverters [ name ] . call ( val ) else val = StatConverters [ :__default__ ] . call ( val ) end [ name , val ] } return Hash [ * ( pairs . flatten ) ] end
Parse raw statistics lines from a memcached 'stats' +reply+ and return a
Hash.
Parse raw statistics lines from a memcached ' stats ' + reply + and return a Hash .
# Trim off the footer # Make a hash out of the other values
reply