Class: Eye::Dsl::ApplicationOpts

Inherits:
Opts show all
Includes:
Chain
Defined in:
lib/eye/dsl/application_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 included from Chain

#chain

Methods inherited from Opts

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

Methods inherited from PureOpts

#allow_options, create_options_methods, #include, #initialize, #nop, #with_condition

Constructor Details

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

Instance Method Details

#disallow_optionsObject



5
6
7
# File 'lib/eye/dsl/application_opts.rb', line 5

def disallow_options
  [:pid_file, :start_command, :daemonize]
end

#group(name, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/eye/dsl/application_opts.rb', line 13

def group(name, &block)
  Eye::Dsl.check_name(name)
  Eye::Dsl.debug "=> group #{name}"

  opts = Eye::Dsl::GroupOpts.new(name, self)
  opts.instance_eval(&block)

  if cfg = opts.config
    @config[:groups] ||= {}

    processes = cfg.delete(:processes) || {}
    @config[:groups][name.to_s] ||= {}
    @config[:groups][name.to_s].merge!(cfg)
    @config[:groups][name.to_s][:processes] ||= {}
    @config[:groups][name.to_s][:processes].merge!(processes)
  end

  Eye::Dsl.debug "<= group #{name}"
  opts
end

#not_seed_optionsObject



9
10
11
# File 'lib/eye/dsl/application_opts.rb', line 9

def not_seed_options
  [:groups]
end

#process(name, &block) ⇒ Object



34
35
36
37
38
# File 'lib/eye/dsl/application_opts.rb', line 34

def process(name, &block)
  res = nil
  group('__default__'){ res = process(name.to_s, &block) }
  res
end