-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test and publish workflows - Format codebase using StandardRB - Add test cases
- Loading branch information
Showing
15 changed files
with
177 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Publish Packages | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Publish to RubyGems | ||
uses: dawidd6/action-publish-gem@v1 | ||
with: | ||
api_key: ${{secrets.RUBYGEMS_AUTH_TOKEN}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: [ develop, master ] | ||
|
||
env: | ||
GIT_COMMIT_SHA: ${{ github.sha }} | ||
GIT_BRANCH: ${{ github.ref }} | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
name: lint ${{ matrix.ruby }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: [ '2.6.9', '2.7.5', '3.0.3', '3.1.1' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
|
||
- name: StandardRB | ||
continue-on-error: ${{ matrix.experimental }} | ||
run: bundle exec standardrb --parallel --format progress | ||
|
||
test: | ||
needs: [ lint ] | ||
runs-on: ubuntu-latest | ||
name: test ${{ matrix.ruby }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: [ '2.6.9', '2.7.5', '3.0.3', '3.1.1' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
|
||
- name: Test | ||
continue-on-error: ${{ matrix.experimental }} | ||
run: bundle exec rake | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby 3.1.1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in guessmail.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Kerem Bozdas | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
lib = File.expand_path('lib', __dir__) | ||
lib = File.expand_path("lib", __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'guessmail/version' | ||
require "guessmail/version" | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = 'guessmail' | ||
spec.version = Guessmail::VERSION | ||
spec.authors = ['Kerem Bozdas'] | ||
spec.email = ['[email protected]'] | ||
spec.name = "guessmail" | ||
spec.version = Guessmail::VERSION | ||
spec.authors = ["Kerem Bozdas"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = "Find anyone's email address" | ||
spec.description = "Find anyone's email address" | ||
spec.homepage = 'https://github.com/krmbzds/guessmail' | ||
spec.summary = "Find anyone's email address" | ||
spec.description = "Find anyone's email address" | ||
spec.homepage = "https://github.com/krmbzds/guessmail" | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.bindir = 'bin' | ||
spec.executables = ['guessmail'] | ||
spec.require_paths = ['lib'] | ||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.bindir = "bin" | ||
spec.executables = ["guessmail"] | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_runtime_dependency 'tate', '~> 1.6.0' | ||
spec.add_development_dependency 'bundler' | ||
spec.add_development_dependency 'rake' | ||
spec.add_development_dependency 'rspec' | ||
spec.add_runtime_dependency "tate", "~> 1.7.0" | ||
spec.add_development_dependency "bundler" | ||
spec.add_development_dependency "rake" | ||
spec.add_development_dependency "rspec" | ||
spec.add_development_dependency "standardrb" | ||
spec.add_development_dependency "coveralls_reborn" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Guessmail | ||
VERSION = '0.2.0' | ||
VERSION = "0.2.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
require "spec_helper" | ||
|
||
describe Guessmail do | ||
it 'has a version number' do | ||
it "has a version number" do | ||
expect(Guessmail::VERSION).not_to be nil | ||
end | ||
|
||
it "returns guesses" do | ||
guess = Guessmail.guess(["F", "L", "D"], {extended: false}) | ||
expected = "f@d\nl@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\n" | ||
expect(guess).to eq expected | ||
end | ||
|
||
it "returns extended guesses" do | ||
guess = Guessmail.guess(["F", "L", "D"], {extended: true}) | ||
expected = "f@d\nl@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nf-l@d\nf-l@d\nf-l@d\nf-l@d\nl-f@d\nl-f@d\nl-f@d\nl-f@d\nf_l@d\nf_l@d\nf_l@d\nf_l@d\nl_f@d\nl_f@d\nl_f@d\nl_f@d\n" | ||
expect(guess).to eq expected | ||
end | ||
|
||
it "returns guesses with middle name" do | ||
guess = Guessmail.guess(["F", "M", "L", "D"], {extended: false}) | ||
expected = "f@d\nl@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nfml@d\nfm.l@d\nfml@d\nf.m.l@d\nfml@d\nf.m.l@d\nm@d\n" | ||
expect(guess).to eq expected | ||
end | ||
|
||
it "returns extended guesses with middle name" do | ||
guess = Guessmail.guess(["F", "M", "L", "D"], {extended: true}) | ||
expected = "f@d\nl@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nfl@d\nf.l@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nlf@d\nl.f@d\nfml@d\nfm.l@d\nfml@d\nf.m.l@d\nfml@d\nf.m.l@d\nf-l@d\nf-l@d\nf-l@d\nf-l@d\nl-f@d\nl-f@d\nl-f@d\nl-f@d\nfm-l@d\nf-m-l@d\nf-m-l@d\nf_l@d\nf_l@d\nf_l@d\nf_l@d\nl_f@d\nl_f@d\nl_f@d\nl_f@d\nfm_l@d\nf_m_l@d\nf_m_l@d\nm@d\n" | ||
expect(guess).to eq expected | ||
end | ||
|
||
it "returns guesses for custom language" do | ||
guess = Guessmail.guess(["Ö", "Ü", "D"], {extended: false, language: "de"}) | ||
expected = "oe@d\nue@d\noeue@d\noe.ue@d\noeue@d\noe.ue@d\noeue@d\noe.ue@d\noeue@d\noe.ue@d\nueoe@d\nue.oe@d\nueoe@d\nue.oe@d\nueoe@d\nue.oe@d\nueoe@d\nue.oe@d\n" | ||
expect(guess).to eq expected | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.unshift File.expand_path('../lib', __dir__) | ||
require 'guessmail' | ||
require "coveralls" | ||
Coveralls.wear! | ||
|
||
$LOAD_PATH.unshift File.expand_path("../lib", __dir__) | ||
require "guessmail" |