email_typo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4e88660e5189aac9b6ae40fcd5adb231927d2dee
4
- data.tar.gz: 0d3954d0d96e5ba9d9fe234c249703620b0d2453
2
+ SHA256:
3
+ metadata.gz: 1b2bb8b32af16302a1fbc103c69d81fc49b8586eaf04828f6f5805b060ad319e
4
+ data.tar.gz: 415393c2f3fe10f979641799f75735b0ac89ed1ee020d898e2d5f2d52f9fd87c
5
5
  SHA512:
6
- metadata.gz: 1197d3487cfb81baea410d12ee935aa94b4dd4531ce4b0e142951ad92e26462118a6749a4d6c691a7fefd852757c2e3925dc460264ad428006c7018434386285
7
- data.tar.gz: f79ea6363bfb8ef43ec3b055b601edcad0a075f5782f05abdefb9271c5d81845ffb7f8c56b089782268b66b4d5ad69d724e9026748b35e2c629c33a7b1d3ba6e
6
+ metadata.gz: a6ec7d969ce82f3f10e6fbdd5b1da4a592a2cdfa8c734064d9618a4186d59d406d61fbb0a83bdc74ab92087004865579ac566bb41302d9293abdb6db6da7918c
7
+ data.tar.gz: 4b920c7ceb864f4976d266174d65f8b141e376dd842d9ea4bffb513e08dd5d9718fa0b77f46825c0664daedef1402efe886a3a955ee63a74ebb4c5e298913b61
data/.rubocop.yml ADDED
@@ -0,0 +1,126 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "bin/**/*"
4
+ - "gemfiles/**/*"
5
+ - "vendor/**/*"
6
+ - "Gemfile"
7
+ - "Rakefile"
8
+ - "*.gemspec"
9
+ - "config.ru"
10
+
11
+ Style/Alias:
12
+ EnforcedStyle: prefer_alias_method
13
+
14
+ Style/FrozenStringLiteralComment:
15
+ EnforcedStyle: always
16
+
17
+ Style/ClassCheck:
18
+ EnforcedStyle: kind_of?
19
+
20
+ Metrics/LineLength:
21
+ Max: 80
22
+
23
+ Style/BlockDelimiters:
24
+ Enabled: false
25
+
26
+ Style/RegexpLiteral:
27
+ Enabled: false
28
+
29
+ Metrics/AbcSize:
30
+ Enabled: false
31
+
32
+ Style/PerlBackrefs:
33
+ Enabled: false
34
+
35
+ ClassLength:
36
+ Enabled: false
37
+
38
+ CyclomaticComplexity:
39
+ Enabled: false
40
+
41
+ Documentation:
42
+ Enabled: false
43
+
44
+ Encoding:
45
+ Enabled: false
46
+
47
+ FileName:
48
+ Enabled: false
49
+
50
+ IfUnlessModifier:
51
+ Enabled: false
52
+
53
+ MethodLength:
54
+ Enabled: false
55
+
56
+ ModuleFunction:
57
+ Enabled: false
58
+
59
+ OneLineConditional:
60
+ Enabled: false
61
+
62
+ ParameterLists:
63
+ Enabled: false
64
+
65
+ Proc:
66
+ Enabled: false
67
+
68
+ SingleLineBlockParams:
69
+ Enabled: false
70
+
71
+ VariableInterpolation:
72
+ Enabled: false
73
+
74
+ Style/TrailingCommaInLiteral:
75
+ Enabled: false
76
+
77
+ WhileUntilModifier:
78
+ Enabled: false
79
+
80
+ PredicateName:
81
+ NamePrefixBlacklist:
82
+ - is_
83
+
84
+ StringLiterals:
85
+ EnforcedStyle: double_quotes
86
+ SupportedStyles:
87
+ - single_quotes
88
+ - double_quotes
89
+
90
+ DotPosition:
91
+ EnforcedStyle: leading
92
+
93
+ SpaceBeforeBlockBraces:
94
+ EnforcedStyle: space
95
+
96
+ SpaceInsideBlockBraces:
97
+ EnforcedStyle: no_space
98
+
99
+ DoubleNegation:
100
+ Enabled: false
101
+
102
+ SpaceInsideBlockBraces:
103
+ SpaceBeforeBlockParameters: false
104
+
105
+ SpaceInsideHashLiteralBraces:
106
+ Enabled: false
107
+
108
+ PercentLiteralDelimiters:
109
+ PreferredDelimiters:
110
+ '%': '[]'
111
+ '%i': '[]'
112
+ '%q': '[]'
113
+ '%Q': '[]'
114
+ '%r': '[]'
115
+ '%s': '[]'
116
+ '%w': '[]'
117
+ '%W': '[]'
118
+ '%x': '[]'
119
+
120
+ Style/CollectionMethods:
121
+ PreferredMethods:
122
+ collect: 'map'
123
+ collect!: 'map!'
124
+ inject: 'reduce'
125
+ detect: 'find'
126
+ find_all: 'select'
data/.travis.yml CHANGED
@@ -2,13 +2,17 @@ sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
4
  rvm:
