-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added new bunch of project linters * Added auto deploy to RubyGems * Added auto creating release notes on GitHub * Added lefthook config, removed overcommit * Updated gemspecs * Updated codeclimate/circleci configs * Updated gem development dependencies * Updated gem version, changelog
- Loading branch information
Showing
22 changed files
with
281 additions
and
119 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
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,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'lib/smtp_mock/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = 'smtp_mock' | ||
spec.version = SmtpMock::VERSION | ||
spec.authors = ['Vladislav Trotsenko'] | ||
spec.email = %w[[email protected]] | ||
spec.summary = %(smtp_mock) | ||
spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) | ||
spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock' | ||
spec.license = 'MIT' | ||
|
||
dry_struct_version = ::Gem::Version.new(::RUBY_VERSION) >= ::Gem::Version.new('2.7.0') ? '~> 1.6' : '~> 1.4' | ||
|
||
spec.required_ruby_version = '>= 2.5.0' | ||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.executables = %w[smtp_mock] | ||
spec.require_paths = %w[lib] | ||
|
||
spec.add_runtime_dependency 'dry-struct', dry_struct_version | ||
|
||
spec.add_development_dependency 'ffaker' | ||
spec.add_development_dependency 'rake' | ||
spec.add_development_dependency 'rspec' | ||
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 |
---|---|---|
|
@@ -6,36 +6,24 @@ Gem::Specification.new do |spec| | |
spec.name = 'smtp_mock' | ||
spec.version = SmtpMock::VERSION | ||
spec.authors = ['Vladislav Trotsenko'] | ||
spec.email = ['[email protected]'] | ||
|
||
spec.email = %w[[email protected]] | ||
spec.summary = %(smtp_mock) | ||
spec.description = %(💎 Ruby SMTP mock. Mimic any SMTP server behaviour for your test environment.) | ||
|
||
spec.homepage = 'https://github.com/mocktools/ruby-smtp-mock' | ||
spec.license = 'MIT' | ||
|
||
spec.metadata = { | ||
'homepage_uri' => 'https://github.com/mocktools/ruby-smtp-mock', | ||
'changelog_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/CHANGELOG.md', | ||
'source_code_uri' => 'https://github.com/mocktools/ruby-smtp-mock', | ||
'documentation_uri' => 'https://github.com/mocktools/ruby-smtp-mock/blob/master/README.md', | ||
'bug_tracker_uri' => 'https://github.com/mocktools/ruby-smtp-mock/issues' | ||
} | ||
|
||
spec.required_ruby_version = '>= 2.5.0' | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.executables = %w[smtp_mock] | ||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.executables = %w[smtp_mock] | ||
spec.require_paths = %w[lib] | ||
spec.post_install_message = 'smtpmock is required system dependency. For more details run: `bundle exec smtp_mock -h`' | ||
|
||
spec.add_runtime_dependency 'dry-struct', '~> 1.6' | ||
|
||
spec.add_development_dependency 'bundler-audit', '~> 0.9.1' | ||
spec.add_development_dependency 'fasterer', '~> 0.10.0' | ||
spec.add_development_dependency 'ffaker', '~> 2.21' | ||
spec.add_development_dependency 'mdl', '~> 0.12.0' | ||
spec.add_development_dependency 'net-smtp', '~> 0.3.3' | ||
spec.add_development_dependency 'overcommit', '~> 0.59.1' | ||
spec.add_development_dependency 'pry-byebug', '~> 3.10', '>= 3.10.1' | ||
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' | ||
spec.add_development_dependency 'reek', '~> 6.1', '>= 6.1.1' | ||
|
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,4 @@ | ||
--- | ||
|
||
ignore: | ||
- EXA-MPLE-XXXX |
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,4 @@ | ||
--- | ||
|
||
exclude_paths: | ||
- '.circleci/**/*.rb' |
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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
all | ||
rule 'MD013', line_length: 500 | ||
rule 'MD029', style: :ordered | ||
exclude_rule 'MD007' | ||
exclude_rule 'MD024' |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 200 |
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,63 @@ | ||
# !/bin/sh | ||
set -e | ||
|
||
GH_CLI_RELEASES_URL="https://github.com/cli/cli/releases" | ||
FILE_NAME="gh" | ||
BUILD_ARCHITECTURE="linux_amd64.deb" | ||
DELIMETER="_" | ||
PACKAGE_FILE="$FILE_NAME$DELIMETER$BUILD_ARCHITECTURE" | ||
|
||
gh_cli_latest_release() { | ||
curl -sL -o /dev/null -w %{url_effective} "$GH_CLI_RELEASES_URL/latest" | rev | cut -f1 -d'/'| rev | ||
} | ||
|
||
download_gh_cli() { | ||
test -z "$VERSION" && VERSION="$(gh_cli_latest_release)" | ||
test -z "$VERSION" && { | ||
echo "Unable to get GitHub CLI release." >&2 | ||
exit 1 | ||
} | ||
curl -s -L -o "$PACKAGE_FILE" "$GH_CLI_RELEASES_URL/download/$VERSION/$FILE_NAME$DELIMETER${VERSION:1}$DELIMETER$BUILD_ARCHITECTURE" | ||
} | ||
|
||
install_gh_cli() { | ||
sudo dpkg -i "$PACKAGE_FILE" | ||
rm "$PACKAGE_FILE" | ||
} | ||
|
||
get_release_candidate_version() { | ||
echo $(ruby -r rubygems -e "puts Gem::Specification::load('$(ls *.gemspec)').version") | ||
} | ||
|
||
release_candidate_tag="v$(get_release_candidate_version)" | ||
|
||
is_an_existing_github_release() { | ||
git fetch origin "refs/tags/$release_candidate_tag" >/dev/null 2>&1 | ||
} | ||
|
||
release_to_rubygems() { | ||
echo "Setting RubyGems publisher credentials..." | ||
./.circleci/scripts/set_publisher_credentials.sh | ||
echo "Preparation for release..." | ||
git config --global user.email ${PUBLISHER_EMAIL} | ||
git config --global user.name ${PUBLISHER_NAME} | ||
git stash | ||
git checkout develop | ||
gem install yard gem-ctags | ||
bundle install | ||
echo "Publishing new gem release to RubyGems..." | ||
rake release | ||
} | ||
|
||
release_to_github() { | ||
echo "Downloading and installing latest gh cli..." | ||
download_gh_cli | ||
install_gh_cli | ||
echo "Publishing new release notes to GitHub..." | ||
gh release create "$release_candidate_tag" --generate-notes | ||
} | ||
|
||
if is_an_existing_github_release | ||
then echo "Tag $release_candidate_tag already exists on GitHub. Skipping releasing flow..." | ||
else release_to_rubygems; release_to_github | ||
fi |
Oops, something went wrong.