Class: Eye::Dsl::ProcessOpts

Inherits:
Opts show all
Defined in:
lib/eye/dsl/process_opts.rb

Constant Summary

Constants inherited from Opts

Opts::BOOL_OPTIONS, Opts::INTERVAL_OPTIONS, Opts::STR_OPTIONS

Instance Attribute Summary

Attributes inherited from PureOpts

#config, #full_name, #name, #parent

Instance Method Summary collapse

Methods inherited from Opts

#checks, #clear_bundler_env, #command, #daemonize!, #initialize, #nochecks, #nonotify, #notify, #notriggers, #scoped, #set_environment, #set_gid, #set_stdall, #set_uid, #stop_signals, #stop_signals=, #triggers, #with_server

Methods inherited from PureOpts

#allow_options, create_options_methods, #disallow_options, #initialize, #nop, #not_seed_options, #use, #with_condition

Constructor Details

This class inherits a constructor from Eye::Dsl::Opts

Instance Method Details

#applicationObject Also known as: app



12
13
14
# File 'lib/eye/dsl/process_opts.rb', line 12

def application
  parent.try(:parent)
end

#depend_on(names, opts = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/eye/dsl/process_opts.rb', line 18

def depend_on(names, opts = {})
  names = Array(names).map(&:to_s)
  trigger("wait_dependency_#{unique_num}", {:names => names}.merge(opts))
  nm = @config[:name]
  names.each do |name|
    parent.process(name) do
      trigger("check_dependency_#{unique_num}", :names => [ nm ] )
    end
  end
end

#monitor_children(&block) ⇒ Object



3
4
5
6
7
8
# File 'lib/eye/dsl/process_opts.rb', line 3

def monitor_children(&block)
  opts = Eye::Dsl::ChildProcessOpts.new
  opts.instance_eval(&block) if block
  @config[:monitor_children] ||= {}
  Eye::Utils.deep_merge!(@config[:monitor_children], opts.config)
end