Class: Mcrain::Redis
Constant Summary collapse
- DB_DIR_ON_CONTAINER =
'/data'.freeze
Instance Attribute Summary collapse
-
#db_dir ⇒ Object
Returns the value of attribute db_dir.
Attributes inherited from Base
Instance Method Summary collapse
- #build_docker_options ⇒ Object
- #client_class ⇒ Object
- #client_init_args ⇒ Object
- #client_require ⇒ Object
- #wait_for_ready ⇒ Object
Methods inherited from Base
#initialize, #logger, #reset, #setup, #start, #start_callback, #stop_or_kill_and_remove, #teardown, #wait, #wait_port, work_dir
Methods included from ClientProvider
#build_client, #client, #client_instantiation_script, #client_script
Methods included from ContainerController
#add_volume_options, #container, #container_image, #find_portno, #host, included, #info, #ip, #name, #port, #ssh_uri, #url
Constructor Details
This class inherits a constructor from Mcrain::Base
Instance Attribute Details
#db_dir ⇒ Object
Returns the value of attribute db_dir.
28 29 30 |
# File 'lib/mcrain/redis.rb', line 28 def db_dir @db_dir end |
Instance Method Details
#build_docker_options ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/mcrain/redis.rb', line 32 def r = super if db_dir && !db_dir.empty? (r, DB_DIR_ON_CONTAINER, db_dir) end return r end |
#client_class ⇒ Object
16 17 18 |
# File 'lib/mcrain/redis.rb', line 16 def client_class ::Redis end |
#client_init_args ⇒ Object
20 21 22 |
# File 'lib/mcrain/redis.rb', line 20 def client_init_args [{host: host, port: port}] end |
#client_require ⇒ Object
12 13 14 |
# File 'lib/mcrain/redis.rb', line 12 def client_require 'redis' end |
#wait_for_ready ⇒ Object
24 25 26 |
# File 'lib/mcrain/redis.rb', line 24 def wait_for_ready client.keys end |