Class: Bluepill::AppProxy
- Inherits:
-
Object
- Object
- Bluepill::AppProxy
- Defined in:
- lib/bluepill/dsl/app_proxy.rb
Constant Summary collapse
- APP_ATTRIBUTES =
[:working_dir, :uid, :gid, :environment, :auto_start]
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#initialize(app_name, options) ⇒ AppProxy
constructor
A new instance of AppProxy.
- #process(process_name, &process_block) ⇒ Object
Constructor Details
#initialize(app_name, options) ⇒ AppProxy
Returns a new instance of AppProxy.
8 9 10 |
# File 'lib/bluepill/dsl/app_proxy.rb', line 8 def initialize(app_name, ) @app = Application.new(app_name.to_s, ) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/bluepill/dsl/app_proxy.rb', line 6 def app @app end |
Instance Method Details
#process(process_name, &process_block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bluepill/dsl/app_proxy.rb', line 12 def process(process_name, &process_block) attributes = {} APP_ATTRIBUTES.each { |a| attributes[a] = send(a) } process_factory = ProcessFactory.new(attributes, process_block) process = process_factory.create_process(process_name, @app.pids_dir) group = process_factory.attributes.delete(:group) @app.add_process(process, group) end |