Sha256: fd38c5a60c4b2debcdc9d761b96139f3fb79f750c8d713db86c52971c61bd36e

Contents?: true

Size: 1004 Bytes

Versions: 1

Compression:

Stored size: 1004 Bytes

Contents

require 'ruby-enum'

module MemcachedTest
    class Commands_format
        include Ruby::Enum

        define :get, /^(?<command>get) (?<keys>(\w|[ ])+)/
        define :gets, /^(?<command>gets) (?<keys>(\w|[ ])+)/
    
        define :set, /^(?<command>set) (?<key>\w+) (?<flags>\d+) (?<exptime>\d+) (?<bytes>\d+)(?<noreply> noreply)?/
        define :add, /^(?<command>add) (?<key>\w+) (?<flags>\d+) (?<exptime>\d+) (?<bytes>\d+)(?<noreply> noreply)?/
        define :replace, /^(?<command>replace) (?<key>(\w)+) (?<flags>\d+) (?<exptime>\d+) (?<bytes>\d+)(?<noreply> noreply)?/
    
        define :append, /^(?<command>append) (?<key>\w+) (?<bytes>\d+)(?<noreply> noreply)?/
        define :prepend, /^(?<command>prepend) (?<key>\w+) (?<bytes>\d+)(?<noreply> noreply)?/
    
        define :cas, /^(?<command>cas) (?<key>(\w)+) (?<flags>\d+) (?<exptime>\d+) (?<bytes>\d+) (?<cas>\d+)(?<noreply> noreply)?/

        define :flush_all, /^flush_all(?<noreply> noreply)?/
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
memcached_test-1.0.0 lib/memcached_test/commands_format.rb