Skip to content

Commit

Permalink
Technical/Update gemspecs (#38)
Browse files Browse the repository at this point in the history
* Development environment guide
* Updated gemspecs
* Updated codeclimate/circleci configs
* Updated gem development dependencies
* Updated gem version, changelog
  • Loading branch information
bestwebua committed Mar 10, 2022
1 parent fcedda2 commit d01b29e
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 27 deletions.
12 changes: 10 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ references:
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
use_latest_gemspec: &use_latest_gemspec
run:
name: Using latest gemspec
command: |
cp .circleci/gemspec_latest smtp_mock.gemspec
use_compatible_gemspec: &use_compatible_gemspec
run:
name: Use compatible gemspec
name: Using compatible gemspec
command: |
cp .circleci/gemspec_compatible smtp_mock.gemspec
Expand All @@ -57,6 +63,7 @@ jobs:
steps:
- checkout

- <<: *use_latest_gemspec
- <<: *restore_bundle_cache
- <<: *bundle_install
- <<: *save_bundle_cache
Expand All @@ -77,6 +84,7 @@ jobs:
steps:
- checkout

- <<: *use_latest_gemspec
- <<: *restore_bundle_cache
- <<: *bundle_install
- <<: *save_bundle_cache
Expand Down Expand Up @@ -114,7 +122,7 @@ jobs:
- checkout
- <<: *use_compatible_gemspec
- ruby/install-deps:
bundler-version: "2.3.5"
bundler-version: "2.3.9"
with-cache: false
path: './vendor/custom_bundle'
- <<: *system_dependencies
Expand Down
7 changes: 2 additions & 5 deletions .circleci/gemspec_compatible
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

lib = ::File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'smtp_mock/version'
require_relative 'lib/smtp_mock/version'

Gem::Specification.new do |spec|
spec.name = 'smtp_mock'
Expand Down Expand Up @@ -33,7 +31,6 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'dry-struct', '~> 1.4'

spec.add_development_dependency 'ffaker', '~> 2.20'
spec.add_development_dependency 'pry-byebug', '~> 3.9'
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
spec.add_development_dependency 'rspec', '~> 3.10'
spec.add_development_dependency 'rspec', '~> 3.11'
end
47 changes: 47 additions & 0 deletions .circleci/gemspec_latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 = ['[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.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.4'

spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
spec.add_development_dependency 'fasterer', '~> 0.9.0'
spec.add_development_dependency 'ffaker', '~> 2.20'
spec.add_development_dependency 'net-smtp', '~> 0.3.1'
spec.add_development_dependency 'overcommit', '~> 0.58.0'
spec.add_development_dependency 'pry-byebug', '~> 3.9'
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
spec.add_development_dependency 'reek', '~> 6.1'
spec.add_development_dependency 'rspec', '~> 3.11'
spec.add_development_dependency 'rubocop', '~> 1.26'
spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.3'
spec.add_development_dependency 'rubocop-rspec', '~> 2.9'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
end
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ checks:
plugins:
rubocop:
enabled: true
channel: rubocop-1-25
channel: rubocop-1-26

reek:
enabled: true
26 changes: 26 additions & 0 deletions .github/DEVELOPMENT_ENVIRONMENT_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Development environment guide

## Preparing

Clone `smtp_mock` repository:

```bash
git clone https://github.com/mocktools/ruby-smtp-mock.git
cd ruby-smtp-mock
```

Configure latest Ruby environment:

```bash
echo 'ruby-3.1.1' > .ruby-version
cp .circleci/gemspec_latest smtp_mock.gemspec
```

## Commiting

Commit your changes excluding `.ruby-version`, `smtp_mock.gemspec`

```bash
git add . ':!.ruby-version' ':!smtp_mock.gemspec'
git commit -m 'Your new awesome smtp_mock feature'
```
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ Style/MapToHash:
Style/OpenStructUse:
Enabled: true

Style/NestedFileDirname:
Enabled: true

Layout/LineLength:
Max: 150

Expand Down Expand Up @@ -391,3 +394,9 @@ RSpec/SubjectDeclaration:

RSpec/FactoryBot/SyntaxMethods:
Enabled: true

RSpec/BeEq:
Enabled: true

RSpec/BeNil:
Enabled: true
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.1.0
ruby-2.5.0
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [1.0.1] - 2022-03-10

### Added

- Development environment guide

### Updated

- Updated gemspecs
- Updated codeclimate/circleci configs
- Updated gem development dependencies
- Updated gem version

## [1.0.0] - 2022-01-31

### Added
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ Guidelines for pull requests:
2. Fork the repo, checkout to `develop` branch
3. Run the tests. This is to make sure your starting point works
4. Read our [branch naming convention](.github/BRANCH_NAMING_CONVENTION.md)
5. Create a new branch and make your changes. This includes tests for features!
6. Push to your fork and submit a pull request to `develop` branch
5. Create a new branch
6. Read our [setup development environment guide](.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md)
7. Make your changes. Please note that your PR should include tests for the new codebase!
9. Push to your fork and submit a pull request to `develop` branch
2 changes: 1 addition & 1 deletion lib/smtp_mock/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SmtpMock
VERSION = '1.0.0'
VERSION = '1.0.1'
end
17 changes: 3 additions & 14 deletions smtp_mock.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

lib = ::File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'smtp_mock/version'
require_relative 'lib/smtp_mock/version'

Gem::Specification.new do |spec|
spec.name = 'smtp_mock'
Expand Down Expand Up @@ -33,17 +31,8 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency 'dry-struct', '~> 1.4'

spec.add_development_dependency 'bundler-audit', '~> 0.9.0.1'
spec.add_development_dependency 'fasterer', '~> 0.9.0'
spec.add_development_dependency 'ffaker', '~> 2.20'
spec.add_development_dependency 'net-smtp', '~> 0.3.1'
spec.add_development_dependency 'overcommit', '~> 0.58.0'
spec.add_development_dependency 'pry-byebug', '~> 3.9'
spec.add_development_dependency 'net-smtp', '~> 0.3.1' if ::RUBY_VERSION >= '3.1.0'
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
spec.add_development_dependency 'reek', '~> 6.1'
spec.add_development_dependency 'rspec', '~> 3.10'
spec.add_development_dependency 'rubocop', '~> 1.25'
spec.add_development_dependency 'rubocop-performance', '~> 1.13', '>= 1.13.2'
spec.add_development_dependency 'rubocop-rspec', '~> 2.8'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'rspec', '~> 3.11'
end
2 changes: 1 addition & 1 deletion spec/support/config/pry.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

require 'pry'
require 'pry' if ::RUBY_VERSION[/\A3\.1.+\z/]

0 comments on commit d01b29e

Please sign in to comment.