Class: JerbilService::Config

Inherits:
Jellog::Config
  • Object
show all
Defined in:
lib/jerbil/jerbil_service/config.rb

Overview

configuration options for a Jerbil Service, which includes the Jellog logger and therefore inherits Jellog’s options first.

Direct Known Subclasses

Jerbil::Config

Instance Method Summary collapse

Instance Method Details

#configure_environment(env) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/jerbil/jerbil_service/config.rb', line 29

def configure_environment(env)

  default :prod
  comment "Set the environment for the service to run in.",
    "",
    "Can be one of the following:",
    "  :prod - for productionised services in use across a network ",
    "  :test - for testing a release candidate, e.g. also across the network",
    "  :dev - for developing the next release",
    "",
    "Services can be running in all three environments at the same time. Clients",
    "will need to use the appropriate config file to connect with each environment."

  env_set = [:prod, :test, :dev]
  a_member_of(env, env_set)
  
end

#configure_jerbil_env(env) ⇒ Object



63
64
65
66
67
68
# File 'lib/jerbil/jerbil_service/config.rb', line 63

def configure_jerbil_env(env)
  comment "Set this only to use a Jerbil Server that is not running in the production environment"
  env_set = [:prod, :test, :dev]
  a_member_of(env, env_set)
  
end

#configure_key_dir(path) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/jerbil/jerbil_service/config.rb', line 47

def configure_key_dir(path)
  default '/var/run/jerbil'
  comment "a writable directory where Jerbil stores a private key for each service.",
    "This key is used to authenticate systems operations, such as stopping the service.",
    "It is not used for client interactions, which can require a separate service key."

  a_writable_dir(path)
end

#configure_pid_dir(path) ⇒ Object



56
57
58
59
60
61
# File 'lib/jerbil/jerbil_service/config.rb', line 56

def configure_pid_dir(path)
  default '/var/run/jerbil'
  comment "A writable directory used to store the pid to assist in stopping reluctant servers"

  a_writable_dir(path)
end