string-utility 2.1.0 → 2.2.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 +4 -0
- data/lib/utils.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 427e5ac782e47c55afbf7293cc5c7aa6792ab437
|
4
|
+
data.tar.gz: 970ec310c7cc96a18ea9654efefe7e9e8f2fd8da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184ad98ddbb5b332692e613f463f52cad0c0497934e0ea225fe73ff0436f693f45240d6e3593906672fc40eb1e38b95fd261ad5694246cc093c133b3cebed121
|
7
|
+
data.tar.gz: d863c19c1bb55beb32c6cf03959ea8e684289c46174d566f7625eb507b78b2f5546448b0d556ef252b41d5268c624cde0454ef5d00cfb0a29b143e269b6b9627
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
## Version 2
|
3
|
+
### Version 2.2.0
|
4
|
+
* New underscorify method to replace whitespace with underscores.
|
5
|
+
|
3
6
|
### Version 2.1.0
|
4
7
|
* New to_i_separated method for converting a separated string to an integer.
|
8
|
+
|
5
9
|
### Version 2.0.2
|
6
10
|
* Require the right Ruby version, 2.1.
|
7
11
|
|
data/lib/utils.rb
CHANGED
@@ -26,5 +26,13 @@ module StringUtility
|
|
26
26
|
string = string.gsub(/\D/, '')
|
27
27
|
string.to_i
|
28
28
|
end
|
29
|
+
|
30
|
+
# Replaces all whitespace with underscores.
|
31
|
+
# @return [String] The string with replaced whitespace.
|
32
|
+
def underscorify
|
33
|
+
string = self
|
34
|
+
string = string.gsub(/\s/, '_')
|
35
|
+
string
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string-utility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Foster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " Some simple but handy methods to interact with string objects.\n"
|
14
14
|
email: elifosterwy@gmail.com
|