Class: Mcrain::Redis
- Inherits:
-
Base
- Object
- Base
- Mcrain::Redis
show all
- Defined in:
- lib/mcrain/redis.rb
Constant Summary
collapse
- DB_DIR_ON_CONTAINER =
'/data'.freeze
Instance Attribute Summary collapse
Attributes inherited from Base
#skip_reset_after_teardown
Instance Method Summary
collapse
Methods inherited from Base
#logger, #reset, #setup, #start, #stop_or_kill_and_remove, #teardown, #wait, #wait_port
#build_client, #client, #client_script
#add_volume_options, #container, #container_image, #find_portno, #host, included, #info, #ip, #name, #port, #ssh_uri, #url
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 build_docker_options
r = super
if db_dir && !db_dir.empty?
add_volume_options(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
|