From 1722e9cb646026603f3f25a1233c67c9fa8e7697 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 18 Dec 2024 06:07:15 -0500 Subject: [PATCH 1/5] feat: add status? and active? to funds --- lib/faithteams/api/v2/entity/fund.rb | 10 ++++++++ spec/faithteams/api/v2/entity/fund_spec.rb | 30 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/lib/faithteams/api/v2/entity/fund.rb b/lib/faithteams/api/v2/entity/fund.rb index a718886..75a5aa2 100644 --- a/lib/faithteams/api/v2/entity/fund.rb +++ b/lib/faithteams/api/v2/entity/fund.rb @@ -11,6 +11,11 @@ def default read_attribute(:isDefault).presence end + # @return [Boolean] + def default? + default == "Y" + end + # @return [String, nil] def description read_attribute(:description).presence @@ -41,6 +46,11 @@ def status read_attribute(:status).presence end + # @return [Boolean] + def active? + status == "A" + end + # @return [String, nil] "T" for true?, "Y" for yes? def tax_deductible read_attribute(:taxDeductible).presence diff --git a/spec/faithteams/api/v2/entity/fund_spec.rb b/spec/faithteams/api/v2/entity/fund_spec.rb index 43013dd..9294660 100644 --- a/spec/faithteams/api/v2/entity/fund_spec.rb +++ b/spec/faithteams/api/v2/entity/fund_spec.rb @@ -22,6 +22,21 @@ end end + describe "#default?" do + context "when default is 'Y'" do + it "returns true" do + fund = described_class.new(attributes: { "isDefault" => "Y" }) + expect(fund).to be_default + end + end + + context "when default isn't 'Y'" do + it "returns false" do + expect(fund).not_to be_default + end + end + end + describe "description" do it "is a String" do expect(fund.description).to be_instance_of(String) @@ -64,6 +79,21 @@ end end + describe "#active?" do + context "when status is 'A'" do + it "returns true" do + expect(fund).to be_active + end + end + + context "when status isn't 'A'" do + it "returns false" do + fund = described_class.new(attributes: { "status" => "I" }) + expect(fund).not_to be_active + end + end + end + describe "tax_deductible" do it "is a String" do expect(fund.tax_deductible).to be_instance_of(String) From e44a4046d9367d622f160fea294553085fabe9a3 Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 18 Dec 2024 06:08:30 -0500 Subject: [PATCH 2/5] docs: update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a2cb1..29705e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file. 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). +## [Unreleased] + +### Added + +1. Adds `Entity::Fund` `active?` and `default?` interrogatives + ## [3.0.1] - 2024-09-09 ### Changed From 0f325ce7c9ad3943cbc744a43303beb67f9d851c Mon Sep 17 00:00:00 2001 From: Max VelDink Date: Wed, 18 Dec 2024 06:17:04 -0500 Subject: [PATCH 3/5] chore(security): bump deps --- Gemfile.lock | 89 ++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 70f9bce..6a761ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,38 +9,42 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.2) + activesupport (7.1.5.1) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.7) + benchmark (0.4.0) + bigdecimal (3.1.8) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crack (1.0.0) bigdecimal rexml diff-lcs (1.5.1) - docile (1.4.0) + docile (1.4.1) domain_name (0.6.20240107) drb (2.2.1) - ffi (1.16.3) + ffi (1.17.0) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake formatador (1.1.0) - guard (2.18.1) + guard (2.19.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) @@ -54,19 +58,19 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - hashdiff (1.1.0) + hashdiff (1.1.2) http (5.2.0) addressable (~> 2.8) base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) llhttp-ffi (~> 0.5.0) - http-cookie (1.0.5) + http-cookie (1.0.8) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.4) + i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.7.1) + json (2.9.0) language_server-protocol (3.17.0.3) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -74,57 +78,57 @@ GEM llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) + logger (1.6.3) lumberjack (1.2.10) - method_source (1.0.0) - minitest (5.22.3) - mutex_m (0.2.0) + method_source (1.1.0) + minitest (5.25.4) + mutex_m (0.3.0) nenv (0.3.0) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - parallel (1.24.0) - parser (3.3.0.5) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) racc - pry (0.14.2) + pry (0.15.0) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.5) - racc (1.7.3) + public_suffix (6.0.1) + racc (1.8.1) rainbow (3.1.1) - rake (13.2.0) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - regexp_parser (2.9.0) - rexml (3.3.7) + regexp_parser (2.9.3) + rexml (3.3.9) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.2) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.1) - rubocop (1.62.1) + rspec-support (3.13.2) + rubocop (1.69.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-performance (1.21.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-performance (1.23.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) @@ -132,22 +136,25 @@ GEM rubocop-rspec (1.42.0) rubocop (>= 0.87.0) ruby-progressbar (1.13.0) + securerandom (0.3.2) shellany (0.0.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - thor (1.3.1) + thor (1.3.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) - webmock (3.23.0) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + webmock (3.24.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - yard (0.9.36) + yard (0.9.37) PLATFORMS ruby From e905e864ade8f39bdb7d76636e58dff0af4043e3 Mon Sep 17 00:00:00 2001 From: Thomas Reeves Date: Wed, 18 Dec 2024 14:28:23 -0800 Subject: [PATCH 4/5] Prepare for major release --- Gemfile.lock | 2 +- lib/faithteams/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 70f9bce..2e9afee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - faithteams-api (3.0.1) + faithteams-api (4.1.1) activesupport (>= 6.1.7) http (~> 5.1) rexml (~> 3.3.6) diff --git a/lib/faithteams/version.rb b/lib/faithteams/version.rb index 880efe3..487988c 100644 --- a/lib/faithteams/version.rb +++ b/lib/faithteams/version.rb @@ -2,5 +2,5 @@ module FaithTeams # Current version number. - VERSION = "3.0.1" + VERSION = "4.1.1" end From 175a6576a4bca726d1af00720e13b350703ee6e4 Mon Sep 17 00:00:00 2001 From: Thomas Reeves Date: Wed, 18 Dec 2024 15:40:35 -0800 Subject: [PATCH 5/5] Support 7.1.5.1 activesupport --- Gemfile.lock | 7 +++++-- faithteams-api.gemspec | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 25134c2..acb8493 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: faithteams-api (4.1.1) - activesupport (~> 7.0.8) + activesupport (>= 7.0.8, <= 7.1.5.1) http (~> 5.1) logger (~> 1.6.1) ostruct (~> 0.6.0) @@ -16,6 +16,8 @@ GEM benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) logger (>= 1.4.2) minitest (>= 5.1) @@ -87,6 +89,7 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) + ostruct (0.6.1) parallel (1.26.3) parser (3.3.6.0) ast (~> 2.4.1) @@ -136,7 +139,7 @@ GEM rubocop-rspec (1.42.0) rubocop (>= 0.87.0) ruby-progressbar (1.13.0) - securerandom (0.3.2) + securerandom (0.4.1) shellany (0.0.1) simplecov (0.22.0) docile (~> 1.1) diff --git a/faithteams-api.gemspec b/faithteams-api.gemspec index 2d32e2e..7fbf842 100644 --- a/faithteams-api.gemspec +++ b/faithteams-api.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "activesupport", "~> 7.0.8" + spec.add_dependency "activesupport", ">= 7.0.8", "<= 7.1.5.1" spec.add_dependency "http", "~> 5.1" spec.add_dependency "logger", "~> 1.6.1" spec.add_dependency "ostruct", "~> 0.6.0"