email_typo 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7af77ce6834bcf79d5e52edd538a7c40ade7d33d0a664c27e6e56ee175421f8c
4
- data.tar.gz: beab6f40f8e612064e843cd54c1ce0d9eb20cd68417729bd4e7977506a045bd0
3
+ metadata.gz: efa2ec563a56461dcd879a22a93f23db4153e552da434ab958a2756b9a6bd366
4
+ data.tar.gz: f433a26872669bd05c154e21bb6f4de2d98e438ad133d098d8edafee2dc33217
5
5
  SHA512:
6
- metadata.gz: b7bd414559f8b4adbef3f637782d0ba5601072984a553434352f6408f8192ce03a4f5cffdd42700177d74f89c86387d9ddc2e2dd477f6975829551f56582e919
7
- data.tar.gz: b0c8c59abf06b3d25f45ceba5d703d9286a29c7c4ec6bf4a12374c71b939003017eb090d8c48e3fdb46d8264d7815c67ced55f3a0b14ae14d5df9569bc04eebc
6
+ metadata.gz: e277ece3460063a25bc27a0c561f06cc9fc3d917afb10579e855ef4874db775c58ce43bc010ddaa433766fe1bcd277f728e9c003170fa534c17105b8c27ffc1d
7
+ data.tar.gz: 06a00156afe49f489c65bcb67a69babe652ba432f41465641138cbb4b7fe9e23af384a918543080d1884420263d18fa3a46b22cc419ad541e036502bbb3c5b68
@@ -1,3 +1,4 @@
1
- ---
1
+ # These are supported funding model platforms
2
+
2
3
  github: [fnando]
