string-utility 2.0.2 → 2.1.0
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/CHANGELOG.md +2 -0
- data/lib/utils.rb +9 -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: 0ea0a2262564ccfd47a34b23fa25a70217044beb
|
4
|
+
data.tar.gz: 04eea58d585c1e5e070b8bccc65ce820f738990f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2c77088fcf8486b9e1c0264bc9af084083632d1f0929df2b5903e8c112ed0868e3fbbc19a040ab81ad8aff083e09d9c8c781f75410717bf10482ef49b57261b
|
7
|
+
data.tar.gz: efdea8a15a8b2a8e005d0bce51647864be3f0bc944d685b2f372ec6a5570b7ec454f884c99d4f940dc843cbdc179c6a546876c88fe9cfa9edca98e3b4be213dc
|
data/CHANGELOG.md
CHANGED
data/lib/utils.rb
CHANGED
@@ -17,5 +17,14 @@ module StringUtility
|
|
17
17
|
|
18
18
|
string
|
19
19
|
end
|
20
|
+
|
21
|
+
# Converts a separated string into an integer. This is basically the reverse
|
22
|
+
# of #separate.
|
23
|
+
# @return [Int] The integer version of the separated string.
|
24
|
+
def to_i_separated
|
25
|
+
string = self
|
26
|
+
string = string.gsub(/\D/, '')
|
27
|
+
string.to_i
|
28
|
+
end
|
20
29
|
end
|
21
30
|
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.0
|
4
|
+
version: 2.1.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-09 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
|