tyop 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -1
- data/VERSION +1 -1
- data/lib/tyop.rb +12 -8
- data/tyop.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/tyop.rb
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
module Tyop
|
2
|
-
|
3
|
-
|
2
|
+
LOWERCASE_LETTERS = ('a'..'z').to_a
|
3
|
+
UPPERCASE_LETTERS = ('A'..'Z').to_a
|
4
|
+
LETTERS = LOWERCASE_LETTERS + UPPERCASE_LETTERS
|
5
|
+
|
6
|
+
def typolize(count=1)
|
7
|
+
original = self.dup
|
4
8
|
|
5
9
|
length = original.length
|
6
|
-
a = rand(length)
|
7
|
-
b = rand(length)
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
+
count.times do
|
12
|
+
a = rand(length)
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
+
l = LETTERS.length
|
15
|
+
|
16
|
+
original[a] = LETTERS[rand(l)]
|
17
|
+
end
|
14
18
|
|
15
19
|
original
|
16
20
|
end
|
data/tyop.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tyop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Isaac Priestley
|