Sha256: c59741b1595c16928857ec78aada0cc1c3c9e05b90e1052ad81df796e38bb673
Contents?: true
Size: 565 Bytes
Versions: 11
Compression:
Stored size: 565 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 def cleanup dup.gsub!(/\s*(\r?\n\s*|\s+)/, ' ') end def cleanup! gsub!(/\s*(\r?\n\s*|\s+)/, ' ') self end def cleanup_production Rails.env.production? \ ? cleanup : self end alias_method :clean_cert, :clean_certificate end
Version data entries
11 entries across 11 versions & 1 rubygems