typogen 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +3 -3
- data/lib/typogen.rb +1 -0
- data/lib/typogen/end_same_sound.rb +2 -2
- data/lib/typogen/start_same_sound.rb +27 -0
- data/lib/typogen/typo.rb +1 -0
- data/lib/typogen/version.rb +1 -1
- data/typogen.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a217b95ca870342522b67248d3a59b64df3ea55b
|
4
|
+
data.tar.gz: f0277271de18ea89173b2f80e9f5f7c5d55dca02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a82a7dc957e30a9fe6e314ab1d679fc8bc42d1b653141718198339125be0ab37fd4da6898ae43a86d760697b62ec5a1b76ac9459dade8dc37002b89be74bfdf
|
7
|
+
data.tar.gz: d0f27625bf7c87d297888278a37fe1fbb1bfe5a778fc7464451c09997541a7c70154d98cef80e8b6d9da4a0d99230df2db8f2106e4270b5e6b1bcae11d954e26
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# TypoGen
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/siman-man/typogen.svg?branch=master)](https://travis-ci.org/siman-man/typogen)
|
4
|
+
|
3
5
|
Simple typo generator (English)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
Or install it yourself as:
|
8
|
-
|
9
9
|
```
|
10
10
|
$ gem install typogen
|
11
11
|
```
|
@@ -19,7 +19,7 @@ $ typogen [word]
|
|
19
19
|
## Example
|
20
20
|
|
21
21
|
```
|
22
|
-
typogen install
|
22
|
+
$ typogen install
|
23
23
|
```
|
24
24
|
|
25
25
|
output
|
data/lib/typogen.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module TypoGen
|
2
|
+
class StartSameSound
|
3
|
+
PATTERN_LIST = [
|
4
|
+
%w(in im),
|
5
|
+
%w(con com),
|
6
|
+
%w(clo cro),
|
7
|
+
%w(cou coa),
|
8
|
+
%w(car cur),
|
9
|
+
].freeze
|
10
|
+
|
11
|
+
def self.create(word)
|
12
|
+
typo_list = []
|
13
|
+
|
14
|
+
PATTERN_LIST.each do |pattern|
|
15
|
+
pattern.combination(2).each do |from, to|
|
16
|
+
if word =~ /^#{from}/
|
17
|
+
typo_list << word.sub(/^#{from}/, to)
|
18
|
+
elsif word =~ /^#{to}/
|
19
|
+
typo_list << word.sub(/^#{to}/, from)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
typo_list
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/typogen/typo.rb
CHANGED
data/lib/typogen/version.rb
CHANGED
data/typogen.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.description = %q{simple typo generator}
|
14
14
|
spec.homepage = "https://github.com/siman-man/typogen"
|
15
15
|
spec.license = "MIT"
|
16
|
-
spec.required_ruby_version = '>= 2.
|
16
|
+
spec.required_ruby_version = '>= 2.0.0'
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
19
|
f.match(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typogen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- siman-man
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/typogen/cli.rb
|
76
76
|
- lib/typogen/end_same_sound.rb
|
77
77
|
- lib/typogen/skip_letter.rb
|
78
|
+
- lib/typogen/start_same_sound.rb
|
78
79
|
- lib/typogen/swap_letter.rb
|
79
80
|
- lib/typogen/typo.rb
|
80
81
|
- lib/typogen/version.rb
|
@@ -91,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
92
|
requirements:
|
92
93
|
- - ">="
|
93
94
|
- !ruby/object:Gem::Version
|
94
|
-
version: 2.
|
95
|
+
version: 2.0.0
|
95
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
97
|
requirements:
|
97
98
|
- - ">="
|