email_typo 0.2.0 → 0.2.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
2
  SHA256:
3
- metadata.gz: 003afe832444fb5fef539a76eaf15aa14b61527314d317e8e58b3f4d3b455d57
4
- data.tar.gz: 6afc7f99e881f60184ee6800af1b6e40e8504bdbec58a08dd2ee34a7a0ecc39e
3
+ metadata.gz: 68d6856a8e16bd5bc126d50a00585d871314555a8d85777c4cdb44a59094e8d2
4
+ data.tar.gz: c7abbee0b56a9c8d4be377fcc79e7ac6bdda076f47f7889a42cce4058d462a3e
5
5
  SHA512:
6
- metadata.gz: f25cd3d6f99c666f44aab3e4a5df551f5d6d27e30420175d1b0511c11f867c1c9d4c9cadb06c034f6e38693490460a8e4a830c1771d0ef1b304385510edb360e
7
- data.tar.gz: 666957586c33bbed0fc7176eb501440a968542cf0d776956f81299687fad743aa933a2329d723d143482e411a814de0ceaaae157775613e95206cd7848f60274
6
+ metadata.gz: b5d9042dcf309fbd0869d8aac0fc582c96ab9490324ec5649940845f7dd35277b197517be4179b9ac9d9c57bb2142f7c4c64c387e4720051de1cb52b31556ad2
7
+ data.tar.gz: 49d5c382ebcf868de054d56d75ae7b19a30780d252d46f34bf82a7da439f3c420fd3d94f7b6da350121fae12090f53b90149c059370763cc1f87ad4b86aabcba
@@ -0,0 +1,3 @@
1
+ ---
2
+ github: [fnando]
3
+ custom: ["https://www.paypal.me/nandovieira/🍕"]
@@ -4,3 +4,6 @@ inherit_gem:
4
4
 
5
5
  AllCops:
6
6
  TargetRubyVersion: 2.7
7
+ Exclude:
8
+ - vendor/**/*
9
+ - gemfiles/**/*
data/README.md CHANGED
@@ -2,17 +2,23 @@
2
2
 
