Sha256: 5b5a915ba5511007b1f6cd206c91de285357fdc4b0f021a0d37faef5fab60b70

Contents?: true

Size: 1.03 KB

Versions: 24

Compression:

Stored size: 1.03 KB

Contents

module App1
  class ProcessConfig
    include Tengine::Support::Config::Definition
    field :daemon, "process works on background.", :type => :boolean
    field :pid_dir, "path/to/dir for PID created.", :type => :directory
  end

  class LoggerConfig < Tengine::Support::Config::Logger
    parameter :logger_name
    depends :process_config
    depends :log_common
    field :output,
      :default => proc{
        process_config.daemon ?
        "./log/#{logger_name}.log" : "STDOUT" },
      :default_description => proc{"if daemon process then \"./log/#{logger_name}.log\" else \"STDOUT\""}
    field :rotation,
      :default => proc{ log_common.rotation },
      :default_description => proc{"value of #{log_common.long_opt}-rotation"}
    field :rotation_size,
      :default => proc{ log_common.rotation_size },
      :default_description => proc{"value of #{log_common.long_opt}-rotation-size"}
    field :level,
      :default => proc{ log_common.level },
      :default_description => proc{"value of #{log_common.long_opt}-level"}
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tengine_support-0.3.6 spec/support/app1.rb
tengine_support-0.3.5 spec/support/app1.rb
tengine_support-0.3.4 spec/support/app1.rb
tengine_support-0.3.3 spec/support/app1.rb