diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20c4fc5e..22c5c9a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,9 @@ jobs: fail-fast: false matrix: image: - - 2.7 - - 3.0 - 3.1 - 3.2 + - 3.3 - jruby - head steps: diff --git a/.rubocop.yml b/.rubocop.yml index 08182161..22c89ea8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 Exclude: - 'numbers_and_words.gemspec' - vendor/bundle/**/* diff --git a/CHANGELOG.md b/CHANGELOG.md index d0f4aa8c..82832e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ### Features * Add support for Danish language. \[[#197](https://github.com/kslazarev/numbers_and_words/pull/197)\] \([@franta](https://github.com/Franta1205)\) * Upgrade RuboCop to 1.63.5. \[[#198](https://github.com/kslazarev/numbers_and_words/pull/198)\] + * Drop support for Ruby 2.7. \[[#202](https://github.com/kslazarev/numbers_and_words/pull/202)\] + * Drop support for Ruby 3.0. \[[#202](https://github.com/kslazarev/numbers_and_words/pull/202)\] + * Add support for Ruby 3.3. \[[#202](https://github.com/kslazarev/numbers_and_words/pull/202)\] * Your contribution here. ## 0.11.12 (April 22, 2023) diff --git a/README.rdoc b/README.rdoc index 498cca06..c98628f4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -387,8 +387,8 @@ Deletrea números en varios idiomas utilizando la gema I18n. == Requirements / Требования / Configuration Requise -* 2.7 <= Ruby (compatible with/совместимость с/compatible avec Ruby 2.7 and/и/et JRuby); -* 0.5.0 <= I18n (earlier versions not tested/ранние версии не тестировались/versions précédentes non testées); +* 3.1 <= Ruby (compatible with/совместимость с/compatible avec Ruby 3.1 and/и/et JRuby); +* 1.14.3 <= I18n (earlier versions not tested/ранние версии не тестировались/versions précédentes non testées); == Installation / Установка / Installation diff --git a/Rakefile b/Rakefile index 487e2474..3d1c0a0b 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ Jeweler::Tasks.new do |gem| gem.version = NumbersAndWords::VERSION gem.authors = ['Kirill Lazarev'] gem.files = Dir.glob('lib/**/*') - gem.required_ruby_version = '>= 2.7.0' + gem.required_ruby_version = '>= 3.1.0' end Jeweler::RubygemsDotOrgTasks.new diff --git a/lib/numbers_and_words/helper_classes/figures_array.rb b/lib/numbers_and_words/helper_classes/figures_array.rb index 9eb0a208..0a10d4fe 100644 --- a/lib/numbers_and_words/helper_classes/figures_array.rb +++ b/lib/numbers_and_words/helper_classes/figures_array.rb @@ -18,8 +18,8 @@ def figures_array_in_capacity(capacity) super.to_figures end - def local_language(&block) - ::I18n.with_locale(I18n.local_language, &block) + def local_language(&) + ::I18n.with_locale(I18n.local_language, &) end end end diff --git a/lib/numbers_and_words/helper_classes/words_array.rb b/lib/numbers_and_words/helper_classes/words_array.rb index 79dcb841..403b0051 100644 --- a/lib/numbers_and_words/helper_classes/words_array.rb +++ b/lib/numbers_and_words/helper_classes/words_array.rb @@ -8,8 +8,8 @@ def join(options = {}) local_language { Strategies.array_joiner.new(to_a, options).run } end - def local_language(&block) - ::I18n.with_locale(I18n.local_language, &block) + def local_language(&) + ::I18n.with_locale(I18n.local_language, &) end end end diff --git a/lib/numbers_and_words/strategies/figures_converter.rb b/lib/numbers_and_words/strategies/figures_converter.rb index 017c06c3..b53f0cc9 100644 --- a/lib/numbers_and_words/strategies/figures_converter.rb +++ b/lib/numbers_and_words/strategies/figures_converter.rb @@ -25,8 +25,8 @@ def run private - def around(&block) - decorator.run(&block) + def around(&) + decorator.run(&) end end end diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb b/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb index cb88b388..8a611733 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb @@ -36,7 +36,7 @@ def gender private def internal_options - { gender: gender, prefix: maybe_ordinal } + { gender:, prefix: maybe_ordinal } end def maybe_remove_zero diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/da.rb b/lib/numbers_and_words/strategies/figures_converter/languages/da.rb index c0304832..00102a9e 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/da.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/da.rb @@ -10,7 +10,7 @@ def print_words end def ones - super({ gender: gender }) + super({ gender: }) end def hundreds diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/de.rb b/lib/numbers_and_words/strategies/figures_converter/languages/de.rb index 8f6684a7..e0138031 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/de.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/de.rb @@ -21,7 +21,7 @@ def complex_number_to_words end def ones - super(postfix: postfix) + super(postfix:) end def postfix diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/es.rb b/lib/numbers_and_words/strategies/figures_converter/languages/es.rb index feac854f..aabb8c99 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/es.rb @@ -14,20 +14,20 @@ def zero end def ones - super({ gender: gender, + super({ gender:, is_one_thousand: one_thousand?, is_apocopated: one_apocopated? }) end def tens_with_ones - options = { gender: gender, is_apocopated: one_apocopated? } + options = { gender:, is_apocopated: one_apocopated? } return @translations.twenties_with_ones(@figures, options) if @figures.tens == 2 super(options) end def hundreds - super({ gender: gender, + super({ gender:, is_apocopated: hundred_apocopated? }) end diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb b/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb index c1d0f1bf..11b7253b 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb @@ -23,7 +23,7 @@ def gender %i[ones tens_with_ones].each do |method_name| define_method(method_name) do |*args| - super({ gender: gender }.merge(args.first || {})) + super({ gender: }.merge(args.first || {})) end end diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb b/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb index 631e9245..769b4530 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb @@ -20,7 +20,7 @@ def hundreds def megs prefix = (:partials if @figures.hundreds || @figures.tens || @figures.ones) - super(prefix: prefix) + super(prefix:) end private diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb b/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb index 63a59844..2fda27af 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb @@ -35,7 +35,7 @@ def ones end def hundreds - super(internal_options.merge(is_hundred: hundred?, is_one_hundred: one_hundred?, gender: gender)) + super(internal_options.merge(is_hundred: hundred?, is_one_hundred: one_hundred?, gender:)) end def megs @@ -48,7 +48,7 @@ def megs private def internal_options - { gender: gender, prefix: maybe_ordinal } + { gender:, prefix: maybe_ordinal } end def maybe_ordinal diff --git a/lib/numbers_and_words/translations/fr.rb b/lib/numbers_and_words/translations/fr.rb index 1f92e269..858775e3 100644 --- a/lib/numbers_and_words/translations/fr.rb +++ b/lib/numbers_and_words/translations/fr.rb @@ -18,12 +18,12 @@ def tens_with_ones(numbers, options = {}) return [tens(numbers[1] - 1, alone: false), teens(numbers)].join('-') if [7, 9].include? numbers[1] separator = numbers[0] == 1 ? " #{union} " : '-' - super(numbers, options.merge(separator: separator)) + super(numbers, options.merge(separator:)) end def hundreds(number, options = {}) count = options[:pluralize] ? number : 1 - hundreds = t(:hundreds, count: count) + hundreds = t(:hundreds, count:) return hundreds if number == 1 diff --git a/lib/numbers_and_words/wrappers/float.rb b/lib/numbers_and_words/wrappers/float.rb index bb971ed7..ae656ce7 100644 --- a/lib/numbers_and_words/wrappers/float.rb +++ b/lib/numbers_and_words/wrappers/float.rb @@ -51,7 +51,7 @@ def integral_options def fractional_options length = precision || fractional_part.length - { fractional: { length: length } } + { fractional: { length: } } end def fractional_part_is_nil?