Sha256: 3eae61ffeddf69503bc7e45f598adad9520c65c5f2dd7395688d5b776eaffd34

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

module FakeRedis
  class Redis
    module ServerMethods

      def bgreriteaof ; end

      def bgsave ; end

      def config_get(param) ; end

      def config_set(param, value) ; end

      def config_resetstat ; end

      def dbsize
        @data.keys.count
      end

      def debug_object(key)
        return @data[key].inspect
      end

      def flushdb
        @data = {}
        @expires = {}
      end

      alias flushall flushdb

      def info
        server_info = {
          "redis_version" => "0.07",
          "connected_clients" => "1",
          "connected_slaves" => "0",
          "used_memory" => "3187",
          "changes_since_last_save" => "0",
          "last_save_time" => "1237655729",
          "total_connections_received" => "1",
          "total_commands_processed" => "1",
          "uptime_in_seconds" => "36000",
          "uptime_in_days" => 0
        }
        return server_info
      end

      def lastsave
        Time.now.to_i
      end

      def monitor ; end

      def save ; end

      def shutdown ; end

      def slaveof(host, port) ; end

      def sync ; end

      alias reset flushdb
    end

    include ServerMethods
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fakeredis-0.1.4 lib/fakeredis/server.rb
fakeredis-0.1.3 lib/fakeredis/server.rb
fakeredis-0.1.2 lib/fakeredis/server.rb
fakeredis-0.1.1 lib/fakeredis/server.rb
fakeredis-0.1.0 lib/fakeredis/server.rb