string-utility 2.4.1 → 2.5.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 +4 -0
- data/lib/utils.rb +18 -1
- 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: bbed80c84e8c9dc5be73278ee680d7ca18725cb6
|
4
|
+
data.tar.gz: 6d56ccbb30cd8d20f5c8f46e91d6344740b8aba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d957ddac0fdd2075c069439174712302e6494a643f757154c1ba612564a6126d10e4d9642458a372c7f222b3a2ffe78b0b58bcb68996a2d64fea2b08757d82a
|
7
|
+
data.tar.gz: ceadb86fd6073c37802427ac3c8b80bc080f168a17ef360b81646c3dbee021803d0a3f125d9db1c7efc844da1025eb867eaee07eeca8e6f137493eaa059f7892
|
data/CHANGELOG.md
CHANGED
data/lib/utils.rb
CHANGED
@@ -39,7 +39,7 @@ module StringUtility
|
|
39
39
|
# @return [String] The string with replaced underscores.
|
40
40
|
def spacify
|
41
41
|
string = self
|
42
|
-
string = string.
|
42
|
+
string = string.tr('_', ' ')
|
43
43
|
string
|
44
44
|
end
|
45
45
|
end
|
@@ -53,4 +53,21 @@ module StringUtility
|
|
53
53
|
read = File.readlines(path)
|
54
54
|
read[rand(read.size)].chomp
|
55
55
|
end
|
56
|
+
|
57
|
+
def self.random_color_three
|
58
|
+
string = random_color(0..2)
|
59
|
+
"##{string}"
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.random_color_six
|
63
|
+
string = random_color(0..5)
|
64
|
+
"##{string}"
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def random_color(limit)
|
70
|
+
values = (('A'..'F').to_a + (0..9).to_a)
|
71
|
+
limit.map { values.sample }.join
|
72
|
+
end
|
56
73
|
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.5.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-27 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
|