Sha256: 15022e0daec9d59a1d201f9d8201a476307e57e64ecdfe032f412b919075b1f8

Contents?: true

Size: 967 Bytes

Versions: 38

Compression:

Stored size: 967 Bytes

Contents

# frozen_string_literal: true

require 'phobos/cli/start'

#@!visibility private
module Phobos
  # :nodoc:
  module CLI
    # :nodoc:
    class Start
      # :nodoc:
      def validate_listeners!
        Phobos.config.listeners.each do |listener|
          handler = listener.handler
          begin
            handler.constantize
          rescue NameError
            error_exit("Handler '#{handler}' not defined")
          end

          delivery = listener.delivery
          if delivery.nil?
            Phobos::CLI.logger.warn do
              Hash(message: "Delivery option should be specified, defaulting to 'batch'"\
               ' - specify this option to silence this message')
            end
          elsif !Listener::DELIVERY_OPTS.include?(delivery)
            error_exit("Invalid delivery option '#{delivery}'. Please specify one of: "\
              "#{Listener::DELIVERY_OPTS.join(', ')}")
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
deimos-ruby-1.19.7 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.6 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.5 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.4 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.3 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.1.pre.beta1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.0 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.beta2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.19.beta1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.18.2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.18.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.18.0 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.17.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.17.0 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.16.5 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.16.4 lib/deimos/monkey_patches/phobos_cli.rb