acts_as_permalink 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86050d3cf7fcd67a1625c041b0c1110f462496a8
4
- data.tar.gz: 7b57bae34c95ab685867dba092eea81250b849d7
3
+ metadata.gz: d4787c945f97dbfb68cfac40545d1e90462ce634
4
+ data.tar.gz: 6624c9699bd8cd1884e86aa8a7a7fa0c824fdfaa
5
5
  SHA512:
6
- metadata.gz: e006f08cac82f911aca3e2095c0466520caef8c54d47f52cd36edc93ac5454b61628fb63df73e7ad96f0246ffe2ca70ff6dd278ce5cfabb2d9235edd619e6e0b
7
- data.tar.gz: b79452a9ab01445cb38b5e573fbdf714f77607be831e7bd5282c07bb224326b7fc295476b0968670d46b4f3228b5040357f7a6c3e666a952cb8cea278ef551b7
6
+ metadata.gz: 3cb05ee79ceb495703f85ccd6d5a60a1af2640222672ddb207e8e917d534b7320d997c4873d8843cb44574ba379684bb29e8244dae217f8eccbe0cc502df7863
7
+ data.tar.gz: 20615acbee1095d498f764cfa6780ea272bac1dcb723e4fa4584598b3861155a8dd8d05886b320ffa28624e7a8796c4445bfc7326a31e5699f74bfba0cc17cb7
@@ -1,5 +1,5 @@
1
1
  module Acts
2
2
  module Permalink
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
data/lib/string.rb CHANGED
@@ -2,6 +2,7 @@ class String
2
2
  def to_permalink(max_length: nil, separator: "-")
3
3
  text = self.dup
4
4
 
5
+ text = ActiveSupport::Inflector.transliterate(text) # convert to simplified characters
5
6
  text = text.downcase.strip # make the string lowercase and scrub white space on either side
6
7
  text = text.gsub(/[^a-z0-9]/, separator) # make any character that is not nupermic or alphabetic into a special character
7
8
  text = text.squeeze(separator) # removes any consecutive duplicates of the special character
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin McPhillips