string-utility 2.3.0 → 2.4.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 +3 -0
- data/lib/utils.rb +10 -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: 31a8358a03fd06e93b86cda830d7fd251ab3fcad
|
4
|
+
data.tar.gz: 6238c0ee73b6139493c9c545cc8a731519fd91dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2cc24a42e2c84446dcfbfd7c6a9cd662cf9881f05394783c3d582768ac89ba352a89e099f213a0c209e2ca0d0669e22e1325222699b0ce0f0b4c9f9479c8413
|
7
|
+
data.tar.gz: 94e9cb446ffe73004f88e775effa4baa116cc15b4209f236a1bba9b528c1235d03df628b06ef2d1c60cc7143aff7501f5103fb011ae7327356cdadb695a3216f
|
data/CHANGELOG.md
CHANGED
data/lib/utils.rb
CHANGED
@@ -43,4 +43,14 @@ module StringUtility
|
|
43
43
|
string
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
extend self
|
48
|
+
|
49
|
+
# Gets a random line in a file.
|
50
|
+
# @param path [String] The path to the file.
|
51
|
+
# @return [String] A random line in the file.
|
52
|
+
def self.random_line(path)
|
53
|
+
read = File.readlines(path)
|
54
|
+
read[rand(read.size)]
|
55
|
+
end
|
46
56
|
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.4.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-15 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
|