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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -0
  3. data/lib/utils.rb +9 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a452bed362fd25e8f766f558cc68b34a59ef2388
4
- data.tar.gz: c19543edbd08e345e004165f1c773f6825f402d9
3
+ metadata.gz: 0ea0a2262564ccfd47a34b23fa25a70217044beb
4
+ data.tar.gz: 04eea58d585c1e5e070b8bccc65ce820f738990f
5
5
  SHA512:
6
- metadata.gz: 6c9501768f1aada5f64ae310e3730737b24e5935a5127a57d78b1158759d582dba92d216af4f6e21773beebd9c253aa875c17702ca5a1f1b35188c60856bcd1a
7
- data.tar.gz: 16ff6b777bd0691e2f5b5c05c198a3ddf95a06862a3ce21871f802e7775f6d48bf7602687a094bf928f14467ed546bc3aac5049d27cf6d2d37c547a0215a3c0d
6
+ metadata.gz: f2c77088fcf8486b9e1c0264bc9af084083632d1f0929df2b5903e8c112ed0868e3fbbc19a040ab81ad8aff083e09d9c8c781f75410717bf10482ef49b57261b
7
+ data.tar.gz: efdea8a15a8b2a8e005d0bce51647864be3f0bc944d685b2f372ec6a5570b7ec454f884c99d4f940dc843cbdc179c6a546876c88fe9cfa9edca98e3b4be213dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
  ## Version 2
3
+ ### Version 2.1.0
4
+ * New to_i_separated method for converting a separated string to an integer.
3
5
  ### Version 2.0.2
4
6
  * Require the right Ruby version, 2.1.
5
7
 
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.2
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-06 00:00:00.000000000 Z
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