jejefy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jejefy.rb +1 -1
- data/lib/jejefy/core_ext/string.rb +3 -5
- data/lib/jejefy/version.rb +1 -1
- data/spec/jejefy_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc98d7de7956161f578bb0f57d2db70f544aaedd
|
4
|
+
data.tar.gz: 2d0dfbdd46f7b452b60af31e92fd919b79647b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b6367c271cb3190bc59021bbc6c9452917c63664a095350bd9d7a53b42af52f83f9d7733cfb1b070285e94855872bb28be16d9bd229493ce2dcdcef91cf6647
|
7
|
+
data.tar.gz: a143e3d945f2689b8461eea8e3dc14b4a414d07518ab91235b6acd780d539451a9bd576a96b073f8e87010e87cc1c68b97261e6d0ea00995c2a3de980cbe96e0
|
data/lib/jejefy.rb
CHANGED
@@ -3,20 +3,18 @@ class String
|
|
3
3
|
str = self.gsub /a/, "4"
|
4
4
|
str = str.gsub /e/, "3"
|
5
5
|
str = str.gsub /o/, "0"
|
6
|
+
str = str.gsub /i/, "!"
|
6
7
|
|
7
8
|
str
|
8
9
|
end
|
9
10
|
|
10
11
|
def vowel?
|
11
|
-
self.split("").map
|
12
|
-
c.send(:chck_vwl)
|
13
|
-
end
|
12
|
+
self.split("").map { |c| c.send(:chck_vwl) }
|
14
13
|
end
|
15
14
|
|
16
15
|
private
|
17
16
|
|
18
17
|
def chck_vwl
|
19
|
-
|
20
|
-
vowels.include? self
|
18
|
+
Jejefy::VOWELS.include? self
|
21
19
|
end
|
22
20
|
end
|
data/lib/jejefy/version.rb
CHANGED
data/spec/jejefy_spec.rb
CHANGED
@@ -11,6 +11,16 @@ describe Jejefy do
|
|
11
11
|
expect(str.jejefy).to eq "j03l"
|
12
12
|
end
|
13
13
|
|
14
|
+
it "transforms o to 0" do
|
15
|
+
str = "moo"
|
16
|
+
expect(str.jejefy).to eq "m00"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "transforms i to !" do
|
20
|
+
str = "king"
|
21
|
+
expect(str.jejefy).to eq "k!ng"
|
22
|
+
end
|
23
|
+
|
14
24
|
it "checks if a letter is vowel" do
|
15
25
|
letter = "joel"
|
16
26
|
expect(letter.vowel?).to eq [false, true, true, false]
|