Class: PhusionPassenger::Standalone::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/phusion_passenger/standalone/config_file.rb

Defined Under Namespace

Classes: DisallowedContextError

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ConfigFile) initialize(context, filename)



42
43
44
45
46
47
48
49
50
# File 'lib/phusion_passenger/standalone/config_file.rb', line 42

def initialize(context, filename)
	@options  = {}
	@context  = context
	@filename = filename
	File.open(filename, 'r') do |f|
		f.flock(File::LOCK_SH)
		instance_eval(f.read, filename)
	end
end

Instance Attribute Details

- (Object) options (readonly)

Returns the value of attribute options



40
41
42
# File 'lib/phusion_passenger/standalone/config_file.rb', line 40

def options
  @options
end

Instance Method Details

- (Object) address(addr)



52
53
54
55
56
# File 'lib/phusion_passenger/standalone/config_file.rb', line 52

def address(addr)
	allowed_contexts(:port, :global_config)
	@options[:address] = addr
	@options[:tcp_explicitly_given] = true
end

- (Object) analytics(value)



101
102
103
# File 'lib/phusion_passenger/standalone/config_file.rb', line 101

def analytics(value)
	@options[:analytics] = value
end

- (Object) daemonize(on)



81
82
83
84
# File 'lib/phusion_passenger/standalone/config_file.rb', line 81

def daemonize(on)
	allowed_contexts(:daemonize, :global_config)
	@options[:daemonize] = on
end

- (Object) debugger(value)



105
106
107
# File 'lib/phusion_passenger/standalone/config_file.rb', line 105

def debugger(value)
	@options[:debugger] = value
end

- (Object) domain_name(name)



91
92
93
94
# File 'lib/phusion_passenger/standalone/config_file.rb', line 91

def domain_name(name)
	allowed_contexts(:domain_name, :local_config)
	@options[:server_names] = [name]
end

- (Object) domain_names(*names)



96
97
98
99
# File 'lib/phusion_passenger/standalone/config_file.rb', line 96

def domain_names(*names)
	allowed_contexts(:domain_names, :local_config)
	@options[:server_names] = names.to_a.flatten
end

- (Object) environment(name) Also known as: env, rails_env, rack_env



64
65
66
# File 'lib/phusion_passenger/standalone/config_file.rb', line 64

def environment(name)
	@options[:env] = name
end

- (Object) max_pool_size(number)



72
73
74
75
# File 'lib/phusion_passenger/standalone/config_file.rb', line 72

def max_pool_size(number)
	allowed_contexts(:max_pool_size, :global_config)
	@options[:max_pool_size] = number
end

- (Object) min_instances(number)



77
78
79
# File 'lib/phusion_passenger/standalone/config_file.rb', line 77

def min_instances(number)
	@options[:min_instances] = number
end

- (Object) nginx_bin(filename)



86
87
88
89
# File 'lib/phusion_passenger/standalone/config_file.rb', line 86

def nginx_bin(filename)
	allowed_contexts(:nginx_bin, :global_config)
	@options[:nginx_bin] = filename
end

- (Object) port(number)



58
59
60
61
62
# File 'lib/phusion_passenger/standalone/config_file.rb', line 58

def port(number)
	allowed_contexts(:port, :global_config)
	@options[:port] = number
	@options[:tcp_explicitly_given] = true
end