Skip to content

Commit

Permalink
Drop support for old versions of Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
jlduran committed Oct 17, 2024
1 parent 4063d51 commit 2e4fdc8
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
fail-fast: false
matrix:
image:
- 2.7
- 3.0
- 3.1
- 3.2
- 3.3
- jruby
- head
steps:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
Exclude:
- 'numbers_and_words.gemspec'
- vendor/bundle/**/*
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/numbers_and_words/helper_classes/figures_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/numbers_and_words/helper_classes/words_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/numbers_and_words/strategies/figures_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def run

private

def around(&block)
decorator.run(&block)
def around(&)
decorator.run(&)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def gender
private

def internal_options
{ gender: gender, prefix: maybe_ordinal }
{ gender:, prefix: maybe_ordinal }
end

def maybe_remove_zero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def print_words
end

def ones
super({ gender: gender })
super({ gender: })
end

def hundreds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def complex_number_to_words
end

def ones
super(postfix: postfix)
super(postfix:)
end

def postfix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def hundreds
def megs
prefix = (:partials if @figures.hundreds || @figures.tens || @figures.ones)

super(prefix: prefix)
super(prefix:)
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,7 +48,7 @@ def megs
private

def internal_options
{ gender: gender, prefix: maybe_ordinal }
{ gender:, prefix: maybe_ordinal }
end

def maybe_ordinal
Expand Down
4 changes: 2 additions & 2 deletions lib/numbers_and_words/translations/fr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/numbers_and_words/wrappers/float.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 2e4fdc8

Please sign in to comment.