string-utility 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/utils.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83db5676a6b6fa1bdc93eea41ac95a8c1995043b
|
4
|
+
data.tar.gz: 04b1559a4fbbeb3cecde296e48595c7c3f6c1fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dd6bf662182e34ca50641fc8a9156852ee5b21cee67260e25f80d50715425f1d14aa4383cbc2eb40396ad68c9d6d71d44c330bd30c4f6a5941e925827b3545e
|
7
|
+
data.tar.gz: bfb2688ee807a3cfb7c34fa6acccaefcb8a2ad368dede95e84a6641fd1c18efd0b8650704ea1234a626ca137b69e9d10ad1feaae37ae128b9e233cad1af4c781
|
data/CHANGELOG.md
CHANGED
data/lib/utils.rb
CHANGED
@@ -34,5 +34,13 @@ module StringUtility
|
|
34
34
|
string = string.gsub(/\s/, '_')
|
35
35
|
string
|
36
36
|
end
|
37
|
+
|
38
|
+
# Replaces all underscores with whitespace.
|
39
|
+
# @return [String] The string with replaced underscores.
|
40
|
+
def spacify
|
41
|
+
string = self
|
42
|
+
string = string.gsub('_', ' ')
|
43
|
+
string
|
44
|
+
end
|
37
45
|
end
|
38
46
|
end
|