Sha256: 8cf00a71b0d93e77b920e2deb987bf2661426f7d48bd63e78034cad55d20c4b4

Contents?: true

Size: 527 Bytes

Versions: 2

Compression:

Stored size: 527 Bytes

Contents

require "sequel"
require "pact_broker/messages"

module PactBroker
  module DB

    class ConnectionConfigurationError < StandardError; end

    class ValidateEncoding

      extend PactBroker::Messages

      def self.call connection
        encoding = connection.opts[:encoding] || connection.opts["encoding"]
        unless encoding =~ /utf\-?8/i
          raise ConnectionConfigurationError.new(message("errors.validation.connection_encoding_not_utf8", encoding: encoding.inspect))
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pact_broker-2.81.0 lib/pact_broker/db/validate_encoding.rb
pact_broker-2.80.0 lib/pact_broker/db/validate_encoding.rb