Sha256: 92362c67a91a6d4448efb8e0b593aacfdd27344216f08502e0f4572285a32c19

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

module Bluepill
  class AppProxy
    APP_ATTRIBUTES = [:working_dir, :uid, :gid, :environment, :auto_start]

    attr_accessor(*APP_ATTRIBUTES)
    attr_reader :app

    def initialize(app_name, options)
      @app = Application.new(app_name.to_s, options)
    end

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bluepill-0.1.2 lib/bluepill/dsl/app_proxy.rb
bluepill-0.1.1 lib/bluepill/dsl/app_proxy.rb
bluepill-0.0.70 lib/bluepill/dsl/app_proxy.rb
bluepill-0.0.69 lib/bluepill/dsl/app_proxy.rb