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, #command, #daemonize!, #initialize, #load_env, #nochecks, #nonotify, #notify, #notriggers, #scoped, #set_environment, #set_gid, #set_stdall, #set_stop_command, #set_uid, #skip_group_action, #stop_signals, #stop_signals=, #triggers, #with_server

Methods inherited from PureOpts

#allow_options, create_options_methods, #initialize, #nop, #use, #with_condition, with_parsed_file

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
# 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)

  @config[:groups] ||= {}
  @config[:groups][name.to_s] ||= {}

  if cfg = opts.config
    Eye::Utils.deep_merge!(@config[:groups][name.to_s], cfg)
  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


31
32
33
34
35
# File 'lib/eye/dsl/application_opts.rb', line 31

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