Skip to content

Instantly share code, notes, and snippets.

View ColinDKelley's full-sized avatar

Colin Kelley ColinDKelley

  • Invoca, Inc.
  • Santa Barbara, CA
View GitHub Profile
orig = File.read("King Bee emails from Rachel.txt")
cleaned = orig
.force_encoding('BINARY')
.gsub("\xCA".force_encoding('BINARY'), '')
.gsub(/\r+/, '; ')
.gsub("\"; <", "\" <")
.gsub(/; */, "\n")
.gsub(/^"/, '')
.gsub("\" ", ' <')
destination_address =
if call_flow.sip_integration_if_enabled
if advertiser.feature_enabled?(:sip_integration_destination_in_display_format) ||
!(destination_phone_number = PhoneNumberWithExtension.new(destination)).valid?
destination.presence
else
destination_phone_number
end
else
destination_phone_number(destination)