3
- custom: ["https://www.paypal.me/nandovieira/🍕"]
4
+ custom: ["https://paypal.me/nandovieira/🍕"]
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: "🐛 Bug Report"
3
+ about: Report a reproducible bug or regression.
4
+ title: 'Bug: '
5
+ labels: 'Status: Unconfirmed'
6
+
7
+ ---
8
+
9
+ <!--
10
+ - Please provide a clear and concise description of what the bug is.
11
+ - If possible, add an example reproducing your issue.
12
+ - Please test using the latest version of email_typo
13
+ to make sure your issue has not already been fixed.
14
+ -->
15
+
16
+ ## Description
17
+
18
+ [Add bug description here]
19
+
20
+ ## How to reproduce
21
+
22
+ [Add steps on how to reproduce this issue]
23
+
24
+ ## What do you expect
25
+
26
+ [Describe what do you expect to happen]
27
+
28
+ ## What happened instead
29
+
30
+ [Describe the actual results]
31
+
32
+ ## Software:
33
+
34
+ - Gem version: [Add gem version here]
35
+ - Ruby version: [Add version here]
36
+
37
+ ## Full backtrace
38
+
39
+ ```text
40
+ [Paste full backtrace here]
41
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: "💡 Feature request"
3
+ about: Have an idea that may be useful? Make a suggestion!
4
+ title: 'Feature Request: '
5
+ labels: 'Feature request'
6
+
7
+ ---
8
+
9
+ ## Description
10
+
11
+ _A clear and concise description of what the problem is._
12
+
13
+ ## Describe the solution
14
+
15
+ _A clear and concise description of what you want to happen._
16
+
17
+ ## Alternatives you considered
18
+
19
+ _A clear and concise description of any alternative solutions or features you've considered._
20
+
21
+ ## Additional context
22
+
23
+ _Add any other context, screenshots, links, etc about the feature request here._
@@ -0,0 +1,38 @@
1
+ <!--
2
+ If you're making a doc PR or something tiny where the below is irrelevant,
3
+ delete this template and use a short description, but in your description aim to
4
+ include both what the change is, and why it is being made, with enough context
5
+ for anyone to understand.
6
+ -->
7
+
8
+ <details>
9
+ <summary>PR Checklist</summary>
10
+
11
+ ### PR Structure
12
+
13
+ - [ ] This PR has reasonably narrow scope (if not, break it down into smaller
14
+ PRs).
15
+ - [ ] This PR avoids mixing refactoring changes with feature changes (split into
16
+ two PRs otherwise).
17
+ - [ ] This PR's title starts is concise and descriptive.
18
+
19
+ ### Thoroughness
20
+
21
+ - [ ] This PR adds tests for the most critical parts of the new functionality or
22
+ fixes.
23
+ - [ ] I've updated any docs, `.md` files, etc… affected by this change.
24
+
25
+ </details>
26
+
27
+ ### What
28
+
29
+ [TODO: Short statement about what is changing.]
30
+
31
+ ### Why
32
+
33
+ [TODO: Why this change is being made. Include any context required to understand
34
+ the why.]
35
+
36
+ ### Known limitations
37
+
38
+ [TODO or N/A]
@@ -0,0 +1,15 @@
1
+ ---
2
+ # Documentation:
3
+ # https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
4
+
5
+ version: 2
6
+ updates:
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
11
+
12
+ - package-ecosystem: "bundler"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "daily"
@@ -0,0 +1,55 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ schedule:
12
+ - cron: "0 10 * * *"
13
+
14
+ jobs:
15
+ build:
16
+ name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }}
17
+ runs-on: "ubuntu-latest"
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby: [2.6.x, 2.7.x]
22
+ gemfile:
23
+ - Gemfile
24
+
25
+ steps:
26
+ - uses: actions/checkout@v1
27
+
28
+ - uses: actions/cache@v2
29
+ with:
30
+ path: vendor/bundle
31
+ key: >
32
+ ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles(matrix.gemfile) }}
33
+ restore-keys: >
34
+ ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles(matrix.gemfile) }}
35
+
36
+ - name: Set up Ruby
37
+ uses: actions/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }}
40
+
41
+ - name: Install gem dependencies
42
+ env:
43
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
44
+ run: |
45
+ gem install bundler
46
+ bundle config path vendor/bundle
47
+ bundle update --jobs 4 --retry 3
48
+
49
+ - name: Run Tests
50
+ env:
51
+ PGHOST: localhost
52
+ PGUSER: postgres
53
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
54
+ run: |
55
+ bundle exec rake
@@ -3,7 +3,5 @@ inherit_gem:
3
3
  rubocop-fnando: .rubocop.yml
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.7
7
- Exclude:
8
- - vendor/**/*
9
- - gemfiles/**/*
6
+ TargetRubyVersion: 2.6
7
+ NewCops: enable
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ <!--
4
+ Prefix your message with one of the following:
5
+
6
+ - [Added] for new features.
7
+ - [Changed] for changes in existing functionality.
8
+ - [Deprecated] for soon-to-be removed features.
9
+ - [Removed] for now removed features.
10
+ - [Fixed] for any bug fixes.
11
+ - [Security] in case of vulnerabilities.
12
+ -->
13
+
14
+ ## Unreleased
15
+
16
+ - Initial release.
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at fnando.vieira@gmail.com. All
58
+ reported by contacting the project team at me@fnando.com. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -68,7 +68,7 @@ members of the project's leadership.
68
68
  ## Attribution
69
69
 
70
70
  This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
72
 
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
@@ -0,0 +1,79 @@
1
+ # Contributing to email_typo
2
+
3
+ 👍🎉 First off, thanks for taking the time to contribute! 🎉👍
4
+
5
+ The following is a set of guidelines for contributing to this project. These are
6
+ mostly guidelines, not rules. Use your best judgment, and feel free to propose
7
+ changes to this document in a pull request.
8
+
9
+ ## Code of Conduct
10
+
11
+ Everyone interacting in this project's codebases, issue trackers, chat rooms and
12
+ mailing lists is expected to follow the [code of conduct](https://github.com/fnando/email_typo/blob/main/CODE_OF_CONDUCT.md).
13
+
14
+ ## Reporting bugs
15
+
16
+ This section guides you through submitting a bug report. Following these
17
+ guidelines helps maintainers and the community understand your report, reproduce
18
+ the behavior, and find related reports.
19
+
20
+ - Before creating bug reports, please check the open issues; somebody may
21
+ already have submitted something similar, and you may not need to create a new
22
+ one.
23
+ - When you are creating a bug report, please include as many details as
24
+ possible, with an example reproducing the issue.
25
+
26
+ ## Contributing with code
27
+
28
+ Before making any radicals changes, please make sure you discuss your intention
29
+ by [opening an issue on Github](https://github.com/fnando/email_typo/issues).
30
+
31
+ When you're ready to make your pull request, follow checklist below to make sure
32
+ your contribution is according to how this project works.
33
+
34
+ 1. [Fork](https://help.github.com/forking/) email_typo
35
+ 2. Create a topic branch - `git checkout -b my_branch`
36
+ 3. Make your changes using [descriptive commit messages](#commit-messages)
37
+ 4. Update CHANGELOG.md describing your changes by adding an entry to the
38
+ "Unreleased" section. If this section is not available, create one right
39
+ before the last version.
40
+ 5. Push to your branch - `git push origin my_branch`
41
+ 6. [Create a pull request](https://docs.github.com/articles/creating-a-pull-request)
42
+ 7. That's it!
43
+
44
+ ## Styleguides
45
+
46
+ ### Commit messages
47
+
48
+ - Use the present tense ("Add feature" not "Added feature")
49
+ - Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
50
+ - Limit the first line to 72 characters or less
51
+ - Reference issues and pull requests liberally after the first line
52
+
53
+ ### Changelog
54
+
55
+ - Add a message describing your changes to the "Unreleased" section. The
56
+ changelog message should follow the same style as the commit message.
57
+ - Prefix your message with one of the following:
58
+ - `[Added]` for new features.
59
+ - `[Changed]` for changes in existing functionality.
60
+ - `[Deprecated]` for soon-to-be removed features.
61
+ - `[Removed]` for now removed features.
62
+ - `[Fixed]` for any bug fixes.
63
+ - `[Security]` in case of vulnerabilities.
64
+
65
+ ### Ruby code
66
+
67
+ - This project uses [Rubocop](https://rubocop.org) to enforce code style. Before
68
+ submitting your changes, make sure your tests are passing and code conforms to
69
+ the expected style by running `rake`.
70
+ - Do not change the library version. This will be done by the maintainer
71
+ whenever a new version is about to be released.
72
+
73
+ ### JavaScript code
74
+
75
+ - This project uses [ESLint](https://eslint.org) to enforce code style. Before
76
+ submitting your changes, make sure your tests are passing and code conforms to
77
+ the expected style by running `yarn test:ci`.
78
+ - Do not change the library version. This will be done by the maintainer
79
+ whenever a new version is about to be released.
data/Gemfile CHANGED
@@ -2,5 +2,4 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in email_typo.gemspec
6
5
  gemspec
@@ -0,0 +1,20 @@
1
+ # The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Nando Vieira
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # EmailTypo
1
+ # email_typo
2
2
 
3
- [![Travis-CI](https://travis-ci.org/fnando/email_typo.svg)](https://travis-ci.org/fnando/email_typo)
3
+ [![Tests](https://github.com/fnando/email_typo/workflows/Tests/badge.svg)](https://github.com/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
  [![Gem](https://img.shields.io/gem/v/email_typo.svg)](https://rubygems.org/gems/email_typo)
6
6
  [![Gem](https://img.shields.io/gem/dt/email_typo.svg)](https://rubygems.org/gems/email_typo)
@@ -22,20 +22,16 @@ without polluting the `String` class and with easier extension support.
22
22
 
23
23
  ## Installation
24
24
 
25
- Add this line to your application's Gemfile:
25
+ ```bash
26
+ gem install email_typo
27
+ ```
28
+
29
+ Or add the following line to your project's Gemfile:
26
30
 
27
31
  ```ruby
