Sha256: 278825303f2e8e5aa8b915e3254f5ac307f97e23ab9badde4ea513bde0116f4b

Contents?: true

Size: 348 Bytes

Versions: 25

Compression:

Stored size: 348 Bytes

Contents

# frozen_string_literal: true

class String
  def self.clean_certificate(str)
    CGI.unescape(str).gsub(/(\n|-+(BEGIN|END)\s+CERTIFICATE-+|\s+)/, '').strip
  end

  def clean_certificate
    String.clean_certificate(self)
  end

  def clean_certificate!
    self.replace clean_certificate
  end

  alias_method :clean_cert, :clean_certificate
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
better_record-0.18.3 config/initializers/core_ext/string.rb
better_record-0.18.2 config/initializers/core_ext/string.rb
better_record-0.18.1 config/initializers/core_ext/string.rb
better_record-0.18.0 config/initializers/core_ext/string.rb
better_record-0.17.9 config/initializers/core_ext/string.rb