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.22.8 config/initializers/core_ext/string.rb
better_record-0.22.7 config/initializers/core_ext/string.rb
better_record-0.22.6 config/initializers/core_ext/string.rb
better_record-0.22.5 config/initializers/core_ext/string.rb
better_record-0.22.4 config/initializers/core_ext/string.rb
better_record-0.22.3 config/initializers/core_ext/string.rb
better_record-0.21.3 config/initializers/core_ext/string.rb
better_record-0.22.2 config/initializers/core_ext/string.rb
better_record-0.22.0 config/initializers/core_ext/string.rb
better_record-0.21.2 config/initializers/core_ext/string.rb
better_record-0.20.2 config/initializers/core_ext/string.rb
better_record-0.19.10 config/initializers/core_ext/string.rb
better_record-0.19.9 config/initializers/core_ext/string.rb
better_record-0.19.8 config/initializers/core_ext/string.rb
better_record-0.19.7 config/initializers/core_ext/string.rb
better_record-0.19.6 config/initializers/core_ext/string.rb
better_record-0.19.4 config/initializers/core_ext/string.rb
better_record-0.19.2 config/initializers/core_ext/string.rb
better_record-0.19.1 config/initializers/core_ext/string.rb
better_record-0.19.0 config/initializers/core_ext/string.rb