3
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
- [![Test Coverage](https://codeclimate.com/github/fnando/email_typo/badges/coverage.svg)](https://codeclimate.com/github/fnando/email_typo/coverage)
6
5
  [![Gem](https://img.shields.io/gem/v/email_typo.svg)](https://rubygems.org/gems/email_typo)
7
6
  [![Gem](https://img.shields.io/gem/dt/email_typo.svg)](https://rubygems.org/gems/email_typo)
8
7
 
9
- EmailTypo is a Ruby gem that gives you an easy, tested method that fixes email typos.
8
+ EmailTypo is a Ruby gem that gives you an easy, tested method that fixes email
9
+ typos.
10
10
 
11
- As an example: A user with the email "joe@gmail.com" accidentally enters in "joe@gmal.cmo", EmailTypo will fix it automatically.
11
+ As an example: A user with the email "joe@gmail.com" accidentally enters in
12
+ "joe@gmal.cmo", EmailTypo will fix it automatically.
12
13
 
13
- EmailTypo is concerned with incorrectly-entered data (email provider names, TLDs), not with evaluating whether a particular domain is valid, or whether a particular email address is legitimate. (That is, it's focused on fixing the part that comes after the "@" in the email address.) It works really well for helping you — and your users — when they accidentally type something in wrong.
14
+ EmailTypo is concerned with incorrectly-entered data (email provider names,
15
+ TLDs), not with evaluating whether a particular domain is valid, or whether a
16
+ particular email address is legitimate. (That is, it's focused on fixing the
17
+ part that comes after the "@" in the email address.) It works really well for
18
+ helping you — and your users — when they accidentally type something in wrong.
14
19
 
15
- **NOTE**: This is based on https://github.com/charliepark/fat_fingers, but without polluting the `String` class and with easier extension support.
20
+ **NOTE**: This is based on https://github.com/charliepark/fat_fingers, but
21
+ without polluting the `String` class and with easier extension support.
16
22
 
17
23
  ## Installation
18
24
 
@@ -39,7 +45,9 @@ EmailTypo.call("john.doe@gmail.co")
39
45
  #=> "john.doe@gmail.com"
40
46
  ```
41
47
 
42
- To add/change the processors, add any object that responds to `#call(email)` to `EmailTypo.default_processors`. The following example adds a processor for `.uol.com.br`, a Brazilian email provider:
48
+ To add/change the processors, add any object that responds to `#call(email)` to
49
+ `EmailTypo.default_processors`. The following example adds a processor for
50
+ `.uol.com.br`, a Brazilian email provider:
43
51
 
44
52
  ```ruby
45
53
  EmailTypo.default_processors << lambda do |email|
@@ -49,14 +57,24 @@ end
49
57
 
50
58
  ## Development
51
59
 
52
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
60
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
61
+ `rake test` to run the tests. You can also run `bin/console` for an interactive
62
+ prompt that will allow you to experiment.
53
63
 
54
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
+ To install this gem onto your local machine, run `bundle exec rake install`. To
65
+ release a new version, update the version number in `version.rb`, and then run
66
+ `bundle exec rake release`, which will create a git tag for the version, push
67
+ git commits and tags, and push the `.gem` file to
68
+ [rubygems.org](https://rubygems.org).
55
69
 
56
70
  ## Contributing
57
71
 
58
- Bug reports and pull requests are welcome on GitHub at https://github.com/fnando/email_typo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
72
+ Bug reports and pull requests are welcome on GitHub at
73
+ https://github.com/fnando/email_typo. This project is intended to be a safe,
74
+ welcoming space for collaboration, and contributors are expected to adhere to
75
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
59
76
 
60
77
  ## License
61
78
 
62
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
79
+ The gem is available as open source under the terms of the
80
+ [MIT License](http://opensource.org/licenses/MIT).
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
7
7
  spec.version = EmailTypo::VERSION
8
8
  spec.authors = ["Nando Vieira"]
9
9
  spec.email = ["fnando.vieira@gmail.com"]
10
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
10
11
 
11
- spec.summary = %w[
12
- Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
13
- ].join(" ")
12
+ spec.summary = "Clean up e-mail strings when the user's made a typo " \
13
+ "(like 'gmail.cmo')."
14
14
  spec.description = spec.summary
15
15
  spec.homepage = "https://github.com/fnando/email_typo"
16
16
  spec.license = "MIT"
@@ -0,0 +1 @@
1
+ 3b87d86575161d0f7b2b0d327c98b549db726096
@@ -2,6 +2,6 @@
2
2
 
3
3
  module EmailTypo
4
4
  AddMissingPeriod = lambda do |email|
5
- email.gsub(/([^\.])(com|org|net)$/, "\\1.\\2")
5
+ email.gsub(/([^.])(com|org|net)$/, "\\1.\\2")
6
6
  end
7
7
  end
@@ -5,5 +5,6 @@ module EmailTypo
5
5
  email
6
6
  .gsub(/\.(o\.uk|couk|co\.um)$/, ".co.uk")
7
7
  .gsub(/\.(cojp|co\.lp)$/, ".co.jp")
8
+ .gsub(/\.(com?br|co\.br)$/, ".com.br")
8
9
  end
9
10
  end
@@ -2,6 +2,9 @@
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|edu)/, "@gmail.")
5
+ email.gsub(
6
+ /@ga?e?i?o?r?g?[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov|edu)/,
7
+ "@gmail."
8
+ )
6
9
  end
7
10
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module EmailTypo
4
4
  Hotmail = lambda do |email|
5
- email.gsub(/@h(i|o|p)?y?t?o?a?m?n?t?[aikl]{1,3}l?\./, "@hotmail.")
5
+ email.gsub(/@h(i|o|p)?y?t?o?a?r?m?n?t?m?[aikl]{1,3}l?\./, "@hotmail.")
6
6
  end
7
7
  end
@@ -4,7 +4,7 @@ module EmailTypo
4
4
  KnownDotCom = lambda do |email|
5
5
  email
6
6
  .gsub(
7
- /@(aol|googlemail|gmail|hotmail|yahoo|icloud|outlook)\.([a-z]+)$/,
7
+ /@(aol|googlemail|gmail|hotmail|yahoo|icloud|outlook)\.(co|net|org)$/,
8
8
  "@\\1.com"
9
9
  )
10
10
  end
@@ -3,8 +3,8 @@
3
3
  module EmailTypo
4
4
  RemoveInvalidChars = lambda do |email|
5
5
  email
6
- .gsub(/(\s|\#|\'|\"|\\)*/, "")
7
- .gsub(/(\,|\.\.)/, ".")
6
+ .gsub(/(\s|\#|'|"|\\)*/, "")
7
+ .gsub(/(,|\.\.)/, ".")
8
8
  .gsub("@@", "@")
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EmailTypo
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-19 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,6 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/FUNDING.yml"
118
119
  - ".gitignore"
119
120
  - ".rubocop.yml"
120
121
  - ".travis.yml"
@@ -126,6 +127,7 @@ files:
126
127
  - bin/console
127
128
  - bin/setup
128
129
  - email_typo.gemspec
130
+ - fat_finger_last_commit
129
131
  - lib/email_typo.rb
130
132
  - lib/email_typo/add_missing_m.rb
131
133
  - lib/email_typo/add_missing_period.rb
@@ -151,7 +153,7 @@ homepage: https://github.com/fnando/email_typo
151
153
  licenses:
152
154
  - MIT
153
155
  metadata: {}
154
- post_install_message:
156
+ post_install_message:
155
157
  rdoc_options: []
156
158
  require_paths:
157
159
  - lib
@@ -159,7 +161,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
161
  requirements:
160
162
  - - ">="
161
163
  - !ruby/object:Gem::Version
162
- version: '0'
164
+ version: 2.3.0
163
165
  required_rubygems_version: !ruby/object:Gem::Requirement
164
166
  requirements:
165
167
  - - ">="
@@ -167,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
169
  version: '0'
168
170
  requirements: []
169
171
  rubygems_version: 3.1.2
170
- signing_key:
172
+ signing_key:
171
173
  specification_version: 4
172
174
  summary: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
173
175
  test_files: []