ardb 0.27.1 → 0.27.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 +4 -4
- data/lib/ardb/has_slug.rb +1 -1
- data/lib/ardb/version.rb +1 -1
- data/test/unit/has_slug_tests.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 311d362f1bd82654a1495a7d44cf65220ac90950
|
4
|
+
data.tar.gz: 5eb5ec19f2388b1113d4949f0b12e7bd0a4b10ea
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: 88d482971f3b0f023a62091432392508b1a4107032593eeae7bca5350e05083e770789d0b5c8c658f9be3b5339921627885edd3a418cb7ef4d9fb3fc0cb0bbdf
|
7
|
+
data.tar.gz: 493d4e295d894418be638db6c7fddeb116a5fee72244b57fa9ab27924ddcb2b3574a87e0ed9c10c75455e0a46adbb281b5c730c36009da656cfe5d5eb8bd0694
|
data/lib/ardb/has_slug.rb
CHANGED
@@ -86,7 +86,7 @@ module Ardb
|
|
86
86
|
allow_underscores = options[:allow_underscores]
|
87
87
|
regexp_escaped_sep = Regexp.escape(separator)
|
88
88
|
|
89
|
-
slug = preprocessor.call(string.to_s)
|
89
|
+
slug = preprocessor.call(string.to_s.dup)
|
90
90
|
# Turn unwanted chars into the separator
|
91
91
|
slug.gsub!(/[^\w#{regexp_escaped_sep}]+/, separator)
|
92
92
|
# Turn underscores into the separator, unless allowing
|
data/lib/ardb/version.rb
CHANGED
data/test/unit/has_slug_tests.rb
CHANGED
@@ -247,6 +247,11 @@ module Ardb::HasSlug
|
|
247
247
|
|
248
248
|
should have_imeths :new
|
249
249
|
|
250
|
+
should "always dup the given string" do
|
251
|
+
string = Factory.string
|
252
|
+
assert_not_same string, subject.new(string, @args)
|
253
|
+
end
|
254
|
+
|
250
255
|
should "not change strings that are made up of valid chars" do
|
251
256
|
string = Factory.string
|
252
257
|
assert_equal string, subject.new(string, @args)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ardb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2016-03-
|
13
|
+
date: 2016-03-17 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|