Module: Citrus::Utils::PathUtil

Included in:
Components::Remote, Server::Server
Defined in:
lib/citrus/util/path_util.rb

Overview

PathUtil

Instance Method Summary collapse

Instance Method Details

#get_handler_path(app_base, server_type) ⇒ Object

Get handler path

Parameters:

  • app_base (String)
  • server_type (String)


44
45
46
47
# File 'lib/citrus/util/path_util.rb', line 44

def get_handler_path app_base, server_type
  path = File.join app_base, '/app/servers/', server_type, 'handlers'
  File.exists?(path) ? path : nil
end

#get_sys_remote_path(role) ⇒ Object

Get system remote service path

Parameters:

  • role (String)


17
18
19
20
# File 'lib/citrus/util/path_util.rb', line 17

def get_sys_remote_path role
  path = File.join File.dirname(__FILE__), '/../common/remote/', role
  File.exists?(path) ? path : nil
end

#get_user_remote_path(app_base, server_type) ⇒ Object

Get user remote service path

Parameters:

  • app_base (String)
  • server_type (String)


26
27
28
29
# File 'lib/citrus/util/path_util.rb', line 26

def get_user_remote_path app_base, server_type
  path = File.join app_base, '/app/servers/', server_type, 'remote'
  File.exists?(path) ? path : nil
end

#remote_path_record(namespace, server_type, path) ⇒ Object

Compose remote path record

Parameters:

  • namespace (String)
  • server_type (String)
  • path (String)


36
37
38
# File 'lib/citrus/util/path_util.rb', line 36

def remote_path_record namespace, server_type, path
  { :namespace => namespace, :server_type => server_type, :path => path }
end