Sha256: 8eb5f2afe4febb81f13ad19e0d845c38573d762ba98e5b0de500630e248ccc55

Contents?: true

Size: 594 Bytes

Versions: 92

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

require 'cgi'

module Seahorse
  # @api private
  module Util
    class << self
      def uri_escape(string)
        CGI.escape(string.to_s.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~')
      end

      def uri_path_escape(path)
        path.gsub(/[^\/]+/) { |part| uri_escape(part) }
      end

      # Checks for a valid host label
      # @see https://tools.ietf.org/html/rfc3986#section-3.2.2
      # @see https://tools.ietf.org/html/rfc1123#page-13
      def host_label?(str)
        str =~ /^(?!-)[a-zA-Z0-9-]{1,63}(?<!-)$/
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
aws-sdk-core-3.164.0 lib/seahorse/util.rb
aws-sdk-core-3.163.0 lib/seahorse/util.rb
aws-sdk-core-3.162.0 lib/seahorse/util.rb
aws-sdk-core-3.161.0 lib/seahorse/util.rb
aws-sdk-core-3.160.0 lib/seahorse/util.rb
aws-sdk-core-3.159.0 lib/seahorse/util.rb
aws-sdk-core-3.158.1 lib/seahorse/util.rb
aws-sdk-core-3.158.0 lib/seahorse/util.rb
aws-sdk-core-3.157.0 lib/seahorse/util.rb
aws-sdk-core-3.156.0 lib/seahorse/util.rb
aws-sdk-core-3.155.0 lib/seahorse/util.rb
aws-sdk-core-3.154.0 lib/seahorse/util.rb
aws-sdk-core-3.153.0 lib/seahorse/util.rb
aws-sdk-core-3.152.0 lib/seahorse/util.rb
aws-sdk-core-3.151.0 lib/seahorse/util.rb
aws-sdk-core-3.150.0 lib/seahorse/util.rb
aws-sdk-core-3.149.0 lib/seahorse/util.rb
aws-sdk-core-3.148.0 lib/seahorse/util.rb
aws-sdk-core-3.147.0 lib/seahorse/util.rb
aws-sdk-core-3.146.0 lib/seahorse/util.rb