From 5fc4460b5bff1d3fe3d335fd1e703a9ee2d74f1c Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:30:12 -0600 Subject: [PATCH 1/8] Add lockfiles --- .gitignore | 3 - Gemfile.lock | 150 ++++++++++++++++++++++++++++++++ gemfiles/rails_6_0.gemfile.lock | 150 ++++++++++++++++++++++++++++++++ gemfiles/rails_6_1.gemfile.lock | 149 +++++++++++++++++++++++++++++++ gemfiles/rails_7_0.gemfile.lock | 149 +++++++++++++++++++++++++++++++ 5 files changed, 598 insertions(+), 3 deletions(-) create mode 100644 Gemfile.lock create mode 100644 gemfiles/rails_6_0.gemfile.lock create mode 100644 gemfiles/rails_6_1.gemfile.lock create mode 100644 gemfiles/rails_7_0.gemfile.lock diff --git a/.gitignore b/.gitignore index dfda655..b04a8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,3 @@ # rspec failure tracking .rspec_status - -/Gemfile.lock -*.gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..977d526 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,150 @@ +PATH + remote: . + specs: + authorized_persona (0.9.1) + railties (>= 5.1.6.2, < 7.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (7.0.8) + activesupport (= 7.0.8) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activemodel (7.0.8) + activesupport (= 7.0.8) + activesupport (7.0.8) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + betterlint (1.7.0) + rubocop (> 1.0) + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec (>= 2.24) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + diff-lcs (1.5.0) + erubi (1.12.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + method_source (1.0.0) + minitest (5.20.0) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.19.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + thor (1.3.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + zeitwerk (2.6.12) + +PLATFORMS + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + activemodel (>= 5.1.6.2, < 7.1) + appraisal + authorized_persona! + betterlint + bundler + rake + rspec (~> 3.0) + +BUNDLED WITH + 2.4.21 diff --git a/gemfiles/rails_6_0.gemfile.lock b/gemfiles/rails_6_0.gemfile.lock new file mode 100644 index 0000000..54e1fb5 --- /dev/null +++ b/gemfiles/rails_6_0.gemfile.lock @@ -0,0 +1,150 @@ +PATH + remote: .. + specs: + authorized_persona (0.9.1) + railties (>= 5.1.6.2, < 7.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (6.0.6.1) + actionview (= 6.0.6.1) + activesupport (= 6.0.6.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (6.0.6.1) + activesupport (= 6.0.6.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activemodel (6.0.6.1) + activesupport (= 6.0.6.1) + activesupport (6.0.6.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + betterlint (1.7.0) + rubocop (> 1.0) + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec (>= 2.24) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + diff-lcs (1.5.0) + erubi (1.12.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + method_source (1.0.0) + minitest (5.20.0) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.0.6.1) + actionpack (= 6.0.6.1) + activesupport (= 6.0.6.1) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.19.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + thor (1.3.0) + thread_safe (0.3.6) + tzinfo (1.2.11) + thread_safe (~> 0.1) + unicode-display_width (2.5.0) + zeitwerk (2.6.12) + +PLATFORMS + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + activemodel (~> 6.0.0) + appraisal + authorized_persona! + betterlint + bundler + railties (~> 6.0.0) + rake + rspec (~> 3.0) + +BUNDLED WITH + 2.4.21 diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock new file mode 100644 index 0000000..5954e9a --- /dev/null +++ b/gemfiles/rails_6_1.gemfile.lock @@ -0,0 +1,149 @@ +PATH + remote: .. + specs: + authorized_persona (0.9.1) + railties (>= 5.1.6.2, < 7.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activesupport (6.1.7.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + betterlint (1.7.0) + rubocop (> 1.0) + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec (>= 2.24) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + diff-lcs (1.5.0) + erubi (1.12.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + method_source (1.0.0) + minitest (5.20.0) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) + method_source + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.19.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + thor (1.3.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + zeitwerk (2.6.12) + +PLATFORMS + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + activemodel (~> 6.1.0) + appraisal + authorized_persona! + betterlint + bundler + railties (~> 6.1.0) + rake + rspec (~> 3.0) + +BUNDLED WITH + 2.4.21 diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock new file mode 100644 index 0000000..343049d --- /dev/null +++ b/gemfiles/rails_7_0.gemfile.lock @@ -0,0 +1,149 @@ +PATH + remote: .. + specs: + authorized_persona (0.9.1) + railties (>= 5.1.6.2, < 7.1) + +GEM + remote: https://rubygems.org/ + specs: + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (7.0.8) + activesupport (= 7.0.8) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activemodel (7.0.8) + activesupport (= 7.0.8) + activesupport (7.0.8) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + betterlint (1.7.0) + rubocop (> 1.0) + rubocop-performance + rubocop-rails + rubocop-rake + rubocop-rspec (>= 2.24) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + diff-lcs (1.5.0) + erubi (1.12.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + method_source (1.0.0) + minitest (5.20.0) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + parallel (1.24.0) + parser (3.2.2.4) + ast (~> 2.4.1) + racc + racc (1.7.3) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.1.0) + regexp_parser (2.8.3) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + rubocop (1.59.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.2.2.4) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.30.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.19.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.24.0) + rubocop (~> 1.33) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + ruby-progressbar (1.13.0) + thor (1.3.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + zeitwerk (2.6.12) + +PLATFORMS + x86_64-darwin-22 + x86_64-linux + +DEPENDENCIES + activemodel (~> 7.0.0) + appraisal + authorized_persona! + betterlint + bundler + railties (~> 7.0.0) + rake + rspec (~> 3.0) + +BUNDLED WITH + 2.4.21 From 3eaa19f84b6673b682f4accc943d47ce8418acbf Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:34:31 -0600 Subject: [PATCH 2/8] Update ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a45704..66a8c4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ jobs: matrix: ruby: ['2.7', '3.0'] gemfile: - - gemfiles/rails_6_0.gemfile - gemfiles/rails_6_1.gemfile - gemfiles/rails_7_0.gemfile steps: From 3b4c6474d1ce3a28b2961ffda70eba90a0a368d4 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:35:52 -0600 Subject: [PATCH 3/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66a8c4d..64981eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0'] + ruby: ['3.0'] gemfile: - gemfiles/rails_6_1.gemfile - gemfiles/rails_7_0.gemfile From 41fb6a79e0689160b670418ed13bdf84cc29fc24 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:40:08 -0600 Subject: [PATCH 4/8] rubocop --only Style/FrozenStringLiteralComment -A --- Appraisals | 5 +---- Rakefile | 2 ++ authorized_persona.gemspec | 2 ++ gemfiles/rails_6_1.gemfile | 2 ++ gemfiles/rails_7_0.gemfile | 2 ++ lib/authorized_persona.rb | 2 ++ lib/authorized_persona/authorization.rb | 2 ++ lib/authorized_persona/persona.rb | 2 ++ lib/authorized_persona/railtie.rb | 2 ++ lib/authorized_persona/version.rb | 2 ++ lib/authorized_persona/view_helpers.rb | 2 ++ spec/authorized_persona/authorization_spec.rb | 2 ++ spec/authorized_persona/persona_spec.rb | 2 ++ spec/authorized_persona/view_helpers_spec.rb | 2 ++ spec/authorized_persona_spec.rb | 2 ++ spec/spec_helper.rb | 2 ++ 16 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Appraisals b/Appraisals index eace368..9964d7d 100644 --- a/Appraisals +++ b/Appraisals @@ -1,7 +1,4 @@ -appraise 'rails-6-0' do - gem 'railties', '~> 6.0.0' - gem 'activemodel', '~>6.0.0' -end +# frozen_string_literal: true appraise 'rails-6-1' do gem 'railties', '~> 6.1.0' diff --git a/Rakefile b/Rakefile index 13ee442..599fadd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/authorized_persona.gemspec b/authorized_persona.gemspec index d365d93..69b33bf 100644 --- a/authorized_persona.gemspec +++ b/authorized_persona.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "authorized_persona/version" diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index fa7eeab..9c9d00e 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index 04c6ab0..a259240 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/lib/authorized_persona.rb b/lib/authorized_persona.rb index ecca70b..68ab4cc 100644 --- a/lib/authorized_persona.rb +++ b/lib/authorized_persona.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "authorized_persona/version" require "rails" diff --git a/lib/authorized_persona/authorization.rb b/lib/authorized_persona/authorization.rb index 9c58b21..1c4b44a 100644 --- a/lib/authorized_persona/authorization.rb +++ b/lib/authorized_persona/authorization.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizedPersona module Authorization extend ActiveSupport::Concern diff --git a/lib/authorized_persona/persona.rb b/lib/authorized_persona/persona.rb index 9fe95f9..4b5ba84 100644 --- a/lib/authorized_persona/persona.rb +++ b/lib/authorized_persona/persona.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizedPersona module Persona extend ActiveSupport::Concern diff --git a/lib/authorized_persona/railtie.rb b/lib/authorized_persona/railtie.rb index d8f9d99..c09f844 100644 --- a/lib/authorized_persona/railtie.rb +++ b/lib/authorized_persona/railtie.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizedPersona class Railtie < Rails::Railtie initializer "authorized_persona.view_helpers" do diff --git a/lib/authorized_persona/version.rb b/lib/authorized_persona/version.rb index 76d6367..24db2ee 100644 --- a/lib/authorized_persona/version.rb +++ b/lib/authorized_persona/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizedPersona VERSION = "0.9.1".freeze end diff --git a/lib/authorized_persona/view_helpers.rb b/lib/authorized_persona/view_helpers.rb index b824818..e42f273 100644 --- a/lib/authorized_persona/view_helpers.rb +++ b/lib/authorized_persona/view_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AuthorizedPersona module ViewHelpers def authorized_to?(action, resource) diff --git a/spec/authorized_persona/authorization_spec.rb b/spec/authorized_persona/authorization_spec.rb index 0b18163..7c8cbe3 100644 --- a/spec/authorized_persona/authorization_spec.rb +++ b/spec/authorized_persona/authorization_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe AuthorizedPersona::Authorization do diff --git a/spec/authorized_persona/persona_spec.rb b/spec/authorized_persona/persona_spec.rb index 4a1db91..4067b40 100644 --- a/spec/authorized_persona/persona_spec.rb +++ b/spec/authorized_persona/persona_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe AuthorizedPersona::Persona do diff --git a/spec/authorized_persona/view_helpers_spec.rb b/spec/authorized_persona/view_helpers_spec.rb index ccb461f..aa3c5fe 100644 --- a/spec/authorized_persona/view_helpers_spec.rb +++ b/spec/authorized_persona/view_helpers_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe AuthorizedPersona::ViewHelpers do diff --git a/spec/authorized_persona_spec.rb b/spec/authorized_persona_spec.rb index 96e99fe..9085a75 100644 --- a/spec/authorized_persona_spec.rb +++ b/spec/authorized_persona_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe AuthorizedPersona do it "has a version number" do expect(AuthorizedPersona::VERSION).not_to be_nil diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1af9d06..c0c4ef6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" require "active_model" require "authorized_persona" From 6d8bc1361fec3ff1f7c883e0d68c540e98ff9491 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:40:47 -0600 Subject: [PATCH 5/8] rubocop --only Performance/StringIdentifierArgument -a --- lib/authorized_persona/persona.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/authorized_persona/persona.rb b/lib/authorized_persona/persona.rb index 4b5ba84..04164f4 100644 --- a/lib/authorized_persona/persona.rb +++ b/lib/authorized_persona/persona.rb @@ -49,7 +49,7 @@ def authorization_tiers(tiers) # rubocop:disable Metrics/AbcSize instance_methods.module_eval do tiers.keys.each do |tier| - define_method "#{tier}_or_above?" do + define_method :"#{tier}_or_above?" do authorization_tier_at_or_above?(tier) end end @@ -61,7 +61,7 @@ def authorization_tiers(tiers) # rubocop:disable Metrics/AbcSize class_methods.module_eval do tiers.keys.each do |tier| - define_method "#{tier}_or_above" do + define_method :"#{tier}_or_above" do with_authorization_tier_at_or_above(tier) end end From 05bc3e292bb38efef8e92d6291a710a349c55e80 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:41:29 -0600 Subject: [PATCH 6/8] rubocop --only Style/RedundantFreeze -a --- lib/authorized_persona/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/authorized_persona/version.rb b/lib/authorized_persona/version.rb index 24db2ee..1ae251d 100644 --- a/lib/authorized_persona/version.rb +++ b/lib/authorized_persona/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module AuthorizedPersona - VERSION = "0.9.1".freeze + VERSION = "0.9.1" end From 6dcc247805681c437d787b579e78e634c7fdfa22 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:09:48 -0600 Subject: [PATCH 7/8] Address Ruby 3.2 lint offenses --- authorized_persona.gemspec | 2 +- lib/authorized_persona/authorization.rb | 2 +- lib/authorized_persona/view_helpers.rb | 2 +- spec/authorized_persona/view_helpers_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/authorized_persona.gemspec b/authorized_persona.gemspec index 69b33bf..9ae33e7 100644 --- a/authorized_persona.gemspec +++ b/authorized_persona.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| # 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. - spec.files = Dir.chdir(File.expand_path(__dir__)) do + spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end spec.bindir = "exe" diff --git a/lib/authorized_persona/authorization.rb b/lib/authorized_persona/authorization.rb index 1c4b44a..0e5a746 100644 --- a/lib/authorized_persona/authorization.rb +++ b/lib/authorized_persona/authorization.rb @@ -59,7 +59,7 @@ def authorization_persona def authorized?(current_user:, action:) raise AuthorizedPersona::Error, "#{current_user} is not a #{authorization_persona}" unless current_user.is_a?(authorization_persona) - current_user.authorization_tier_at_or_above?(authorized_tier(action: action)) + current_user.authorization_tier_at_or_above?(authorized_tier(action:)) end def authorized_tier(action:) diff --git a/lib/authorized_persona/view_helpers.rb b/lib/authorized_persona/view_helpers.rb index e42f273..327cd65 100644 --- a/lib/authorized_persona/view_helpers.rb +++ b/lib/authorized_persona/view_helpers.rb @@ -7,7 +7,7 @@ def authorized_to?(action, resource) raise AuthorizedPersona::Error, "Unable to determine route for #{resource}" if route.nil? controller_class = (route.defaults[:controller].camelize + 'Controller').constantize - controller_class.authorized?(current_user: authorization_current_user, action: action) + controller_class.authorized?(current_user: authorization_current_user, action:) end end end diff --git a/spec/authorized_persona/view_helpers_spec.rb b/spec/authorized_persona/view_helpers_spec.rb index aa3c5fe..564c77f 100644 --- a/spec/authorized_persona/view_helpers_spec.rb +++ b/spec/authorized_persona/view_helpers_spec.rb @@ -13,7 +13,7 @@ def authorization_current_user end end - let(:rails_app) { instance_double(Rails::Application, routes: routes) } + let(:rails_app) { instance_double(Rails::Application, routes:) } let(:routes) { instance_double(ActionDispatch::Routing::RouteSet, named_routes: { foo: route }) } let(:route) { instance_double(ActionDispatch::Journey::Route, defaults: { controller: "foos" }) } From b5d4f1610950921cbf8f026a7030cfc831185a77 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:33:51 -0600 Subject: [PATCH 8/8] Drop support for Ruby <3.0 and Rails < 6.1 (EOL versions) --- .github/workflows/ci.yml | 2 +- .rubocop.yml | 3 + .ruby-version | 2 +- Gemfile.lock | 6 +- authorized_persona.gemspec | 5 +- gemfiles/rails_6_0.gemfile | 8 - gemfiles/rails_6_0.gemfile.lock | 150 ------------------- gemfiles/rails_6_1.gemfile.lock | 4 +- gemfiles/rails_7_0.gemfile.lock | 4 +- lib/authorized_persona/authorization.rb | 2 +- lib/authorized_persona/version.rb | 2 +- lib/authorized_persona/view_helpers.rb | 2 +- spec/authorized_persona/view_helpers_spec.rb | 2 +- 13 files changed, 19 insertions(+), 173 deletions(-) delete mode 100644 gemfiles/rails_6_0.gemfile delete mode 100644 gemfiles/rails_6_0.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64981eb..5c38129 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.0'] + ruby: ['3.0', '3.2'] gemfile: - gemfiles/rails_6_1.gemfile - gemfiles/rails_7_0.gemfile diff --git a/.rubocop.yml b/.rubocop.yml index ccf896d..906ab18 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,3 +3,6 @@ inherit_from: .rubocop_todo.yml inherit_gem: betterlint: - config/default.yml + +AllCops: + TargetRubyVersion: 3.0 diff --git a/.ruby-version b/.ruby-version index 818bd47..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 +3.2.2 diff --git a/Gemfile.lock b/Gemfile.lock index 977d526..1a4f644 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - authorized_persona (0.9.1) - railties (>= 5.1.6.2, < 7.1) + authorized_persona (0.10.0) + railties (>= 6.1, < 7.1) GEM remote: https://rubygems.org/ @@ -138,7 +138,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - activemodel (>= 5.1.6.2, < 7.1) + activemodel (>= 6.1, < 7.1) appraisal authorized_persona! betterlint diff --git a/authorized_persona.gemspec b/authorized_persona.gemspec index 9ae33e7..879b501 100644 --- a/authorized_persona.gemspec +++ b/authorized_persona.gemspec @@ -13,7 +13,8 @@ Gem::Specification.new do |spec| spec.summary = "the simplest authorization library you will ever love" spec.description = "AuthorizedPersona is a rails implementation of Betterment's Persona Centric Authorization pattern" spec.homepage = "https://github.com/Betterment/authorized_persona" - spec.license = "MIT" + spec.license = "MIT" + spec.required_ruby_version = ">= 3.0" # 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. @@ -24,7 +25,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - rails_version_range = [">= 5.1.6.2", "< 7.1"] + rails_version_range = [">= 6.1", "< 7.1"] spec.add_dependency "railties", *rails_version_range diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile deleted file mode 100644 index 86c251f..0000000 --- a/gemfiles/rails_6_0.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activemodel", "~>6.0.0" -gem "railties", "~> 6.0.0" - -gemspec path: "../" diff --git a/gemfiles/rails_6_0.gemfile.lock b/gemfiles/rails_6_0.gemfile.lock deleted file mode 100644 index 54e1fb5..0000000 --- a/gemfiles/rails_6_0.gemfile.lock +++ /dev/null @@ -1,150 +0,0 @@ -PATH - remote: .. - specs: - authorized_persona (0.9.1) - railties (>= 5.1.6.2, < 7.1) - -GEM - remote: https://rubygems.org/ - specs: - actionpack (6.0.6.1) - actionview (= 6.0.6.1) - activesupport (= 6.0.6.1) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (6.0.6.1) - activesupport (= 6.0.6.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activemodel (6.0.6.1) - activesupport (= 6.0.6.1) - activesupport (6.0.6.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - appraisal (2.5.0) - bundler - rake - thor (>= 0.14.0) - ast (2.4.2) - betterlint (1.7.0) - rubocop (> 1.0) - rubocop-performance - rubocop-rails - rubocop-rake - rubocop-rspec (>= 2.24) - builder (3.2.4) - concurrent-ruby (1.2.2) - crass (1.0.6) - diff-lcs (1.5.0) - erubi (1.12.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - json (2.7.1) - language_server-protocol (3.17.0.3) - loofah (2.22.0) - crass (~> 1.0.2) - nokogiri (>= 1.12.0) - method_source (1.0.0) - minitest (5.20.0) - nokogiri (1.15.5-x86_64-darwin) - racc (~> 1.4) - parallel (1.24.0) - parser (3.2.2.4) - ast (~> 2.4.1) - racc - racc (1.7.3) - rack (2.2.8) - rack-test (2.1.0) - rack (>= 1.3) - rails-dom-testing (2.2.0) - activesupport (>= 5.0.0) - minitest - nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (6.0.6.1) - actionpack (= 6.0.6.1) - activesupport (= 6.0.6.1) - method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) - rainbow (3.1.1) - rake (13.1.0) - regexp_parser (2.8.3) - rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.59.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.2.2.4) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-performance (1.20.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.23.1) - activesupport (>= 4.2.0) - rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rake (0.6.0) - rubocop (~> 1.0) - rubocop-rspec (2.25.0) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - ruby-progressbar (1.13.0) - thor (1.3.0) - thread_safe (0.3.6) - tzinfo (1.2.11) - thread_safe (~> 0.1) - unicode-display_width (2.5.0) - zeitwerk (2.6.12) - -PLATFORMS - x86_64-darwin-22 - x86_64-linux - -DEPENDENCIES - activemodel (~> 6.0.0) - appraisal - authorized_persona! - betterlint - bundler - railties (~> 6.0.0) - rake - rspec (~> 3.0) - -BUNDLED WITH - 2.4.21 diff --git a/gemfiles/rails_6_1.gemfile.lock b/gemfiles/rails_6_1.gemfile.lock index 5954e9a..dc35c5e 100644 --- a/gemfiles/rails_6_1.gemfile.lock +++ b/gemfiles/rails_6_1.gemfile.lock @@ -1,8 +1,8 @@ PATH remote: .. specs: - authorized_persona (0.9.1) - railties (>= 5.1.6.2, < 7.1) + authorized_persona (0.10.0) + railties (>= 6.1, < 7.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails_7_0.gemfile.lock b/gemfiles/rails_7_0.gemfile.lock index 343049d..2baaaa1 100644 --- a/gemfiles/rails_7_0.gemfile.lock +++ b/gemfiles/rails_7_0.gemfile.lock @@ -1,8 +1,8 @@ PATH remote: .. specs: - authorized_persona (0.9.1) - railties (>= 5.1.6.2, < 7.1) + authorized_persona (0.10.0) + railties (>= 6.1, < 7.1) GEM remote: https://rubygems.org/ diff --git a/lib/authorized_persona/authorization.rb b/lib/authorized_persona/authorization.rb index 0e5a746..1c4b44a 100644 --- a/lib/authorized_persona/authorization.rb +++ b/lib/authorized_persona/authorization.rb @@ -59,7 +59,7 @@ def authorization_persona def authorized?(current_user:, action:) raise AuthorizedPersona::Error, "#{current_user} is not a #{authorization_persona}" unless current_user.is_a?(authorization_persona) - current_user.authorization_tier_at_or_above?(authorized_tier(action:)) + current_user.authorization_tier_at_or_above?(authorized_tier(action: action)) end def authorized_tier(action:) diff --git a/lib/authorized_persona/version.rb b/lib/authorized_persona/version.rb index 1ae251d..f24a9c7 100644 --- a/lib/authorized_persona/version.rb +++ b/lib/authorized_persona/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module AuthorizedPersona - VERSION = "0.9.1" + VERSION = "0.10.0" end diff --git a/lib/authorized_persona/view_helpers.rb b/lib/authorized_persona/view_helpers.rb index 327cd65..e42f273 100644 --- a/lib/authorized_persona/view_helpers.rb +++ b/lib/authorized_persona/view_helpers.rb @@ -7,7 +7,7 @@ def authorized_to?(action, resource) raise AuthorizedPersona::Error, "Unable to determine route for #{resource}" if route.nil? controller_class = (route.defaults[:controller].camelize + 'Controller').constantize - controller_class.authorized?(current_user: authorization_current_user, action:) + controller_class.authorized?(current_user: authorization_current_user, action: action) end end end diff --git a/spec/authorized_persona/view_helpers_spec.rb b/spec/authorized_persona/view_helpers_spec.rb index 564c77f..aa3c5fe 100644 --- a/spec/authorized_persona/view_helpers_spec.rb +++ b/spec/authorized_persona/view_helpers_spec.rb @@ -13,7 +13,7 @@ def authorization_current_user end end - let(:rails_app) { instance_double(Rails::Application, routes:) } + let(:rails_app) { instance_double(Rails::Application, routes: routes) } let(:routes) { instance_double(ActionDispatch::Routing::RouteSet, named_routes: { foo: route }) } let(:route) { instance_double(ActionDispatch::Journey::Route, defaults: { controller: "foos" }) }