Module: Eye::Settings
- Defined in:
- lib/eye/settings.rb
Class Method Summary collapse
- .cache_path ⇒ Object
- .client_timeout ⇒ Object
- .dir ⇒ Object
- .ensure_eye_dir ⇒ Object
- .eyeconfig ⇒ Object
- .home ⇒ Object
- .path(path) ⇒ Object
- .pid_path ⇒ Object
- .root? ⇒ Boolean
- .socket_path ⇒ Object
- .supported_setsid? ⇒ Boolean
Class Method Details
.cache_path ⇒ Object
46 47 48 |
# File 'lib/eye/settings.rb', line 46 def cache_path path("processes#{ENV['EYE_V']}.cache") end |
.client_timeout ⇒ Object
50 51 52 |
# File 'lib/eye/settings.rb', line 50 def client_timeout 5 end |
.dir ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/eye/settings.rb', line 6 def dir if root? '/var/run/eye' else File.(File.join(home, '.eye')) end end |
.ensure_eye_dir ⇒ Object
34 35 36 |
# File 'lib/eye/settings.rb', line 34 def ensure_eye_dir FileUtils.mkdir_p( dir ) end |
.eyeconfig ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/eye/settings.rb', line 14 def eyeconfig if root? '/etc/eye.conf' else File.(File.join(home, '.eyeconfig')) end end |
.home ⇒ Object
26 27 28 |
# File 'lib/eye/settings.rb', line 26 def home ENV['EYE_HOME'] || ENV['HOME'] end |
.path(path) ⇒ Object
30 31 32 |
# File 'lib/eye/settings.rb', line 30 def path(path) File.join(dir, path) end |
.pid_path ⇒ Object
42 43 44 |
# File 'lib/eye/settings.rb', line 42 def pid_path path(ENV['EYE_PID'] || "pid#{ENV['EYE_V']}") end |
.socket_path ⇒ Object
38 39 40 |
# File 'lib/eye/settings.rb', line 38 def socket_path path(ENV['EYE_SOCK'] || "sock#{ENV['EYE_V']}") end |
.supported_setsid? ⇒ Boolean
54 55 56 |
# File 'lib/eye/settings.rb', line 54 def supported_setsid? RUBY_VERSION >= '2.0' end |