Sha256: 4bee8156181e962e275ebe33b345c84aa6d3482176767012be6750d5bfd3bbc2

Contents?: true

Size: 760 Bytes

Versions: 11

Compression:

Stored size: 760 Bytes

Contents

class Eye::Dsl::ApplicationOpts < Eye::Dsl::Opts

  include Eye::Dsl::Chain

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

  def not_seed_options
    [:groups]
  end

  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

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

  alias xgroup nop
  alias xprocess nop

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eye-0.10.1.pre lib/eye/dsl/application_opts.rb
eye-0.10.0 lib/eye/dsl/application_opts.rb
eye-0.10.0.alpha2 lib/eye/dsl/application_opts.rb
eye-0.10.0.alpha lib/eye/dsl/application_opts.rb
eye-0.9.4.nosigar lib/eye/dsl/application_opts.rb
eye-0.9.4 lib/eye/dsl/application_opts.rb
eye-0.9.3 lib/eye/dsl/application_opts.rb
eye-0.9.2.nosigar lib/eye/dsl/application_opts.rb
eye-0.9.2 lib/eye/dsl/application_opts.rb
eye-0.9.1 lib/eye/dsl/application_opts.rb
eye-0.9.pre lib/eye/dsl/application_opts.rb