Sha256: cb591fce48a4ef1733e4e54e4dc3b535e17e199efbd75a6ffd9bb75fe397bc73

Contents?: true

Size: 642 Bytes

Versions: 6479

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true
module Ethon
  class Easy # :nodoc:

    # This module contains small helpers.
    #
    # @api private
    module Util

      # Escapes zero bytes in strings.
      #
      # @example Escape zero bytes.
      #   Util.escape_zero_byte("1\0")
      #   #=> "1\\0"
      #
      # @param [ Object ] value The value to escape.
      #
      # @return [ String, Object ] Escaped String if
      #   zero byte found, original object if not.
      def escape_zero_byte(value)
        return value unless value.to_s.include?(0.chr)
        value.to_s.gsub(0.chr, '\\\0')
      end

      extend self
    end
  end
end

Version data entries

6,479 entries across 6,477 versions & 22 rubygems

Version Path
ory-client-0.0.1.alpha28 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-client-0.0.1.alpha27 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-client-0.0.1.alpha24 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-client-0.0.1.alpha23 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-kratos-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-client-0.0.1.alpha21 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ory-keto-client-0.7.0.alpha1 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/util.rb
ethon-0.15.0 lib/ethon/easy/util.rb
ory-keto-client-0.7.0.alpha0 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha7 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha6 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha5 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha4 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha3 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.6.alpha1 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ory-kratos-client-0.7.5.alpha2 vendor/bundle/ruby/2.5.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
cloudsmith-api-0.57.1 vendor/bundle/ruby/2.6.0/gems/ethon-0.14.0/lib/ethon/easy/util.rb
ethon-0.14.0 lib/ethon/easy/util.rb
ethon-0.13.0 lib/ethon/easy/util.rb