Class: Mobilis::RedisInstance

Inherits:
GenericProject show all
Defined in:
lib/mobilis/redis_instance.rb

Instance Method Summary collapse

Methods inherited from GenericProject

#children, #display, #docker_image_name, #env_vars, #generate_build_sh, #git_commit_all, #initialize, #linked_to_rails_project, #links, #name, #options, #parents, #set_links, #type

Methods included from ActionsProjectsTake

#append_line, #oblivious_run_command, #run_command, #run_docker, #set_file_contents, #set_second_line, #write_file

Constructor Details

This class inherits a constructor from Mobilis::GenericProject

Instance Method Details

#child_env_varsObject



12
13
14
15
16
17
18
# File 'lib/mobilis/redis_instance.rb', line 12

def child_env_vars
  [
    "REDIS_HOST=#{ name }",
    "REDIS_PORT=6379",
    "REDIS_PASSWORD=#{ password }"
  ]
end

#data_dirObject



20
21
22
# File 'lib/mobilis/redis_instance.rb', line 20

def data_dir
  "./data/#{ name }"
end

#generateObject



8
9
10
# File 'lib/mobilis/redis_instance.rb', line 8

def generate
  FileUtils.mkdir_p data_dir
end

#has_local_buildObject



24
25
26
# File 'lib/mobilis/redis_instance.rb', line 24

def has_local_build
  false
end

#passwordObject



32
33
34
# File 'lib/mobilis/redis_instance.rb', line 32

def password
  "#{name}_password"
end

#usernameObject



28
29
30
# File 'lib/mobilis/redis_instance.rb', line 28

def username
  name
end