5
- - 2.4.1
5
+ - 2.5.2
6
6
  before_install: gem install bundler
7
7
  script: bundle exec rake
8
8
  notifications:
9
9
  email: false
10
- after_success:
11
- - bundle exec codeclimate-test-reporter
10
+ before_script:
11
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
12
+ - chmod +x ./cc-test-reporter
13
+ - "./cc-test-reporter before-build"
14
+ after_script:
15
+ - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
12
16
  env:
13
17
  global:
14
- secure: NxLs+gcCgqm0cweEQ6abyZ7njE9JUNzycrSFO0OmEQUfiKl0ArIu26NrcjQvL3XvUiikmAcdzavA+5P4vMsQGFkjwqE0bwGxg+cu5a3nzNBoyhOKlQZQ+MTsWs3kX8VqADNa2VdosVkbf/n8Q9eFmV712NWZqPHGvT56HCpkQIQMo5h1/SuUJzVfbw+3P4x11++/hifodhq2xsGEzvaY0vThEk1BbVO2REeQsvnZx3Vs3m+wjmovhlpbL2PqAVBshbrlsBx6PKo55ubQjv4z0PByPAkk5bn5CY/SXw7xItw8s0camHj8bYCzJyjvsCFkLbKYiwcymy4mCAZz8SHZWf7FzKrZFYBQfPIlvcaIdN0gxYSmhUTZ+F7/Q12GS8ZNxi0QKyy7/crib1NKCYea+fYp9tX+RR+kTDRgxadzZDtHywjuwG9ttHuki8yQiL2Ma7Ecw1LbFVeKz2v/L3oxINUJ+uMHZVPOrpd+sO5+YTHN2xmuqPNbQnoOdNiT06fRQkbIPD11UfgRb1zegyxRmgc4H4n/Ps0OpuI5S4fafINFW9W0EhJjtOT/WJTy6nbKL1Rk8YeZBrK0JZSr/zZc6dt9FrZZaj2gjko9Zvb/wIP+nACXm1fV9+jIEoE2CzYdFaOQT0uAKbhQqnArZ5/RXg98nmuPoEPyjtgfWjPcINU=
18
+ secure: XU0SxxhufYnJNYC88bsAHseHtK4fd12B97b7NwHxnND9dDbUPCuGI9mkt06wTZchWnB4nDuS4SF6ib73zAP1JI3m7f2FyazAqrgm/OneXy8GYVQtbrG2+1XObSMc7ONX8K/+VGVnZi2nHO3XyC7VRWQreppVK8U24P7qNpJzmWUTy8XqvJT0ZTupELhbikh1cY1np/ammV4eX6QwoeSDd0Wx5QM4D/P06NEXqQ7PdYBBIDuB8zFwSZLh/Q8wNDiOwcUVJTULh/nLmdGMclCcp/aRPrbbWk01scS3khqiJK8SfujeDYNJeuaECGm/9r9MZHvH9Qd88aUJBZcxJRXJiZJ6xuYvc7WnF8tNxGp8xNYTr9/YJrUPPMDdoLr50LyXiY1wf3A0dQHdGNIv5gd7pMoEK+kg0dkqcnhg6OQNRkihudbFuORdKRocIVzHgxB3We+FBnqfexgzLNoYU3eJB3IL8nS0dRX2lSP36SDXTkZNUxflDgGLmoz//FRll3WJ1VsGOkZqBPA2TMoRxqLyhaVnXuPS5uiBUu4gAC4df4HWPAtM1LFtI1HvMenKOYFDqjrPqLevtmQTP/72zl84GAA3hoBGnPgOh2GBtAo/nn5ExbWQUfHSYMwSVD3rrMhe5Lt7G6mzg8hkGU7hYOKwrfSUq/i3+omS0gwHEUBh2vQ=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EmailTypo
2
2
 