28
32
  gem "email_typo"
29
33
  ```
30
34
 
31
- And then execute:
32
-
33
- $ bundle
34
-
35
- Or install it yourself as:
36
-
37
- $ gem install email_typo
38
-
39
35
  ## Usage
40
36
 
41
37
  To fix any typos, just use `EmailTypo.call(email)`.
@@ -55,26 +51,27 @@ EmailTypo.default_processors << lambda do |email|
55
51
  end
56
52
  ```
57
53
 
58
- ## Development
54
+ ## Maintainer
55
+
56
+ - [Nando Vieira](https://github.com/fnando)
59
57
 
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.
58
+ ## Contributors
63
59
 
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).
60
+ - https://github.com/fnando/email_typo/contributors
69
61
 
70
62
  ## Contributing
71
63
 
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.
64
+ For more details about how to contribute, please read
65
+ https://github.com/fnando/email_typo/blob/main/CONTRIBUTING.md.
76
66
 
77
67
  ## License
78
68
 
79
69
  The gem is available as open source under the terms of the
80
- [MIT License](http://opensource.org/licenses/MIT).
70
+ [MIT License](https://opensource.org/licenses/MIT). A copy of the license can be
71
+ found at https://github.com/fnando/email_typo/blob/main/LICENSE.md.
72
+
73
+ ## Code of Conduct
74
+
75
+ Everyone interacting in the email_typo project's codebases, issue trackers, chat
76
+ rooms and mailing lists is expected to follow the
77
+ [code of conduct](https://github.com/fnando/email_typo/blob/main/CODE_OF_CONDUCT.md).
@@ -7,9 +7,10 @@ require "email_typo"
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
9
9
 
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start(__FILE__)
10
+ begin
11
+ require "pry"
12
+ Pry.start
13
+ rescue LoadError
14
+ require "irb"
15
+ IRB.start(__FILE__)
16
+ end
data/bin/setup CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
+
2
3
  set -euo pipefail
4
+
3
5
  IFS=$'\n\t'
4
6
  set -vx
5
7
 
@@ -1,28 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "./lib/email_typo/version"
3
+ require_relative "./lib/email_typo/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "email_typo"
7
- spec.version = EmailTypo::VERSION
8
- spec.authors = ["Nando Vieira"]
9
- spec.email = ["fnando.vieira@gmail.com"]
10
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
-
12
- spec.summary = "Clean up e-mail strings when the user's made a typo " \
13
- "(like 'gmail.cmo')."
14
- spec.description = spec.summary
15
- spec.homepage = "https://github.com/fnando/email_typo"
16
- spec.license = "MIT"
17
-
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
- f.match(%r{^(test|spec|features)/})
6
+ spec.name = "email_typo"
7
+ spec.version = EmailTypo::VERSION
8
+ spec.authors = ["Nando Vieira"]
9
+ spec.email = ["me@fnando.com"]
10
+
11
+ spec.summary = "Suggest fixes to a misspelled email address, like " \
12
+ "john@gmail.cmo."
13
+ spec.description = spec.summary
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
16
+
17
+ github_url = "https://github.com/fnando/email_typo"
18
+ github_tree_url = "#{github_url}/tree/v#{spec.version}"
19
+
20
+ spec.homepage = github_url
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["bug_tracker_uri"] = "#{github_url}/issues"
23
+ spec.metadata["source_code_uri"] = github_tree_url
24
+ spec.metadata["changelog_uri"] = "#{github_tree_url}/CHANGELOG.md"
25
+ spec.metadata["documentation_uri"] = "#{github_tree_url}/README.md"
26
+ spec.metadata["license_uri"] = "#{github_tree_url}/LICENSE.md"
27
+
28
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
29
+ `git ls-files -z`
30
+ .split("\x0")
31
+ .reject {|f| f.match(%r{^(test|spec|features)/}) }
20
32
  end
33
+
21
34
  spec.bindir = "exe"
22
35
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
23
36
  spec.require_paths = ["lib"]
24
37
 
25
- spec.add_development_dependency "bundler"
38
+ spec.add_development_dependency "email_data"
39
+ spec.add_development_dependency "minitest"
26
40
  spec.add_development_dependency "minitest-utils"
27
41
  spec.add_development_dependency "pry-meta"
28
42
  spec.add_development_dependency "rake"
@@ -0,0 +1 @@
1
+ 40ccae7c07c87212f1397f92a6f0224373130260
@@ -10,6 +10,7 @@ require_relative "./email_typo/dot_com"
10
10
  require_relative "./email_typo/dot_net"
11
11
  require_relative "./email_typo/dot_org"
12
12
  require_relative "./email_typo/fix_extraneous_letter_dot_com"
13
+ require_relative "./email_typo/fix_extraneous_numbers"
13
14
  require_relative "./email_typo/gmail"
14
15
  require_relative "./email_typo/googlemail"
15
16
  require_relative "./email_typo/hotmail"
@@ -35,6 +36,7 @@ module EmailTypo
35
36
  PeriodAroundAtSign,
36
37
  DifferentTlds,
37
38
  FixExtraneousLetterDotCom,
39
+ FixExtraneousNumbers,
38
40
  AddMissingM,
39
41
  AddMissingPeriod,
40
42
  Providers,
@@ -3,8 +3,20 @@
3
3
  module EmailTypo
4
4
  DifferentTlds = lambda do |email|
5
5
  email
6
- .gsub(/\.(o\.uk|couk|co\.um)$/, ".co.uk")
7
- .gsub(/\.(cojp|co\.lp)$/, ".co.jp")
8
- .gsub(/\.(com?br|co\.br)$/, ".com.br")
6
+ .gsub(/\.(o\.uk|co\.k|couk|co\.u[kmnlj]{0,2})$/, ".co.uk")
7
+ .gsub(/\.(cojp|co\.lp|co\.p)$/, ".co.jp")
8
+ .gsub(/\.(com?br|com?\.[bv]r+)$/, ".com.br")
9
+ .gsub(/\.(r+(u+(?!n).|y)|r)$/, ".ru")
10
+ .gsub(/\.i+t+$/, ".it")
11
+ .gsub(/\.f+[re]+$/, ".fr")
12
+ .gsub(/\.de+(?!v).$/, ".de")
13
+ .gsub(/\.jn$/, ".in")
14
+ .gsub(/\.lde$/, ".de")
15
+ .gsub(/\.oprg$/, ".org")
16
+ .gsub(/\.gob(\b|\.)/, ".gov")
17
+ .gsub(/\.edi?(\b|\.)/, ".edu")
18
+ .gsub(/\.mx.{1,2}$/, ".mx")
19
+ .gsub(/\.[com.]{2,3}ar$/, ".com.ar")
20
+ .gsub(/\.[com.]{2,3}au$/, ".com.au")
9
21
  end
10
22
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module EmailTypo
4
4
  DotNet = lambda do |email|
5
- email.gsub(/\.(nte*|n*et*)$/, ".net")
5
+ email
6
+ .gsub(/\.(nte*|n*et*|ney)$/, ".net")
7
+ .gsub(/\.met$/, ".net")
6
8
  end
7
9
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EmailTypo
4
+ FixExtraneousNumbers = lambda do |email|
5
+ email.gsub(/\.?\d+$/, "")
6
+ end
7
+ end
@@ -2,9 +2,11 @@
2
2
 
3
3
  module EmailTypo
4
4
  Gmail = lambda do |email|
5
- email.gsub(
6
- /@ga?e?i?o?r?g?[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov|edu|ac\.in)/,
7
- "@gmail."
8
- )
5
+ email
6
+ .gsub(
7
+ /@ga?e?i?o?r?g?[nm]{0,2}s?[ail]{1,2}[aiklmou]{0,3}\.(?!gov|edu|ac\.in)/,
8
+ "@gmail."
9
+ )
10
+ .gsub(/@gmail\.(com\.\w+|c)$/, "@gmail.com")
9
11
  end
10
12
  end
@@ -2,6 +2,12 @@
2
2
 
3
3
  module EmailTypo
4
4
  Hotmail = lambda do |email|
5
- email.gsub(/@h(i|o|p)?y?t?o?a?r?m?n?t?m?[aikl]{1,3}l?\./, "@hotmail.")
5
+ email
6
+ .gsub(
7
+ /@h((?!anmail)(i|o|p)?y?t?o?a?r?m?n?t?m?[aikl]{1,3}l?)\./,
8
+ "@hotmail."
9
+ )
10
+ .gsub(/@otmail\.com/, "@hotmail.com")
11
+ .gsub(/@hotmail.com[a-z]+/, "@hotmail.com")
6
12
  end
7
13
  end
@@ -3,8 +3,10 @@
3
3
  module EmailTypo
4
4
  RemoveInvalidChars = lambda do |email|
5
5
  email
6
- .gsub(/(\s|\#|'|"|\\)*/, "")
6
+ .gsub(/(\s|[#`'"\\|])*/, "")
7
+ .gsub(%r{/}, ".")
7
8
  .gsub(/(,|\.\.)/, ".")
9
+ .gsub("!", "1")
8
10
  .gsub("@@", "@")
9
11
  end
10
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EmailTypo
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,17 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_typo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-01 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: email_data
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
@@ -108,26 +122,33 @@ dependencies:
108
122
  - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
- description: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
125
+ description: Suggest fixes to a misspelled email address, like john@gmail.cmo.
112
126
  email:
113
- - fnando.vieira@gmail.com
127
+ - me@fnando.com
114
128
  executables: []
115
129
  extensions: []
116
130
  extra_rdoc_files: []
117
131
  files:
118
132
  - ".github/FUNDING.yml"
133
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
134
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
135
+ - ".github/PULL_REQUEST_TEMPLATE.md"
136
+ - ".github/dependabot.yml"
137
+ - ".github/workflows/tests.yml"
119
138
  - ".gitignore"
120
139
  - ".rubocop.yml"
121
140
  - ".travis.yml"
141
+ - CHANGELOG.md
122
142
  - CODE_OF_CONDUCT.md
143
+ - CONTRIBUTING.md
123
144
  - Gemfile
124
- - LICENSE.txt
145
+ - LICENSE.md
125
146
  - README.md
126
147
  - Rakefile
127
148
  - bin/console
128
149
  - bin/setup
129
150
  - email_typo.gemspec
130
- - fat_finger_last_commit
151
+ - fat_fingers_last_commit
131
152
  - lib/email_typo.rb
132
153
  - lib/email_typo/add_missing_m.rb
133
154
  - lib/email_typo/add_missing_period.rb
@@ -137,6 +158,7 @@ files:
137
158
  - lib/email_typo/dot_net.rb
138
159
  - lib/email_typo/dot_org.rb
139
160
  - lib/email_typo/fix_extraneous_letter_dot_com.rb
161
+ - lib/email_typo/fix_extraneous_numbers.rb
140
162
  - lib/email_typo/gmail.rb
141
163
  - lib/email_typo/googlemail.rb
142
164
  - lib/email_typo/hotmail.rb
@@ -152,7 +174,13 @@ files:
152
174
  homepage: https://github.com/fnando/email_typo
153
175
  licenses:
154
176
  - MIT
155
- metadata: {}
177
+ metadata:
178
+ homepage_uri: https://github.com/fnando/email_typo
179
+ bug_tracker_uri: https://github.com/fnando/email_typo/issues
180
+ source_code_uri: https://github.com/fnando/email_typo/tree/v0.2.3
181
+ changelog_uri: https://github.com/fnando/email_typo/tree/v0.2.3/CHANGELOG.md
182
+ documentation_uri: https://github.com/fnando/email_typo/tree/v0.2.3/README.md
183
+ license_uri: https://github.com/fnando/email_typo/tree/v0.2.3/LICENSE.md
156
184
  post_install_message:
157
185
  rdoc_options: []
158
186
  require_paths:
@@ -161,15 +189,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
189
  requirements:
162
190
  - - ">="
163
191
  - !ruby/object:Gem::Version
164
- version: 2.3.0
192
+ version: 2.6.0
165
193
  required_rubygems_version: !ruby/object:Gem::Requirement
166
194
  requirements:
167
195
  - - ">="
168
196
  - !ruby/object:Gem::Version
169
197
  version: '0'
170
198
  requirements: []
171
- rubygems_version: 3.1.2
199
+ rubygems_version: 3.1.4
172
200
  signing_key:
173
201
  specification_version: 4
174
- summary: Clean up e-mail strings when the user's made a typo (like 'gmail.cmo').
202
+ summary: Suggest fixes to a misspelled email address, like john@gmail.cmo.
175
203
  test_files: []
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Nando Vieira
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1 +0,0 @@
1
- 3b87d86575161d0f7b2b0d327c98b549db726096