Module: UCB::UnixEnvironment

Included in:
CalwebPro, Webfarm
Defined in:
lib/ucb_unix_environment.rb

Overview

Module giving Ruby access to various attributes of the webfarm including environment (dev, qa, prod), user/group info and ports.

`uname -n`                  #=> "webfarm-dev-01\n"

UCB::Webfarm.machine_name   #=> "webfarm-dev-01"
UCB::Webfarm.machines       #=> ["webfarm-dev-01", "webfarm-dev-02"]

`id`                        #=> "uid=10099(a_user) gid=10099(a_group)\n"

UCB::Webfarm.webfarm_id     #=> 99
UCB::Webfarm.uid            #=> 10099
UCB::Webfarm.user           #=> "a_user"
UCB::Webfarm.shared_dir     #=> "/users/a_user"
UCB::Webfarm.local_dir      #=> "/users/a_user/local"

UCB::Webfarm.http_port      #=> 10099
UCB::Webfarm.https_port     #=> 20099

UCB::Webfarm.mongrel_port_count  #=> 4
UCB::Webfarm.mongrel_ports       #=> [30099, 40099, 50099, 60099]

Defined Under Namespace

Modules: AbstractClassMethods, ClassMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



27
28
29
30
# File 'lib/ucb_unix_environment.rb', line 27

def self.included(klass)
  klass.extend(ClassMethods)
  klass.extend(AbstractClassMethods)
end