Sha256: 57aa79dc3732cc5348eab2e41288e05d9dfa4320c7420b7bb2bc1f88de4e8e28
Contents?: true
Size: 367 Bytes
Versions: 2
Compression:
Stored size: 367 Bytes
Contents
module Pedantic::Punctuation def self.included(base) base.processors :replace_punctuation end def replace_punctuation(string) { /\bcan't\b/ => 'cannot', /'/ => '', /sh\*t/ => 'shit', /f\*[\*c]k/ => 'fuck' }.each { |pattern, replacement| string.gsub!(pattern, replacement) } string end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pedantic-0.1.1 | lib/pedantic/punctuation.rb |
pedantic-0.1.0 | lib/pedantic/punctuation.rb |