diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41d3bfc..a3e869b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,9 @@ jobs: fail-fast: false matrix: ruby: - - '3.3.0' - - '3.2.2' - - '3.1.4' + - '3.3.3' + - '3.2.4' + - '3.1.6' appraisal: - 'railties-7-sidekiq' - 'railties-6-sidekiq' @@ -36,12 +36,14 @@ jobs: run: bundle exec appraisal install - name: Run the specs for Appraisal env: + COVERAGE: true APPRAISAL: ${{ matrix.appraisal }} RUBY_VERSION: ${{ matrix.ruby }} run: bundle exec appraisal ${{ matrix.appraisal }} rake spec - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: + COVERAGE: true CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: files: ./coverage/${{ matrix.ruby }}-${{ matrix.appraisal }}/coverage.json diff --git a/CHANGELOG.md b/CHANGELOG.md index cee588d..89ad248 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,37 +1,32 @@ ## [Unreleased] -## [0.1.0-alpha.1] - 2023-12-16 - -- Initial release - -## [0.2.0-alpha.1] - 2023-12-27 +## [0.5.0] - 2024-01-01 +- Add support for `SetA = Interactify { _1.a = 'a' }`, lambda and block class creation syntax +- Add support for organizing `organize A.organizing(B, C, D), E, F` contract syntax +- make definition errors raise optionally +- raise an error with unexpected keys in Interactify.if clause +- propagate caller_info through chains -- Added support for Interactify.promising syntax in organizers +## [0.4.1] - 2023-12-29 +- Fix bug triggered when nesting each and if -## [0.3.0-alpha.1] - 2023-12-29 +## [0.4.0] - 2023-12-29 +- All internal restructuring/refactoring into domains. +- Add support for organize `self.if(:condition, then: A, else: B)` syntax +- change location of matchers to `require 'interactify/rspec_matchers/matchers'` -- Added support for `{if: :condition, then: A, else: B}` in organizers +## [0.3.0-RC1] - 2023-12-29 +- Fixed to work with and make optional dependencies for sidekiq and railties. Confirmed as working with ruby >= 3.1.4 ## [0.3.0-alpha.2] - 2023-12-29 - - Remove deep_matching development dependency -## [0.3.0-RC1] - 2023-12-29 - -- Fixed to work with and make optional dependencies for sidekiq and railties. Confirmed as working with ruby >= 3.1.4 -## [0.4.0] - 2023-12-29 - -- All internal restructuring/refactoring into domains. -- Add support for organize `self.if(:condition, then: A, else: B)` syntax -- change location of matchers to `require 'interactify/rspec_matchers/matchers'` +## [0.3.0-alpha.1] - 2023-12-29 +- Added support for `{if: :condition, then: A, else: B}` in organizers -## [0.4.1] - 2023-12-29 -- Fix bug triggered when nesting each and if +## [0.2.0-alpha.1] - 2023-12-27 +- Added support for Interactify.promising syntax in organizers -## [0.5.0] - 2024-01-01 -- Add support for `SetA = Interactify { _1.a = 'a' }`, lambda and block class creation syntax -- Add support for organizing `organize A.organizing(B, C, D), E, F` contract syntax -- make definition errors raise optionally -- raise an error with unexpected keys in Interactify.if clause -- propagate caller_info through chains +## [0.1.0-alpha.1] - 2023-12-16 +- Initial release diff --git a/gemfiles/no_railties_no_sidekiq.gemfile b/gemfiles/no_railties_no_sidekiq.gemfile index 02ffbb3..d8792f8 100644 --- a/gemfiles/no_railties_no_sidekiq.gemfile +++ b/gemfiles/no_railties_no_sidekiq.gemfile @@ -13,6 +13,7 @@ group :test do gem "debug" gem "rspec", "~> 3.0" gem "simplecov", require: false + gem "simplecov-json", require: false end gemspec path: "../" diff --git a/gemfiles/no_railties_no_sidekiq.gemfile.lock b/gemfiles/no_railties_no_sidekiq.gemfile.lock index cfb5ffa..598ff2a 100644 --- a/gemfiles/no_railties_no_sidekiq.gemfile.lock +++ b/gemfiles/no_railties_no_sidekiq.gemfile.lock @@ -76,6 +76,7 @@ GEM irb (1.11.0) rdoc reline (>= 0.3.8) + json (2.7.1) minitest (5.20.0) mutex_m (0.2.0) psych (5.1.2) @@ -104,6 +105,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-json (0.2.3) + json + simplecov simplecov_json_formatter (0.1.4) stringio (3.1.0) thor (1.3.0) @@ -122,6 +126,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) simplecov + simplecov-json BUNDLED WITH 2.4.22 diff --git a/gemfiles/railties_6_no_sidekiq.gemfile b/gemfiles/railties_6_no_sidekiq.gemfile index 29f9800..b9baf24 100644 --- a/gemfiles/railties_6_no_sidekiq.gemfile +++ b/gemfiles/railties_6_no_sidekiq.gemfile @@ -14,6 +14,7 @@ group :test do gem "debug" gem "rspec", "~> 3.0" gem "simplecov", require: false + gem "simplecov-json", require: false end gemspec path: "../" diff --git a/gemfiles/railties_6_no_sidekiq.gemfile.lock b/gemfiles/railties_6_no_sidekiq.gemfile.lock index 619a55e..46cd2b2 100644 --- a/gemfiles/railties_6_no_sidekiq.gemfile.lock +++ b/gemfiles/railties_6_no_sidekiq.gemfile.lock @@ -83,6 +83,7 @@ GEM irb (1.11.0) rdoc reline (>= 0.3.8) + json (2.7.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -134,6 +135,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-json (0.2.3) + json + simplecov simplecov_json_formatter (0.1.4) stringio (3.1.0) thor (1.3.0) @@ -154,6 +158,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) simplecov + simplecov-json BUNDLED WITH 2.4.22 diff --git a/gemfiles/railties_6_sidekiq.gemfile b/gemfiles/railties_6_sidekiq.gemfile index d69ecf3..62f9cff 100644 --- a/gemfiles/railties_6_sidekiq.gemfile +++ b/gemfiles/railties_6_sidekiq.gemfile @@ -15,6 +15,7 @@ group :test do gem "debug" gem "rspec", "~> 3.0" gem "simplecov", require: false + gem "simplecov-json", require: false end gemspec path: "../" diff --git a/gemfiles/railties_6_sidekiq.gemfile.lock b/gemfiles/railties_6_sidekiq.gemfile.lock index ea89f46..5574c21 100644 --- a/gemfiles/railties_6_sidekiq.gemfile.lock +++ b/gemfiles/railties_6_sidekiq.gemfile.lock @@ -84,6 +84,7 @@ GEM irb (1.11.0) rdoc reline (>= 0.3.8) + json (2.7.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -142,6 +143,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-json (0.2.3) + json + simplecov simplecov_json_formatter (0.1.4) stringio (3.1.0) thor (1.3.0) @@ -163,6 +167,7 @@ DEPENDENCIES rspec (~> 3.0) sidekiq (= 7) simplecov + simplecov-json BUNDLED WITH 2.4.22 diff --git a/gemfiles/railties_7_no_sidekiq.gemfile b/gemfiles/railties_7_no_sidekiq.gemfile index 450df62..36e6de6 100644 --- a/gemfiles/railties_7_no_sidekiq.gemfile +++ b/gemfiles/railties_7_no_sidekiq.gemfile @@ -14,6 +14,7 @@ group :test do gem "debug" gem "rspec", "~> 3.0" gem "simplecov", require: false + gem "simplecov-json", require: false end gemspec path: "../" diff --git a/gemfiles/railties_7_no_sidekiq.gemfile.lock b/gemfiles/railties_7_no_sidekiq.gemfile.lock index ef31672..6390e38 100644 --- a/gemfiles/railties_7_no_sidekiq.gemfile.lock +++ b/gemfiles/railties_7_no_sidekiq.gemfile.lock @@ -82,6 +82,7 @@ GEM irb (1.11.0) rdoc reline (>= 0.3.8) + json (2.7.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -134,6 +135,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-json (0.2.3) + json + simplecov simplecov_json_formatter (0.1.4) stringio (3.1.0) thor (1.3.0) @@ -153,6 +157,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.0) simplecov + simplecov-json BUNDLED WITH 2.4.22 diff --git a/gemfiles/railties_7_sidekiq.gemfile b/gemfiles/railties_7_sidekiq.gemfile index a7c29ed..0d102f6 100644 --- a/gemfiles/railties_7_sidekiq.gemfile +++ b/gemfiles/railties_7_sidekiq.gemfile @@ -15,6 +15,7 @@ group :test do gem "debug" gem "rspec", "~> 3.0" gem "simplecov", require: false + gem "simplecov-json", require: false end gemspec path: "../" diff --git a/gemfiles/railties_7_sidekiq.gemfile.lock b/gemfiles/railties_7_sidekiq.gemfile.lock index 745cbd0..1c434ce 100644 --- a/gemfiles/railties_7_sidekiq.gemfile.lock +++ b/gemfiles/railties_7_sidekiq.gemfile.lock @@ -83,6 +83,7 @@ GEM irb (1.11.0) rdoc reline (>= 0.3.8) + json (2.7.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -142,6 +143,9 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-json (0.2.3) + json + simplecov simplecov_json_formatter (0.1.4) stringio (3.1.0) thor (1.3.0) @@ -162,6 +166,7 @@ DEPENDENCIES rspec (~> 3.0) sidekiq (= 7) simplecov + simplecov-json BUNDLED WITH 2.4.22 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4adf37b..274f296 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true require "debug" + require "./spec/support/coverage" + require "interactify" if Interactify.sidekiq? diff --git a/spec/support/coverage.rb b/spec/support/coverage.rb index 6c97efb..dfd810b 100644 --- a/spec/support/coverage.rb +++ b/spec/support/coverage.rb @@ -1,23 +1,25 @@ # frozen_string_literal: true -require "simplecov" -require "simplecov-json" +if ENV["COVERAGE"] + require "simplecov" + require "simplecov-json" -SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::JSONFormatter - ]) + SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::JSONFormatter + ]) -SimpleCov.start do - add_filter "/spec/" - add_filter(/_spec\.rb$/) # This line excludes all files ending with _spec.rb + SimpleCov.start do + add_filter "/spec/" + add_filter(/_spec\.rb$/) # This line excludes all files ending with _spec.rb - add_group "Sidekiq jobs" do |src_file| - src_file.project_filename =~ %r{lib/interactify/async} && src_file.filename !~ /_spec\.rb/ - end + add_group "Sidekiq jobs" do |src_file| + src_file.project_filename =~ %r{lib/interactify/async} && src_file.filename !~ /_spec\.rb/ + end - add_group "Wiring", "lib/interactify/wiring" - add_group "RSpec matchers", "lib/interactify/rspec_matchers" + add_group "Wiring", "lib/interactify/wiring" + add_group "RSpec matchers", "lib/interactify/rspec_matchers" - coverage_dir "coverage/#{ENV.fetch('RUBY_VERSION', nil)}-#{ENV.fetch('APPRAISAL', nil)}" + coverage_dir "coverage/#{ENV.fetch('RUBY_VERSION', nil)}-#{ENV.fetch('APPRAISAL', nil)}" + end end