From c7a4ad5d8e1dbb95ce43d3a5cb091cb79fa76423 Mon Sep 17 00:00:00 2001 From: Simon Schoeters Date: Tue, 20 Dec 2022 13:19:07 +0100 Subject: [PATCH 1/4] Add GitHub CI --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ .rspec | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .rspec diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..22987fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: "GitHub CI" +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Run specs + run: bundle exec rake + env: + RAILS_ENV: test diff --git a/.rspec b/.rspec deleted file mode 100644 index 4e1e0d2..0000000 --- a/.rspec +++ /dev/null @@ -1 +0,0 @@ ---color From a0124e1210bf90eb9ed773d37b7eabb4b846c03c Mon Sep 17 00:00:00 2001 From: Simon Schoeters Date: Tue, 20 Dec 2022 13:34:26 +0100 Subject: [PATCH 2/4] Upgrade Ruby to 3.1.2 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 227cea2..ef538c2 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.0.0 +3.1.2 From e1badb7c78c218316e6e2d8ab57f2810ca6353b6 Mon Sep 17 00:00:00 2001 From: Simon Schoeters Date: Tue, 20 Dec 2022 13:38:55 +0100 Subject: [PATCH 3/4] Update gems --- Gemfile.lock | 174 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 122 insertions(+), 52 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3729fe0..ca9d398 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,61 +1,128 @@ GEM remote: http://rubygems.org/ specs: - actionmailer (3.2.9) - actionpack (= 3.2.9) - mail (~> 2.4.4) - actionpack (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) - activesupport (3.2.9) - i18n (~> 0.6) - multi_json (~> 1.0) - builder (3.0.4) - erubis (2.7.0) - git (1.2.5) - hike (1.2.1) - i18n (0.6.1) - jeweler (1.8.4) - bundler (~> 1.0) + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (7.0.4) + activesupport (= 7.0.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.3.6) + activesupport (7.0.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.4.0) + builder (3.2.4) + concurrent-ruby (1.1.10) + crass (1.0.6) + date (3.3.3) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + erubi (1.11.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + git (1.11.0) + rchardet (~> 1.8) + github_api (0.16.0) + addressable (~> 2.4.0) + descendants_tracker (~> 0.0.4) + faraday (~> 0.8, < 0.10) + hashie (>= 3.4) + mime-types (>= 1.16, < 3.0) + oauth2 (~> 1.0) + globalid (1.0.0) + activesupport (>= 5.0) + hashie (5.0.0) + highline (2.0.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + jeweler (2.3.9) + builder + bundler git (>= 1.2.5) + github_api (~> 0.16.0) + highline (>= 1.6.15) + nokogiri (>= 1.5.10) + psych rake rdoc - journey (1.0.4) - json (1.7.5) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.19) - multi_json (1.4.0) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-test (0.6.2) - rack (>= 1.0) - rake (10.0.2) - rdoc (3.12) - json (~> 1.4) - sprockets (2.2.2) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - tilt (1.3.3) - treetop (1.4.12) - polyglot - polyglot (>= 0.3.1) + semver2 + jwt (2.5.0) + loofah (2.19.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.8.0) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + mime-types (2.99.3) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.16.3) + multi_json (1.15.0) + multi_xml (0.6.0) + multipart-post (2.2.3) + net-imap (0.3.2) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + oauth2 (1.4.8) + faraday (>= 0.8, < 3.0) + jwt (>= 1.0, < 3.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + psych (5.0.1) + stringio + racc (1.6.1) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) + rake (13.0.6) + rchardet (1.8.0) + rdoc (6.5.0) + psych (>= 4.0.0) + semver2 (3.4.2) + stringio (3.0.4) + thread_safe (0.3.6) + timeout (0.3.1) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) PLATFORMS ruby @@ -64,3 +131,6 @@ DEPENDENCIES actionmailer (>= 2.3) activesupport (>= 2.3) jeweler + +BUNDLED WITH + 2.3.14 From 22c7a2ec1cd62df988a24c1bd2604671e1bff8e1 Mon Sep 17 00:00:00 2001 From: Simon Schoeters Date: Tue, 20 Dec 2022 13:53:55 +0100 Subject: [PATCH 4/4] Replace alias_method_chain with manual chaining --- lib/kpi/memoizable.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/kpi/memoizable.rb b/lib/kpi/memoizable.rb index 61d70ef..45bca42 100644 --- a/lib/kpi/memoizable.rb +++ b/lib/kpi/memoizable.rb @@ -11,7 +11,8 @@ module InstanceMethods def self.included(base) base.class_eval do unless base.method_defined?(:freeze_without_memoizable) - alias_method_chain :freeze, :memoizable + alias_method :freeze_without_memoizable, :freeze + alias_method :freeze, :freeze_with_memoizable end end end