Sha256: f991d97d8519aaaa4ec6c82980bcd1c736897e7d00e2ce1f8ed04219b2e2f0a0

Contents?: true

Size: 1.65 KB

Versions: 9

Compression:

Stored size: 1.65 KB

Contents

module Appfuel
  module Service
    module Config
      # Defines the configuration for the whole worker. It basically has two
      # child definitions :db and :sneakers
      #
      # Configuration Overview
      #
      # env:        The environement this worker is deployed as dev, qa, stg, prod
      # logfile:    The location of the application log file if the value is
      #             stdout or stderr it will use that instead
      # dispatchers List of workers that dispatch messages to actions. The reason
      #             why you would want more than one is to use different exchange
      #             types
      #
      # db          Database configuration please see sp_offers/config/database
      # sneakers    RabbitMQ configuration please see sp_offers/config/sneakers
      # aws         Configuration S3 where we store our documents
      # @return Definition
      def self.worker_definition
        Appfuel::Config.define :worker do
          file 'config/app.yaml'
          defaults log_file:       'stdout',
                    log_level:     'info',
                    audit_logfile: 'stdout'

          validator {
            required(:env).filled(:str?)
            required(:log_file).filled(:str?)
            required(:log_level).filled(:str?)
            required(:audit_logfile).filled(:str?)
            # Children will be validated on there own
            # we are just ensuring they exist
            optional(:db).filled(:hash?)
            required(:sneakers).filled(:hash?)
          }
          self << [
            Config.sneakers_definition,
            Appfuel::Config.db_definition,
          ]
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
appfuel-service-0.4.2 lib/appfuel/service/config/worker.rb
appfuel-service-0.4.1 lib/appfuel/service/config/worker.rb
appfuel-service-0.3.4 lib/appfuel/service/config/worker.rb
appfuel-service-0.3.3 lib/appfuel/service/config/worker.rb
appfuel-service-0.3.2 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.11 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.10 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.9 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.8 lib/appfuel/service/config/worker.rb