diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d19a3bf..5849899 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -23,7 +23,7 @@ jobs: matrix: # Use `rbenv install -l` and only use the latest stable # version of ruby. - ruby-version: ["3.0.1", "3.0.6", "3.1.4", "3.2.2"] + ruby-version: ["3.2.8", "3.3.8", "3.4.2"] steps: - uses: actions/checkout@v3 @@ -33,9 +33,8 @@ jobs: run: date - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): - # uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + # see https://github.com/ruby/setup-ruby#versioning. + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically diff --git a/.ruby-version b/.ruby-version index cb2b00e..4d9d11c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.1 +3.4.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eebb06..3b9bda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### 6.0.0 2025-07-09 + +* Breaking changes + * Remove support for Ruby versions < 3.2.8.> + * Minimum Ruby version is now 3.2.8 +* Other Changes + * Update gems. + * Add 'observer' gem to dependencies. + ### 5.0.13 2024-08-03 * Changes @@ -42,20 +51,24 @@ * Ruby gem updates. ### 5.0.4 -* changes +* Changes * Fix README.md erroneous references to WordResults#successful? (should be #success?) * Gem update. + ### 5.0.3 -* changes +* Changes * Update gems to patch CVE. + ### 5.0.2 -* changes +* Changes * Update gems. + ### 5.0.1 -* bug fix +* Bug Fix * Fix error loading support files in LittleWeasel.rb. + ### 5.0.0 -* changes +* Changes * Add spec coverage where lacking. * Remove unused DictionaryLoaderService and associated modules, specs, factories. * Refactor Locale, Language and Region modules to simplify. @@ -63,27 +76,27 @@ half-baked in 4.0.0. * DeprecateDictionaryCacheService#dictionary_exists? (plural); add typical DeprecateDictionaryCacheService#dictionary_exist? method in its palce. * Update rake gem version to eliminate command injection vulerability. - * Change description and summary reflecting 4.0.0 changes. + * Change description and summary reflecting 4.0.0 Changes. * Various reek gem violation fixes/suppressions where reasonable. * Fix most rubocop violations. ### 4.0.0 -* enhancements +* Enhancements * Complete overhaul; see README.md ### 3.0.4 -* enhancements +* Enhancements * Relax requirements on ruby version to ~> 2.0. ### 3.0.3 -* enhancements +* Enhancements * Add single_word_mode option (default: false); when single_word_mode: true, LittleWeasel::Checker.instance.exists? will return false, if more than one word is being checked for existance. ### 3.0.2 -* enhancements +* Enhancements * None -* bug fix +* Bug Fix * Calling #exists? no longer alters the original input. diff --git a/Gemfile.lock b/Gemfile.lock index 4832db6..f2bf066 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,136 +1,150 @@ PATH remote: . specs: - LittleWeasel (5.0.13) + LittleWeasel (6.0.0) activesupport (>= 7.0.8, < 8.0) + observer (~> 0.1) GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.4) + activesupport (7.2.2.1) base64 + benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - ast (2.4.2) - base64 (0.2.0) - benchmark-ips (2.13.0) - bigdecimal (3.1.8) - byebug (11.1.3) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + ast (2.4.3) + base64 (0.3.0) + benchmark (0.4.1) + benchmark-ips (2.14.0) + bigdecimal (3.2.2) + byebug (12.0.0) coderay (1.1.3) - concurrent-ruby (1.3.3) - connection_pool (2.4.1) - diff-lcs (1.5.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + diff-lcs (1.6.2) docile (1.4.1) - drb (2.2.1) - dry-configurable (1.2.0) - dry-core (~> 1.0, < 2) + drb (2.2.3) + dry-configurable (1.3.0) + dry-core (~> 1.1) zeitwerk (~> 2.6) - dry-core (1.0.1) + dry-core (1.1.0) concurrent-ruby (~> 1.0) + logger zeitwerk (~> 2.6) - dry-inflector (1.1.0) - dry-initializer (3.1.1) - dry-logic (1.5.0) + dry-inflector (1.2.0) + dry-initializer (3.2.0) + dry-logic (1.6.0) + bigdecimal concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) + dry-core (~> 1.1) zeitwerk (~> 2.6) - dry-schema (1.13.4) + dry-schema (1.14.1) concurrent-ruby (~> 1.0) dry-configurable (~> 1.0, >= 1.0.1) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-logic (>= 1.4, < 2) - dry-types (>= 1.7, < 2) + dry-core (~> 1.1) + dry-initializer (~> 3.2) + dry-logic (~> 1.5) + dry-types (~> 1.8) zeitwerk (~> 2.6) - dry-types (1.7.2) + dry-types (1.8.3) bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0) dry-inflector (~> 1.0) dry-logic (~> 1.4) zeitwerk (~> 2.6) - factory_bot (6.4.6) - activesupport (>= 5.0.0) - i18n (1.14.5) + factory_bot (6.5.4) + activesupport (>= 6.1.0) + i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.7.2) - language_server-protocol (3.17.0.3) + json (2.12.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) method_source (1.1.0) - minitest (5.24.1) - mutex_m (0.2.0) - parallel (1.25.1) - parser (3.3.4.0) + minitest (5.25.5) + observer (0.1.2) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) racc - pry (0.14.2) + prism (1.4.0) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) + pry-byebug (3.11.0) + byebug (~> 12.0) + pry (>= 0.13, < 0.16) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) - redcarpet (3.6.0) - reek (6.3.0) - dry-schema (~> 1.13.0) + rake (13.3.0) + redcarpet (3.6.1) + reek (6.5.0) + dry-schema (~> 1.13) + logger (~> 1.6) parser (~> 3.3.0) rainbow (>= 2.0, < 4.0) rexml (~> 3.1) - regexp_parser (2.9.2) - rexml (3.3.4) - strscan - rspec (3.13.0) + regexp_parser (2.10.0) + rexml (3.4.1) + rspec (3.13.1) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.5) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.1) + rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.1) - rubocop (1.65.1) + rspec-support (3.13.4) + rubocop (1.78.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 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.45.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) - parser (>= 3.3.1.0) - rubocop-performance (1.21.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.0.3) - rubocop (~> 1.61) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.45.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-performance (1.25.0) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rspec (3.6.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) + securerandom (0.4.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) - strscan (3.1.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) - webrick (1.8.1) - yard (0.9.36) - zeitwerk (2.6.17) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + webrick (1.9.1) + yard (0.9.37) + zeitwerk (2.7.3) PLATFORMS ruby diff --git a/LittleWeasel.gemspec b/LittleWeasel.gemspec index 0f9e230..2c386f7 100644 --- a/LittleWeasel.gemspec +++ b/LittleWeasel.gemspec @@ -19,7 +19,8 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.required_ruby_version = Gem::Requirement.new('>= 3.0.1', '< 4.0') + spec.required_ruby_version = Gem::Requirement.new('>= 3.2.8', '< 4.0') spec.add_runtime_dependency 'activesupport', '>= 7.0.8', '< 8.0' + spec.add_runtime_dependency 'observer', '~> 0.1' end diff --git a/lib/LittleWeasel/metadata/invalid_words_metadata.rb b/lib/LittleWeasel/metadata/invalid_words_metadata.rb index bf55584..340ce0f 100644 --- a/lib/LittleWeasel/metadata/invalid_words_metadata.rb +++ b/lib/LittleWeasel/metadata/invalid_words_metadata.rb @@ -80,7 +80,7 @@ def refresh(params: nil) # This method is called when a word is being searched in the # dictionary. - def word_search(params:) + def word_search(params:) # rubocop:disable Naming/PredicateMethod word_results = params[:word_results] # TODO: NOW: Should we be returning #word_valid? or #success? diff --git a/lib/LittleWeasel/metadata/invalid_words_service_results.rb b/lib/LittleWeasel/metadata/invalid_words_service_results.rb index 4a87271..60859b7 100644 --- a/lib/LittleWeasel/metadata/invalid_words_service_results.rb +++ b/lib/LittleWeasel/metadata/invalid_words_service_results.rb @@ -10,7 +10,6 @@ class InvalidWordsServiceResults def initialize(max_invalid_words_bytesize_on:, current_invalid_word_bytesize:, max_invalid_words_bytesize:) - self.max_invalid_words_bytesize_on = max_invalid_words_bytesize_on self.current_invalid_word_bytesize = current_invalid_word_bytesize self.max_invalid_words_bytesize = max_invalid_words_bytesize diff --git a/lib/LittleWeasel/metadata/metadatable.rb b/lib/LittleWeasel/metadata/metadatable.rb index 1634270..cc8f0b9 100644 --- a/lib/LittleWeasel/metadata/metadatable.rb +++ b/lib/LittleWeasel/metadata/metadatable.rb @@ -7,8 +7,7 @@ module LittleWeasel module Metadata # This module defines methods to support objects that manage other objects # that manage metadata related to a dictionary/ies. - # rubocop: disable Lint/UnusedMethodArgument, ignored - Methods in this - # module need to keep their argument names because of specs. + # rubocop: disable Lint/UnusedMethodArgument -- Methods in this module need to keep their argument names because of specs. module Metadatable def self.included(base) base.extend ClassMethods diff --git a/lib/LittleWeasel/version.rb b/lib/LittleWeasel/version.rb index 1f38596..42dfc46 100644 --- a/lib/LittleWeasel/version.rb +++ b/lib/LittleWeasel/version.rb @@ -2,5 +2,5 @@ # The version of this gem module LittleWeasel - VERSION = '5.0.13' + VERSION = '6.0.0' end diff --git a/lib/LittleWeasel/word_results.rb b/lib/LittleWeasel/word_results.rb index 97330be..65312dc 100644 --- a/lib/LittleWeasel/word_results.rb +++ b/lib/LittleWeasel/word_results.rb @@ -37,7 +37,6 @@ class WordResults # :reek:BooleanParameter - ignored, boolean params do not determine logic path, but only report status. def initialize(original_word:, filters_matched: [], preprocessed_words: nil, word_cached: false, word_valid: false) - self.original_word = original_word self.filters_matched = filters_matched self.word_cached = word_cached diff --git a/spec/lib/LittleWeasel/modules/language_spec.rb b/spec/lib/LittleWeasel/modules/language_spec.rb index e6f9bbc..2a30cae 100644 --- a/spec/lib/LittleWeasel/modules/language_spec.rb +++ b/spec/lib/LittleWeasel/modules/language_spec.rb @@ -59,7 +59,7 @@ def initialize(language) let(:language) { Object.new } it 'raises an error' do - expect { subject.normalize_language! }.to raise_error(NoMethodError, /undefined method `downcase'/) + expect { subject.normalize_language! }.to raise_error(NoMethodError, /undefined method [`|']downcase'/) end end end @@ -105,7 +105,7 @@ def initialize(language) let(:language) { 1 } it 'returns nil' do - expect { described_class.normalize_language(language) }.to raise_error(NoMethodError, /undefined method `downcase'/) + expect { described_class.normalize_language(language) }.to raise_error(NoMethodError, /undefined method [`|']downcase'/) end end end diff --git a/spec/lib/LittleWeasel/modules/locale_spec.rb b/spec/lib/LittleWeasel/modules/locale_spec.rb index 5fdf904..a0d1ac4 100644 --- a/spec/lib/LittleWeasel/modules/locale_spec.rb +++ b/spec/lib/LittleWeasel/modules/locale_spec.rb @@ -78,7 +78,7 @@ def initialize(language, region) let(:language) { 1 } it 'raises an error' do - expect { subject.locale }.to raise_error(NoMethodError, /undefined method `downcase'/) + expect { subject.locale }.to raise_error(NoMethodError, /undefined method [`|']downcase'/) end end @@ -87,7 +87,7 @@ def initialize(language, region) let(:region) { 1 } it 'raises an error' do - expect { subject.locale }.to raise_error(NoMethodError, /undefined method `upcase'/) + expect { subject.locale }.to raise_error(NoMethodError, /undefined method [`|']upcase'/) end end end diff --git a/spec/lib/LittleWeasel/modules/region_spec.rb b/spec/lib/LittleWeasel/modules/region_spec.rb index 5a4a278..ed6a60b 100644 --- a/spec/lib/LittleWeasel/modules/region_spec.rb +++ b/spec/lib/LittleWeasel/modules/region_spec.rb @@ -59,7 +59,7 @@ def initialize(region) let(:region) { Object.new } it 'raises an error' do - expect { subject.normalize_region! }.to raise_error(NoMethodError, /undefined method `upcase'/) + expect { subject.normalize_region! }.to raise_error(NoMethodError, /undefined method [`|']upcase'/) end end end @@ -105,7 +105,7 @@ def initialize(region) let(:region) { 1 } it 'returns nil' do - expect { described_class.normalize_region(region) }.to raise_error(NoMethodError, /undefined method `upcase'/) + expect { described_class.normalize_region(region) }.to raise_error(NoMethodError, /undefined method [`|']upcase'/) end end end