daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: permalink_fu.rb
  2. ===================================================================
  3. --- permalink_fu.rb (revision 261)
  4. +++ permalink_fu.rb (working copy)
  5. @@ -1,12 +1,15 @@
  6.  require 'iconv'
  7.  require 'digest/sha1'
  8. +require 'diacritics_fu'
  9. +
  10.  module PermalinkFu
  11.    class << self
  12.      attr_accessor :translation_to
  13.      attr_accessor :translation_from
  14.      
  15.      def escape(str)
  16. -      s = Iconv.iconv(translation_to, translation_from, str).to_s
  17. +      s = DiacriticsFu.escape(str)
  18. +      s = Iconv.iconv(translation_to, translation_from, s).to_s
  19.        s.gsub!(/\W+/, ' ') # all non-word chars to spaces
  20.        s.strip!            # ohh la la
  21.        s.downcase!         #
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top