jejefy 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jejefy/configuration.rb +5 -0
- data/lib/jejefy/core_ext/string.rb +15 -5
- data/lib/jejefy/version.rb +1 -1
- data/lib/jejefy.rb +1 -0
- data/spec/jejefy_spec.rb +13 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c4d74d5122307584bca58ef66f147057a0f6850
|
4
|
+
data.tar.gz: fa342b5ef25ac8d4f4f752eb3f9b0530f073c704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ebe0056cae76efb180719e07b825a2ecbf7025b9308017c31e40d0fb852353845367bb664225d31f5f4c468d5f9c30244b4b44898288d5f5d376e87bbcb82bd
|
7
|
+
data.tar.gz: 4991a6c8011ba2c177c6a4f7afb3fcddce1daa929eafe321b31b2d575613297ca5a7928c938eb48ef3848866fb5ff0c2bce2a34510b4802e4cb96d0a506469c5
|
@@ -1,12 +1,22 @@
|
|
1
1
|
class String
|
2
2
|
def jejefy
|
3
|
-
|
4
|
-
|
3
|
+
str = self.gsub /a/, "4"
|
4
|
+
str = str.gsub /e/, "3"
|
5
|
+
str = str.gsub /o/, "0"
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
str
|
8
|
+
end
|
9
|
+
|
10
|
+
def vowel?
|
11
|
+
self.split("").map do |c|
|
12
|
+
c.send(:chck_vwl)
|
8
13
|
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
9
17
|
|
10
|
-
|
18
|
+
def chck_vwl
|
19
|
+
vowels = %w{a e i o u A E I O U}
|
20
|
+
vowels.include? self
|
11
21
|
end
|
12
22
|
end
|
data/lib/jejefy/version.rb
CHANGED
data/lib/jejefy.rb
CHANGED
data/spec/jejefy_spec.rb
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Jejefy do
|
4
|
-
it "
|
5
|
-
|
4
|
+
it "transforms a to 4" do
|
5
|
+
str = "mark"
|
6
|
+
expect(str.jejefy).to eq "m4rk"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "transforms e to 3" do
|
10
|
+
str = "joel"
|
11
|
+
expect(str.jejefy).to eq "j03l"
|
12
|
+
end
|
13
|
+
|
14
|
+
it "checks if a letter is vowel" do
|
15
|
+
letter = "joel"
|
16
|
+
expect(letter.vowel?).to eq [false, true, true, false]
|
6
17
|
end
|
7
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jejefy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Chavez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- bin/jejefy
|
70
70
|
- jejefy.gemspec
|
71
71
|
- lib/jejefy.rb
|
72
|
+
- lib/jejefy/configuration.rb
|
72
73
|
- lib/jejefy/core_ext.rb
|
73
74
|
- lib/jejefy/core_ext/string.rb
|
74
75
|
- lib/jejefy/version.rb
|