diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d0f2e7a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# Dependabot update strategy +version: 2 +updates: + - package-ecosystem: bundler + directory: "/" + schedule: + interval: weekly + allow: + # Automatically keep all runtime dependencies updated + - dependency-name: "*" + dependency-type: "production" + versioning-strategy: lockfile-only diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml new file mode 100644 index 0000000..26f6e72 --- /dev/null +++ b/.github/workflows/continuous_integration.yml @@ -0,0 +1,84 @@ +name: Continuous Integration + +on: + push: + branches: + - master + - actions-* + tags: + - v* + pull_request: + branches-ignore: + - actions-* + +env: + BUNDLE_CLEAN: "true" + BUNDLE_PATH: vendor/bundle + BUNDLE_JOBS: 3 + BUNDLE_RETRY: 3 + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - ruby: "ruby" + standardrb: true + - ruby: "3.2" + appraisal: "activerecord_7.0" + - ruby: "3.1" + appraisal: "activerecord_6.1" + - ruby: "2.7" + appraisal: "activerecord_6.0" + - ruby: "2.7" + appraisal: "activerecord_5.2" + - ruby: "2.6" + appraisal: "activerecord_5.1" + - ruby: "2.6" + appraisal: "activerecord_5.0" + - ruby: "2.5" + appraisal: "activerecord_4.2" + - ruby: "2.5" + appraisal: "activerecord_4.1" + - ruby: "2.5" + appraisal: "activerecord_4.0" + - ruby: "3.2" + appraisal: "sidekiq_7" + - ruby: "3.0" + appraisal: "sidekiq_6" + - ruby: "2.7" + appraisal: "sidekiq_5" + - ruby: "2.6" + appraisal: "sidekiq_4" + - ruby: "2.5" + appraisal: "sidekiq_3" + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby ${{ matrix.ruby }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + - name: Install packages + run: | + sudo apt-get update + sudo apt-get install libsqlite3-dev + - name: Setup bundler + if: matrix.bundler != '' + run: | + gem uninstall bundler --all + gem install bundler --no-document --version ${{ matrix.bundler }} + - name: Set Appraisal bundle + if: matrix.appraisal != '' + run: | + echo "using gemfile gemfiles/${{ matrix.appraisal }}.gemfile" + bundle config set gemfile "gemfiles/${{ matrix.appraisal }}.gemfile" + - name: Install gems + run: | + bundle update + - name: Run Tests + run: bundle exec rake + - name: standardrb + if: matrix.standardrb == true + run: bundle exec rake standard diff --git a/.gitignore b/.gitignore index 5dc914a..90f9586 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ -/.bundle/ -/.yardoc -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ - .DS_Store - -# rspec failure tracking -.rspec_status +.bundle/ +.rspec +.ruby-version +.yardoc/ +.env +Gemfile.lock +coverage/ +gemfiles/*.gemfile.lock +log/*.log +pkg/ +rdoc/ +doc/ diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..b2ec4a5 --- /dev/null +++ b/.standard.yml @@ -0,0 +1,9 @@ +format: progress + +ruby_version: 2.5 + +ignore: + - 'spec/**/*': + - Lint/ConstantDefinitionInBlock + - Lint/UselessAssignment + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d8ea36..0000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: ruby - -before_install: - - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true - - gem install bundler -v '< 2' - -cache: bundler - -branches: - # Only build master and release version tags - only: - - master - - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ - - travis - -rvm: - - "2.6" - -gemfile: - - Gemfile - -matrix: - include: - - rvm: "2.6" - gemfile: Gemfile - - - rvm: "2.5" - gemfile: gemfiles/activerecord_5.2.gemfile - - rvm: "2.5" - gemfile: gemfiles/activerecord_5.1.gemfile - - rvm: "2.5" - gemfile: gemfiles/activerecord_5.0.gemfile - - rvm: "2.5" - gemfile: gemfiles/activerecord_4.2.gemfile - - rvm: "2.5" - gemfile: gemfiles/sidekiq_5.gemfile - - rvm: "2.5" - gemfile: gemfiles/sidekiq_4.gemfile - - - rvm: "2.2.2" - gemfile: gemfiles/activerecord_4.1.gemfile - - rvm: "2.2.2" - gemfile: gemfiles/activerecord_4.0.gemfile - - rvm: "2.2.2" - gemfile: gemfiles/sidekiq_3.gemfile - -script: - - gem list bundler - - bundle exec rake spec - -env: - RACK_ENV: "" - RAILS_ENV: "" diff --git a/Appraisals b/Appraisals index f0be96d..a89ff4f 100644 --- a/Appraisals +++ b/Appraisals @@ -3,8 +3,8 @@ # The code is a little more tightly integrated with ActiveRecord so check # all minor releases. Only need to sanity check major releases of Sidekiq. -RAILS_MINOR_RELEASES = ["6.0", "5.2", "5.1", "5.0", "4.2", "4.1", "4.0"].freeze -SIDEKIQ_MAJOR_RELEASES = ["6", "5", "4", "3"].freeze +RAILS_MINOR_RELEASES = ["7.0", "6.1", "6.0", "5.2", "5.1", "5.0", "4.2", "4.1", "4.0"].freeze +SIDEKIQ_MAJOR_RELEASES = ["7", "6", "5", "4", "3"].freeze RAILS_MINOR_RELEASES.each do |version| appraise "activerecord-#{version}" do diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e4b82..bb02c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,21 @@ -# 1.0.1 +# Changelog +All notable changes to this project will be documented in this file. -* Sidekiq 6.0 compatibility +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.0 +## 1.0.2 -* Initial release +### Changed +- Updated database cleaner dependency to use database_cleaner-active_record instead of deprecated database_cleaner gem. +- Added YARD doc param and return types. + +## 1.0.1 + +### Added +- Sidekiq 6.0 compatibility + +## 1.0.0 + +### Added +- Initial release diff --git a/Gemfile b/Gemfile index 3d3d584..6f99ebd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,12 @@ source "https://rubygems.org" -# Cover security vulnerability of not loading github gems over HTTPS (just in case...) -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - gemspec + +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" diff --git a/Gemfile.lock b/Gemfile.lock index 8687fd4..3bb651e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,76 +1,122 @@ PATH remote: . specs: - sidekiq-transaction_guard (1.0.1) + sidekiq-transaction_guard (1.0.2) activerecord (>= 4.0) sidekiq (>= 3.0) GEM remote: https://rubygems.org/ specs: - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activesupport (6.0.2.1) + activemodel (6.1.7.2) + activesupport (= 6.1.7.2) + activerecord (6.1.7.2) + activemodel (= 6.1.7.2) + activesupport (= 6.1.7.2) + activesupport (6.1.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - appraisal (2.2.0) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + appraisal (2.4.1) bundler rake thor (>= 0.14.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) + ast (2.4.2) + byebug (11.1.3) + coderay (1.1.3) + concurrent-ruby (1.2.0) + connection_pool (2.3.0) + database_cleaner-active_record (2.0.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + diff-lcs (1.5.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) + json (2.6.3) + language_server-protocol (3.17.0.3) + method_source (1.0.0) + minitest (5.17.0) + parallel (1.22.1) + parser (3.2.1.0) + ast (~> 2.4.1) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.9.0) + byebug (~> 11.0) + pry (~> 0.13.0) + rack (2.2.6.2) + rainbow (3.1.1) + rake (13.0.6) + redis (5.0.6) + redis-client (>= 0.9.0) + redis-client (0.12.1) + connection_pool + regexp_parser (2.7.0) + rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.1) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) + rspec-support (~> 3.12.0) + rspec-support (3.12.0) + rubocop (1.44.1) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.2.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.24.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.24.1) + parser (>= 3.1.1.0) + rubocop-performance (1.15.2) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + ruby-progressbar (1.11.0) + sidekiq (6.4.2) connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - zeitwerk (2.2.2) + rack (~> 2.0) + redis (>= 4.2.0) + sqlite3 (1.6.0-x86_64-darwin) + standard (1.24.2) + language_server-protocol (~> 3.17.0.2) + rubocop (= 1.44.1) + rubocop-performance (= 1.15.2) + thor (1.2.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.4.2) + webrick (1.7.0) + yard (0.9.28) + webrick (~> 1.7.0) + zeitwerk (2.6.6) PLATFORMS - ruby + x86_64-darwin-20 DEPENDENCIES appraisal - bundler (~> 1.10) - database_cleaner + database_cleaner-active_record + pry-byebug rake rspec (~> 3.0) sidekiq-transaction_guard! sqlite3 + standard (~> 1.0) + yard BUNDLED WITH - 1.17.2 + 2.3.24 diff --git a/Rakefile b/Rakefile index 368aa0f..7950adb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,19 @@ +begin + require "bundler/setup" +rescue LoadError + puts "You must `gem install bundler` and `bundle install` to run rake tasks" +end + +require "yard" +YARD::Rake::YardocTask.new(:yard) + require "bundler/gem_tasks" + require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) -task :default => :appraisals +task default: :spec desc "run the specs using appraisal" task :appraisals do @@ -16,3 +26,5 @@ namespace :appraisals do exec "bundle exec appraisal install" end end + +require "standard/rake" diff --git a/VERSION b/VERSION index 7dea76e..6d7de6e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 +1.0.2 diff --git a/gemfiles/activerecord_4.0.gemfile b/gemfiles/activerecord_4.0.gemfile index 4e2375d..2a79e7f 100644 --- a/gemfiles/activerecord_4.0.gemfile +++ b/gemfiles/activerecord_4.0.gemfile @@ -2,8 +2,15 @@ source "https://rubygems.org" -gem "activerecord", "~> 4.0.0" +gem "rspec", "~> 3.0" +gem "rake" gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 4.0.0" gem "redis", "~> 3.0" gemspec path: "../" diff --git a/gemfiles/activerecord_4.0.gemfile.lock b/gemfiles/activerecord_4.0.gemfile.lock deleted file mode 100644 index b15d614..0000000 --- a/gemfiles/activerecord_4.0.gemfile.lock +++ /dev/null @@ -1,83 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (4.0.13) - activesupport (= 4.0.13) - builder (~> 3.1.0) - activerecord (4.0.13) - activemodel (= 4.0.13) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.13) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activesupport (4.0.13) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (4.0.2) - builder (3.1.4) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - minitest (4.7.5) - multi_json (1.14.1) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (3.3.5) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (5.2.7) - connection_pool (~> 2.2, >= 2.2.2) - rack (>= 1.5.0) - rack-protection (>= 1.5.0) - redis (>= 3.3.5, < 5) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (0.3.54) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 4.0.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - redis (~> 3.0) - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_4.1.gemfile b/gemfiles/activerecord_4.1.gemfile index 6b3e2be..926ffcc 100644 --- a/gemfiles/activerecord_4.1.gemfile +++ b/gemfiles/activerecord_4.1.gemfile @@ -2,8 +2,15 @@ source "https://rubygems.org" -gem "activerecord", "~> 4.1.0" +gem "rspec", "~> 3.0" +gem "rake" gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 4.1.0" gem "redis", "~> 3.0" gemspec path: "../" diff --git a/gemfiles/activerecord_4.1.gemfile.lock b/gemfiles/activerecord_4.1.gemfile.lock deleted file mode 100644 index 4b3c7dc..0000000 --- a/gemfiles/activerecord_4.1.gemfile.lock +++ /dev/null @@ -1,82 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (4.1.16) - activesupport (= 4.1.16) - builder (~> 3.1) - activerecord (4.1.16) - activemodel (= 4.1.16) - activesupport (= 4.1.16) - arel (~> 5.0.0) - activesupport (4.1.16) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (5.0.1.20140414130214) - builder (3.2.3) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - json (1.8.6) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (3.3.5) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (5.2.7) - connection_pool (~> 2.2, >= 2.2.2) - rack (>= 1.5.0) - rack-protection (>= 1.5.0) - redis (>= 3.3.5, < 5) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 4.1.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - redis (~> 3.0) - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_4.2.gemfile b/gemfiles/activerecord_4.2.gemfile index d3cfe33..d211802 100644 --- a/gemfiles/activerecord_4.2.gemfile +++ b/gemfiles/activerecord_4.2.gemfile @@ -2,8 +2,15 @@ source "https://rubygems.org" -gem "activerecord", "~> 4.2.0" +gem "rspec", "~> 3.0" +gem "rake" gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 4.2.0" gem "redis", "~> 3.0" gemspec path: "../" diff --git a/gemfiles/activerecord_4.2.gemfile.lock b/gemfiles/activerecord_4.2.gemfile.lock deleted file mode 100644 index 4ce311d..0000000 --- a/gemfiles/activerecord_4.2.gemfile.lock +++ /dev/null @@ -1,80 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (4.2.10) - activesupport (= 4.2.10) - builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) - arel (~> 6.0) - activesupport (4.2.10) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (6.0.4) - builder (3.2.3) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (3.3.5) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (5.2.7) - connection_pool (~> 2.2, >= 2.2.2) - rack (>= 1.5.0) - rack-protection (>= 1.5.0) - redis (>= 3.3.5, < 5) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 4.2.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - redis (~> 3.0) - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_5.0.gemfile b/gemfiles/activerecord_5.0.gemfile index 0f461ab..ddeec28 100644 --- a/gemfiles/activerecord_5.0.gemfile +++ b/gemfiles/activerecord_5.0.gemfile @@ -2,7 +2,14 @@ source "https://rubygems.org" -gem "activerecord", "~> 5.0.0" +gem "rspec", "~> 3.0" +gem "rake" gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 5.0.0" gemspec path: "../" diff --git a/gemfiles/activerecord_5.0.gemfile.lock b/gemfiles/activerecord_5.0.gemfile.lock deleted file mode 100644 index e692b26..0000000 --- a/gemfiles/activerecord_5.0.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (5.0.7) - activesupport (= 5.0.7) - activerecord (5.0.7) - activemodel (= 5.0.7) - activesupport (= 5.0.7) - arel (~> 7.0) - activesupport (5.0.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (7.1.4) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) - connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 5.0.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_5.1.gemfile b/gemfiles/activerecord_5.1.gemfile index 16fd5a9..fd76eca 100644 --- a/gemfiles/activerecord_5.1.gemfile +++ b/gemfiles/activerecord_5.1.gemfile @@ -2,7 +2,14 @@ source "https://rubygems.org" -gem "activerecord", "~> 5.1.0" +gem "rspec", "~> 3.0" +gem "rake" gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 5.1.0" gemspec path: "../" diff --git a/gemfiles/activerecord_5.1.gemfile.lock b/gemfiles/activerecord_5.1.gemfile.lock deleted file mode 100644 index 6c960a6..0000000 --- a/gemfiles/activerecord_5.1.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (8.0.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) - connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 5.1.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_5.2.gemfile b/gemfiles/activerecord_5.2.gemfile index 027888d..2e04522 100644 --- a/gemfiles/activerecord_5.2.gemfile +++ b/gemfiles/activerecord_5.2.gemfile @@ -2,6 +2,14 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "activerecord", "~> 5.2.0" gemspec path: "../" diff --git a/gemfiles/activerecord_5.2.gemfile.lock b/gemfiles/activerecord_5.2.gemfile.lock deleted file mode 100644 index be72f25..0000000 --- a/gemfiles/activerecord_5.2.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (5.2.3) - activesupport (= 5.2.3) - activerecord (5.2.3) - activemodel (= 5.2.3) - activesupport (= 5.2.3) - arel (>= 9.0) - activesupport (5.2.3) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (9.0.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) - connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 5.2.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_6.0.gemfile b/gemfiles/activerecord_6.0.gemfile index b07bd13..293fcc5 100644 --- a/gemfiles/activerecord_6.0.gemfile +++ b/gemfiles/activerecord_6.0.gemfile @@ -2,6 +2,14 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "activerecord", "~> 6.0.0" gemspec path: "../" diff --git a/gemfiles/activerecord_6.0.gemfile.lock b/gemfiles/activerecord_6.0.gemfile.lock deleted file mode 100644 index a4b281a..0000000 --- a/gemfiles/activerecord_6.0.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activesupport (6.0.2.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) - connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - zeitwerk (2.2.2) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 6.0.0) - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq-transaction_guard! - sqlite3 - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/activerecord_6.1.gemfile b/gemfiles/activerecord_6.1.gemfile new file mode 100644 index 0000000..57948f0 --- /dev/null +++ b/gemfiles/activerecord_6.1.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 6.1.0" + +gemspec path: "../" diff --git a/gemfiles/activerecord_7.0.gemfile b/gemfiles/activerecord_7.0.gemfile new file mode 100644 index 0000000..d8eca7c --- /dev/null +++ b/gemfiles/activerecord_7.0.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "activerecord", "~> 7.0.0" + +gemspec path: "../" diff --git a/gemfiles/sidekiq_3.gemfile b/gemfiles/sidekiq_3.gemfile index bfd96fd..9288cea 100644 --- a/gemfiles/sidekiq_3.gemfile +++ b/gemfiles/sidekiq_3.gemfile @@ -2,9 +2,16 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3", "~> 1.3.0" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "sidekiq", "~> 3.0" gem "redis", "~> 3.0" gem "activerecord", "~> 4.2" -gem "sqlite3", "~> 1.3.0" gemspec path: "../" diff --git a/gemfiles/sidekiq_3.gemfile.lock b/gemfiles/sidekiq_3.gemfile.lock deleted file mode 100644 index 0c9c411..0000000 --- a/gemfiles/sidekiq_3.gemfile.lock +++ /dev/null @@ -1,100 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (4.2.10) - activesupport (= 4.2.10) - builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) - arel (~> 6.0) - activesupport (4.2.10) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (6.0.4) - builder (3.2.3) - celluloid (0.17.4) - celluloid-essentials - celluloid-extras - celluloid-fsm - celluloid-pool - celluloid-supervision - timers (>= 4.1.1) - celluloid-essentials (0.20.5) - timers (>= 4.1.1) - celluloid-extras (0.20.5) - timers (>= 4.1.1) - celluloid-fsm (0.20.5) - timers (>= 4.1.1) - celluloid-pool (0.20.5) - timers (>= 4.1.1) - celluloid-supervision (0.20.6) - timers (>= 4.1.1) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - json (1.8.6) - minitest (5.14.0) - rake (13.0.1) - redis (3.3.5) - redis-namespace (1.6.0) - redis (>= 3.0.4) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (3.5.4) - celluloid (~> 0.17.2) - connection_pool (~> 2.2, >= 2.2.0) - json (~> 1.0) - redis (~> 3.2, >= 3.2.1) - redis-namespace (~> 1.5, >= 1.5.2) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - timers (4.3.0) - tzinfo (1.2.6) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 4.2) - appraisal - bundler (~> 1.10) - database_cleaner - rake - redis (~> 3.0) - rspec (~> 3.0) - sidekiq (~> 3.0) - sidekiq-transaction_guard! - sqlite3 (~> 1.3.0) - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/sidekiq_4.gemfile b/gemfiles/sidekiq_4.gemfile index 9ef2d59..ee2af95 100644 --- a/gemfiles/sidekiq_4.gemfile +++ b/gemfiles/sidekiq_4.gemfile @@ -2,6 +2,14 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "sidekiq", "~> 4.0" gemspec path: "../" diff --git a/gemfiles/sidekiq_4.gemfile.lock b/gemfiles/sidekiq_4.gemfile.lock deleted file mode 100644 index 03bbcce..0000000 --- a/gemfiles/sidekiq_4.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activesupport (6.0.2.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (3.3.5) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (4.2.10) - concurrent-ruby (~> 1.0) - connection_pool (~> 2.2, >= 2.2.0) - rack-protection (>= 1.5.0) - redis (~> 3.2, >= 3.2.1) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - zeitwerk (2.2.2) - -PLATFORMS - ruby - -DEPENDENCIES - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq (~> 4.0) - sidekiq-transaction_guard! - sqlite3 - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/sidekiq_5.gemfile b/gemfiles/sidekiq_5.gemfile index 02d5200..463ff6e 100644 --- a/gemfiles/sidekiq_5.gemfile +++ b/gemfiles/sidekiq_5.gemfile @@ -2,6 +2,14 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "sidekiq", "~> 5.0" gemspec path: "../" diff --git a/gemfiles/sidekiq_5.gemfile.lock b/gemfiles/sidekiq_5.gemfile.lock deleted file mode 100644 index 3aba864..0000000 --- a/gemfiles/sidekiq_5.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activesupport (6.0.2.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (5.2.7) - connection_pool (~> 2.2, >= 2.2.2) - rack (>= 1.5.0) - rack-protection (>= 1.5.0) - redis (>= 3.3.5, < 5) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - zeitwerk (2.2.2) - -PLATFORMS - ruby - -DEPENDENCIES - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq (~> 5.0) - sidekiq-transaction_guard! - sqlite3 - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/sidekiq_6.gemfile b/gemfiles/sidekiq_6.gemfile index 49927d7..2a641ab 100644 --- a/gemfiles/sidekiq_6.gemfile +++ b/gemfiles/sidekiq_6.gemfile @@ -2,6 +2,14 @@ source "https://rubygems.org" +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" gem "sidekiq", "~> 6.0" gemspec path: "../" diff --git a/gemfiles/sidekiq_6.gemfile.lock b/gemfiles/sidekiq_6.gemfile.lock deleted file mode 100644 index 1a47afc..0000000 --- a/gemfiles/sidekiq_6.gemfile.lock +++ /dev/null @@ -1,77 +0,0 @@ -PATH - remote: .. - specs: - sidekiq-transaction_guard (1.0.1) - activerecord (>= 4.0) - sidekiq (>= 3.0) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activesupport (6.0.2.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - concurrent-ruby (1.1.5) - connection_pool (2.2.2) - database_cleaner (1.7.0) - diff-lcs (1.3) - i18n (1.8.2) - concurrent-ruby (~> 1.0) - minitest (5.14.0) - rack (2.1.1) - rack-protection (2.0.8.1) - rack - rake (13.0.1) - redis (4.1.3) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) - sidekiq (6.0.4) - connection_pool (>= 2.2.2) - rack (>= 2.0.0) - rack-protection (>= 2.0.0) - redis (>= 4.1.0) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - zeitwerk (2.2.2) - -PLATFORMS - ruby - -DEPENDENCIES - appraisal - bundler (~> 1.10) - database_cleaner - rake - rspec (~> 3.0) - sidekiq (~> 6.0) - sidekiq-transaction_guard! - sqlite3 - -BUNDLED WITH - 1.17.2 diff --git a/gemfiles/sidekiq_7.gemfile b/gemfiles/sidekiq_7.gemfile new file mode 100644 index 0000000..f19a539 --- /dev/null +++ b/gemfiles/sidekiq_7.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rspec", "~> 3.0" +gem "rake" +gem "sqlite3" +gem "database_cleaner-active_record" +gem "appraisal" +gem "standard", "~>1.0" +gem "pry-byebug" +gem "yard" +gem "sidekiq", "~> 7.0" + +gemspec path: "../" diff --git a/lib/sidekiq-transaction_guard.rb b/lib/sidekiq-transaction_guard.rb index 1d0417a..4c7c64d 100644 --- a/lib/sidekiq-transaction_guard.rb +++ b/lib/sidekiq-transaction_guard.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require_relative "sidekiq/transaction_guard" diff --git a/lib/sidekiq/transaction_guard.rb b/lib/sidekiq/transaction_guard.rb index 5edb1cf..1dce7e6 100644 --- a/lib/sidekiq/transaction_guard.rb +++ b/lib/sidekiq/transaction_guard.rb @@ -1,10 +1,9 @@ # frozen_string_literal: true -require 'sidekiq' -require 'set' -require 'thread' +require "sidekiq" +require "set" -require_relative 'transaction_guard/middleware' +require_relative "transaction_guard/middleware" module Sidekiq module TransactionGuard @@ -26,6 +25,9 @@ class << self # * :stderr - Log to STDERR # * :error - Throw a `Sidekiq::TransactionGuard::InsideTransactionError` # * :disabled - Allow workers inside of transactions + # + # @param mode [Symbol] + # @return [void] def mode=(symbol) if VALID_MODES.include?(symbol) @mode = symbol @@ -35,18 +37,22 @@ def mode=(symbol) end # Return the current mode. - def mode - @mode - end + # + # @return [Symbol] + attr_reader :mode # Define the global notify block. This block will be called with a Sidekiq # job hash for all jobs enqueued inside transactions if the mode is `:warn` # or `:stderr`. + # + # @return [void] def notify(&block) @notify = block end # Return the block set as the notify handler with a call to `notify`. + # + # @return [Proc] def notify_block @notify end @@ -55,15 +61,20 @@ def notify_block # being monitored for open transactions. You don't need to add `ActiveRecord::Base` # or subclasses. Only the base class that establishes a new connection pool # with a call to `establish_connection` needs to be added. + # + # @param connection_class [Class] + # @return [void] def add_connection_class(connection_class) - @lock.synchronize{ @connection_classes << connection_class } + @lock.synchronize { @connection_classes << connection_class } end # Return true if any connection is currently inside of a transaction. + # + # @return [Boolean] def in_transaction? connection_classes = [ActiveRecord::Base] unless @connection_classes.empty? - connection_classes.concat(@lock.synchronize{ @connection_classes.to_a }) + connection_classes.concat(@lock.synchronize { @connection_classes.to_a }) end connection_classes.any? do |connection_class| connection_pool = connection_class.connection_pool @@ -78,6 +89,8 @@ def in_transaction? # This method call needs to be wrapped around tests that use transactional fixtures. # It sets up data structures used to track the number of open transactions. + # + # @return [Object] the return value of the block def testing(&block) var = :sidekiq_rails_transaction_guard save_val = Thread.current[var] @@ -93,6 +106,9 @@ def testing(&block) # class (see `add_connection_class` for more info). The current transaction level # for that class' connection will be set as the zero point. This method can only # be called inside a block wrapped with the `testing` method. + # + # @param connection_class [Class] + # @return [void] def set_allowed_transaction_level(connection_class) connection_counts = Thread.current[:sidekiq_rails_transaction_guard] unless connection_counts diff --git a/lib/sidekiq/transaction_guard/database_cleaner.rb b/lib/sidekiq/transaction_guard/database_cleaner.rb index b50c490..541a7f1 100644 --- a/lib/sidekiq/transaction_guard/database_cleaner.rb +++ b/lib/sidekiq/transaction_guard/database_cleaner.rb @@ -1,6 +1,7 @@ -require 'sidekiq/transaction_guard' -require 'database_cleaner' -require 'database_cleaner/active_record/transaction' +# frozen_string_literal: true + +require "sidekiq/transaction_guard" +require "database_cleaner/active_record" module Sidekiq module TransactionGuard @@ -16,8 +17,10 @@ def start # Wrap the `Sidekiq::TransactionGuard.testing` which sets up the data structures # needed for custom counting of the transaction level within a test block. + # + # @return [Object] the return value of the block def cleaning(&block) - Sidekiq::TransactionGuard.testing{ super(&block) } + Sidekiq::TransactionGuard.testing { super(&block) } end end end diff --git a/lib/sidekiq/transaction_guard/middleware.rb b/lib/sidekiq/transaction_guard/middleware.rb index f91c353..3a7633e 100644 --- a/lib/sidekiq/transaction_guard/middleware.rb +++ b/lib/sidekiq/transaction_guard/middleware.rb @@ -54,7 +54,7 @@ def notify!(worker_class, job) if Sidekiq.logger Sidekiq.logger.error(e) else - STDERR.write("ERROR on Sidekiq::TransactionGuard notify block for #{worker_class}: #{e.inspect}\n") + $stderr.write("ERROR on Sidekiq::TransactionGuard notify block for #{worker_class}: #{e.inspect}\n") end end end @@ -71,7 +71,7 @@ def log_transaction(worker_class, job) if logger logger.warn(message) else - STDERR.write("WARNING #{message}\n") + $stderr.write("WARNING #{message}\n") end notify!(worker_class, job) end diff --git a/sidekiq-transaction_guard.gemspec b/sidekiq-transaction_guard.gemspec index 3182afe..1dda88c 100644 --- a/sidekiq-transaction_guard.gemspec +++ b/sidekiq-transaction_guard.gemspec @@ -3,18 +3,18 @@ require_relative "lib/sidekiq/transaction_guard/version" Gem::Specification.new do |spec| - spec.name = "sidekiq-transaction_guard" - spec.version = Sidekiq::TransactionGuard::VERSION - spec.authors = ["Brian Durand", "Winston Durand"] - spec.email = ["bbdurand@gmail.com", "me@winstondurand.com"] + spec.name = "sidekiq-transaction_guard" + spec.version = Sidekiq::TransactionGuard::VERSION + spec.authors = ["Brian Durand", "Winston Durand"] + spec.email = ["bbdurand@gmail.com", "me@winstondurand.com"] - spec.summary = "Protect from accidentally invoking Sidekiq jobs when there are open database transactions" - spec.homepage = "https://github.com/bdurand/sidekiq-transaction_guard" - spec.license = "MIT" + spec.summary = "Protect from accidentally invoking Sidekiq jobs when there are open database transactions" + spec.homepage = "https://github.com/bdurand/sidekiq-transaction_guard" + spec.license = "MIT" # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - ignore_files = %w( + ignore_files = %w[ .gitignore .travis.yml Appraisals @@ -23,23 +23,16 @@ Gem::Specification.new do |spec| Rakefile gemfiles/ spec/ - ) - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z`.split("\x0").reject{ |f| ignore_files.any?{ |path| f.start_with?(path) } } + ] + spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do + `git ls-files -z`.split("\x0").reject { |f| ignore_files.any? { |path| f.start_with?(path) } } end - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.required_ruby_version = '>= 2.2.2' + spec.required_ruby_version = ">= 2.2.2" spec.add_dependency "activerecord", ">= 4.0" spec.add_dependency "sidekiq", ">= 3.0" - - spec.add_development_dependency "bundler", "~> 1.10" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec", "~> 3.0" - spec.add_development_dependency "database_cleaner" - spec.add_development_dependency "sqlite3" - spec.add_development_dependency "appraisal" end diff --git a/spec/sidekiq/transaction_guard/database_cleaner_spec.rb b/spec/sidekiq/transaction_guard/database_cleaner_spec.rb index bb6e33c..b7e66dd 100644 --- a/spec/sidekiq/transaction_guard/database_cleaner_spec.rb +++ b/spec/sidekiq/transaction_guard/database_cleaner_spec.rb @@ -1,14 +1,14 @@ -require 'spec_helper' +# frozen_string_literal: true + +require "spec_helper" begin - require 'database_cleaner' + require "database_cleaner-active_record" rescue LoadError - STDERR.puts("DatabaseCleaner not available; specs not run") + warn("DatabaseCleaner not available; specs not run") end -DatabaseCleaner.orm = :active_record - -require 'sidekiq/transaction_guard/database_cleaner' +require "sidekiq/transaction_guard/database_cleaner" describe Sidekiq::TransactionGuard::DatabaseCleaner do it "should not count the wrapping transaction in determining if a transaction is open" do diff --git a/spec/sidekiq/transaction_guard/middleware_spec.rb b/spec/sidekiq/transaction_guard/middleware_spec.rb index 2dc4b57..4589c3e 100644 --- a/spec/sidekiq/transaction_guard/middleware_spec.rb +++ b/spec/sidekiq/transaction_guard/middleware_spec.rb @@ -1,6 +1,8 @@ -require 'spec_helper' -require 'stringio' -require 'sidekiq/testing' +# frozen_string_literal: true + +require "spec_helper" +require "stringio" +require "sidekiq/testing" class TestWorker include Sidekiq::Worker @@ -12,12 +14,10 @@ def perform class TestWithNotifierWorker include Sidekiq::Worker - sidekiq_options notify_in_transaction: -> (job) { self.in_transaction_args = job["args"] } + sidekiq_options notify_in_transaction: ->(job) { self.in_transaction_args = job["args"] } class << self - def in_transaction_args=(val) - @in_transaction_args = val - end + attr_writer :in_transaction_args def in_transaction_args @in_transaction_args if defined?(@in_transaction_args) @@ -75,18 +75,20 @@ def perform end describe "inside a transaciton with mode :warn" do - let(:log){ StringIO.new } + let(:log) { StringIO.new } + let(:logger) { Logger.new(log) } + + before(:each) do + allow(Sidekiq).to receive(:logger).and_return(logger) + end around(:each) do |example| save_mode = Sidekiq::TransactionGuard.mode - save_logger = Sidekiq.logger begin Sidekiq::TransactionGuard.mode = :warn - Sidekiq.logger = Logger.new(log) example.call ensure Sidekiq::TransactionGuard.mode = save_mode - Sidekiq.logger = save_logger end end @@ -108,7 +110,7 @@ def perform it "should be able to define the mode on the worker class" do TestModel.transaction do - expect{ ErrorWorker.perform_async }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) + expect { ErrorWorker.perform_async }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) end expect(ErrorWorker.jobs.size).to eq 0 end @@ -125,8 +127,14 @@ def perform end end - before(:each) do - stub_const("STDERR", StringIO.new) + around(:each) do |example| + stream = $stderr + begin + $stderr = StringIO.new + example.call + ensure + $stderr = stream + end end it "should report to STDERR" do @@ -134,7 +142,7 @@ def perform TestWorker.perform_async end expect(TestWorker.jobs.size).to eq 1 - expect(STDERR.string).to include "TestWorker was called from inside a database transaction" + expect($stderr.string).to include "TestWorker was called from inside a database transaction" end it "should log to STDERR jobs being scheduled inside of a transaction if there is no logger" do @@ -144,7 +152,7 @@ def perform TestWorker.perform_async end expect(TestWorker.jobs.size).to eq 1 - expect(STDERR.string).to include "TestWorker was called from inside a database transaction" + expect($stderr.string).to include "TestWorker was called from inside a database transaction" end end @@ -161,14 +169,14 @@ def perform it "should raise an error if job is scheduled inside of a transaction" do TestModel.transaction do - expect{ TestWorker.perform_async }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) + expect { TestWorker.perform_async }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) end expect(TestWorker.jobs.size).to eq 0 end it "should raise an error if job is scheduled in the future" do TestModel.transaction do - expect{ TestWorker.perform_in(60) }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) + expect { TestWorker.perform_in(60) }.to raise_error(Sidekiq::TransactionGuard::InsideTransactionError) end expect(TestWorker.jobs.size).to eq 0 end diff --git a/spec/sidekiq/transaction_guard_spec.rb b/spec/sidekiq/transaction_guard_spec.rb index 7d865f7..eba15e3 100644 --- a/spec/sidekiq/transaction_guard_spec.rb +++ b/spec/sidekiq/transaction_guard_spec.rb @@ -1,4 +1,6 @@ -require 'spec_helper' +# frozen_string_literal: true + +require "spec_helper" describe Sidekiq::TransactionGuard do describe "mode" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f0f352a..b25f737 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" require "sidekiq/transaction_guard" @@ -15,25 +17,31 @@ ActiveRecord::Base.establish_connection("adapter" => "sqlite3", "database" => ":memory:") class TestModel < ActiveRecord::Base - connection.create_table(table_name) do |t| - t.column :name, :string - end unless table_exists? + unless table_exists? + connection.create_table(table_name) do |t| + t.column :name, :string + end + end end class OtherConnectionModel < ActiveRecord::Base establish_connection("adapter" => "sqlite3", "database" => ":memory:") - connection.create_table(table_name) do |t| - t.column :name, :string - end unless table_exists? + unless table_exists? + connection.create_table(table_name) do |t| + t.column :name, :string + end + end end class UnregisteredConnectionModel < ActiveRecord::Base establish_connection("adapter" => "sqlite3", "database" => ":memory:") - connection.create_table(table_name) do |t| - t.column :name, :string - end unless table_exists? + unless table_exists? + connection.create_table(table_name) do |t| + t.column :name, :string + end + end end Sidekiq::TransactionGuard.add_connection_class(OtherConnectionModel)