Sha256: b23d52672a5c47211db308d679f586d24e21413a6df724590b4daf11bfbf88cd

Contents?: true

Size: 1.65 KB

Versions: 6

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
            required(:db).filled(:hash?)
            required(:sneakers).filled(:hash?)
          }
          self << [
            Config.sneakers_definition,
            Appfuel::Config.db_definition,
          ]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appfuel-service-0.2.7 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.6 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.5 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.3 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.2 lib/appfuel/service/config/worker.rb
appfuel-service-0.2.1 lib/appfuel/service/config/worker.rb