Class: Uc::Paths

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/uc/paths.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

#event_queue, event_stream, #event_stream, logger, #logger, stderr, #stderr

Constructor Details

#initialize(app_dir) ⇒ Paths

Returns a new instance of Paths.



11
12
13
# File 'lib/uc/paths.rb', line 11

def initialize(app_dir)
  @app_dir = Pathname.new(app_dir )
end

Instance Attribute Details

#app_dirObject (readonly)

Returns the value of attribute app_dir.



9
10
11
# File 'lib/uc/paths.rb', line 9

def app_dir
  @app_dir
end

Instance Method Details

#errorsObject



35
36
37
# File 'lib/uc/paths.rb', line 35

def errors
  @errors ||= []
end

#log_dirObject



19
20
21
# File 'lib/uc/paths.rb', line 19

def log_dir
  absolute_path "log"
end

#pid_dirObject



31
32
33
# File 'lib/uc/paths.rb', line 31

def pid_dir
  absolute_path "tmp/pids"
end

#rackObject



15
16
17
# File 'lib/uc/paths.rb', line 15

def rack
  absolute_path "config.ru"
end

#socket_dirObject



27
28
29
# File 'lib/uc/paths.rb', line 27

def socket_dir
  absolute_path "tmp/sockets"
end

#tmp_dirObject



23
24
25
# File 'lib/uc/paths.rb', line 23

def tmp_dir
  absolute_path "tmp"
end

#validate_requiredObject



39
40
41
42
43
# File 'lib/uc/paths.rb', line 39

def validate_required
  validate_required_dirs
  verify_readable rack
  log_and_raise_errors
end