Class: Renamr::CharAction
Overview
Replaces special symbols with hyphens, except ., &, and $.
Constant Summary collapse
- SYM =
' (){},~–\'![]_#@=„“”"`—+‘’;·‡«»%…'.chars.to_set.freeze
Instance Method Summary collapse
Methods inherited from Action
Instance Method Details
#do(src) ⇒ Object
14 15 16 |
# File 'lib/renamr/char.rb', line 14 def do(src) src.chars.map { |s| SYM.include?(s) ? '-' : s }.join end |