<commit_before># TCP client with SSL encryption.
#
# @author <NAME> <<EMAIL>>
class Raptor::Socket::TCP::SSL < Raptor::Socket::TCP
  extend Forwardable

  def_delegators :@sock, :close, :closed?, :to_io

  # @!method ssl_context
  #   @return [OpenSSL::SSL::Context]
  def_delegator :@sock, :ssl_context, :context

  # @!method ssl_verify_mode
  #   @return [Fixnum] One of the `OpenSSL::SSL::VERIFY_*` constants
  def_delegator :@sock, :ssl_verify_mode, :verify_mode

  # @!method ssl_version
  #   @return [Symbol]
  def_delegator :@sock, :ssl_version, :version

  # @!method getpeername
  #   @return [String] Sockaddr data.
  def_delegator :@original_socket, :getpeername, :getpeername

  DEFAULT_CONFIG = {
    version:         :TLSv1,
    verify_mode:     OpenSSL::SSL::VERIFY_PEER,
    connect_timeout: 5
  }

  # @param  [Raptor::Socket]  sock
  # @param  [Hash]  config Options
  # @option config :connect_timeout [Integer] (5)
  #   {#connect Connection} timeout in seconds.
  # @option config :version [Symbol] (:TLSv1)
  # @option config :verify_mode [Integer] (OpenSSL::SSL::VERIFY_NONE)
  #   Peer verification mode.
  # @option config :context [OpenSSL::SSL::SSLContext] (nil)
  #   SSL context to use.
  def initialize( sock, config = {} )
    config = DEFAULT_CONFIG.merge( config )
    super

    if (@context = config[:context]).nil?<commit_msg>Raptor::Socket::TCP::SSL: Cleaned up delegators<commit_after># TCP client with SSL encryption.
#
# @author <NAME> <<EMAIL>>
class Raptor::Socket::TCP::SSL < Raptor::Socket::TCP
  extend Forwardable

  # @!method context
  #   @return [OpenSSL::SSL::Context]
  def_delegator :@sock, :ssl_context, :context

  # @!method verify_mode
  #   @return [Fixnum] One of the `OpenSSL::SSL::VERIFY_*` constants
  def_delegator :@sock, :ssl_verify_mode, :verify_mode

  # @!method version
  #   @return [Symbol]  SSL version.
  def_delegator :@sock, :ssl_version, :version

  # @!method getpeername
  #   @return [String] Sockaddr data.
  def_delegator :@original_socket, :getpeername, :getpeername

  DEFAULT_CONFIG = {
    version:         :TLSv1,
    verify_mode:     OpenSSL::SSL::VERIFY_PEER,
    connect_timeout: 5
  }

  # @param  [Raptor::Socket]  sock
  # @param  [Hash]  config Options
  # @option config :connect_timeout [Integer] (5)
  #   {#connect Connection} timeout in seconds.
  # @option config :version [Symbol] (:TLSv1)
  # @option config :verify_mode [Integer] (OpenSSL::SSL::VERIFY_NONE)
  #   Peer verification mode.
  # @option config :context [OpenSSL::SSL::SSLContext] (nil)
  #   SSL context to use.
  def initialize( sock, config = {} )
    config = DEFAULT_CONFIG.merge( config )
    super

    if (@context = config[:context]).nil?
{'fraction_non_alphanumeric': 0.13674898636196092, 'fraction_numerical': 0.002948765204570586, 'mean_word_length': 4.140151515151516, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4200054', 'n_tokens_mistral': 945, 'n_tokens_neox': 926, 'n_words': 229}