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.24.2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.24.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.24.0 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.3 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta6 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta5 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta4 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta3 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.1.pre.beta1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.23.0 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22.5 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22.4 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22.3 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22.2 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.22 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.20.1 lib/deimos/monkey_patches/phobos_cli.rb
deimos-ruby-1.20.0 lib/deimos/monkey_patches/phobos_cli.rb