3
- [![Travis-CI](https://travis-ci.org/fnando/email_typo.png)](https://travis-ci.org/fnando/email_typo)
3
+ [![Travis-CI](https://travis-ci.org/fnando/email_typo.svg)](https://travis-ci.org/fnando/email_typo)
4
4
  [![Code Climate](https://codeclimate.com/github/fnando/email_typo/badges/gpa.svg)](https://codeclimate.com/github/fnando/email_typo)
5
5
  [![Test Coverage](https://codeclimate.com/github/fnando/email_typo/badges/coverage.svg)](https://codeclimate.com/github/fnando/email_typo/coverage)
6
6
  [![Gem](https://img.shields.io/gem/v/email_typo.svg)](https://rubygems.org/gems/email_typo)
data/email_typo.gemspec CHANGED
@@ -25,5 +25,4 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "minitest-utils"
26
26
  spec.add_development_dependency "pry-meta"
27
27
  spec.add_development_dependency "simplecov"
28
- spec.add_development_dependency "codeclimate-test-reporter"
29
28
  end
data/lib/email_typo.rb CHANGED
@@ -16,6 +16,7 @@ require_relative "./email_typo/known_dot_com"
16
16
  require_relative "./email_typo/period_around_at_sign"
17
17
  require_relative "./email_typo/providers"
18
18
  require_relative "./email_typo/remove_invalid_chars"
19
+ require_relative "./email_typo/remove_mailto"
19
20
  require_relative "./email_typo/transposed_periods"
20
21
  require_relative "./email_typo/yahoo"
21
22
 
@@ -26,6 +27,7 @@ module EmailTypo
26
27
  end
27
28
 
28
29
  self.default_processors = [
30
+ RemoveMailTo,
29
31
  RemoveInvalidChars,
30
32
  TransposedPeriods,
31
33
  PeriodAroundAtSign,
@@ -7,7 +7,7 @@ module EmailTypo
7
7
  .gsub(/\.com\.$/, ".com")
8
8
  .gsub(/\.com(?!cast|\.|@).{1,3}$/, ".com")
9
9
  .gsub(/\.co[^op]$/, ".com")
10
- .gsub(/\.c*(c|ci|coi|l|m|n|o|op|cp|0)*m+o*$/, ".com")
11
- .gsub(/\.(c|v|x)o+(m|n)$/, ".com")
10
+ .gsub(/\.c*(c|ck|ci|coi|l|m|n|o|op|cp|0|9)*m+o*$/, ".com")
11
+ .gsub(/\.(c|f|v|x)o+(m|n)$/, ".com")
12
12
  end
13
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module EmailTypo
4
4
  Gmail = lambda do |email|
5
- email.gsub(/@g[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov)/, "@gmail.")
5
+ email.gsub(/@g[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov|edu)/, "@gmail.")
6
6
  end
7
7
  end
@@ -3,6 +3,9 @@
3
3
  module EmailTypo
4
4
  KnownDotCom = lambda do |email|
5
5
  email
6
- .gsub(/@(aol|googlemail|gmail|hotmail|yahoo|icloud|outlook)\.([a-z]+)$/, "@\\1.com")
6
+ .gsub(
7
+ /@(aol|googlemail|gmail|hotmail|yahoo|icloud|outlook)\.([a-z]+)$/,
8
+ "@\\1.com"
9
+ )
7
10
  end
8
11
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EmailTypo
4
+ RemoveMailTo = lambda do |email|
5
+ email.gsub(/\Amailto:/, "")
6
+ end
7
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EmailTypo
2
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1".freeze
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_typo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-15 00:00:00.000000000 Z
11
+ date: 2019-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: codeclimate-test-reporter
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  description: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
98
84
  email:
99
85
  - fnando.vieira@gmail.com
@@ -102,6 +88,7 @@ extensions: []
102
88
  extra_rdoc_files: []
103
89
  files:
104
90
  - ".gitignore"
91
+ - ".rubocop.yml"
105
92
  - ".travis.yml"
106
93
  - CODE_OF_CONDUCT.md
107
94
  - Gemfile
@@ -126,6 +113,7 @@ files:
126
113
  - lib/email_typo/period_around_at_sign.rb
127
114
  - lib/email_typo/providers.rb
128
115
  - lib/email_typo/remove_invalid_chars.rb
116
+ - lib/email_typo/remove_mailto.rb
129
117
  - lib/email_typo/transposed_periods.rb
130
118
  - lib/email_typo/version.rb
131
119
  - lib/email_typo/yahoo.rb
@@ -148,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
136
  - !ruby/object:Gem::Version
149
137
  version: '0'
150
138
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.6.11
139
+ rubygems_version: 3.0.1
153
140
  signing_key:
154
141
  specification_version: 4
155
142
  summary: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').