diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 296c0d8..e61811d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,8 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.image }} + bundler-cache: true - name: Run tests run: | - gem install -g - rake + bundle install + bundle exec rake diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..27a9fb7 --- /dev/null +++ b/.rspec @@ -0,0 +1,5 @@ +--require spec_helper +--color +--format=documentation +--order=rand +--warnings diff --git a/.rubocop.yml b/.rubocop.yml index 55beb10..0818216 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,7 @@ AllCops: TargetRubyVersion: 2.7 Exclude: - 'numbers_and_words.gemspec' + - vendor/bundle/**/* Layout/EmptyLinesAroundAttributeAccessor: Enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index f0904e4..e6a50d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.11.13 (Next) ### Features + * Upgrade RuboCop to 1.63.5. \[[#198](https://github.com/kslazarev/numbers_and_words/pull/198)\] * Your contribution here. ## 0.11.12 (April 22, 2023) diff --git a/Gemfile b/Gemfile index 3ab7e70..bcbdb4e 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ end group :test do gem 'coveralls', require: false gem 'rspec', '~> 3' - gem 'rubocop', require: false + gem 'rubocop', '~> 1.63.5', require: false gem 'rubocop-performance', require: false gem 'rubocop-rake', require: false gem 'rubocop-rspec', require: false diff --git a/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb b/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb index 2a3ad28..1708605 100644 --- a/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +++ b/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb @@ -6,7 +6,7 @@ module FiguresConverter module Languages class Lv < Base def tens_with_ones - super separator: ' ' + super(separator: ' ') end def megs 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 fd4ec6d..63a5984 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 @@ -31,7 +31,7 @@ def capacity_iteration end def ones - super internal_options.merge(is_one_thousand: one_thousand?) + super(internal_options.merge(is_one_thousand: one_thousand?)) end def hundreds @@ -56,7 +56,7 @@ def maybe_ordinal end def gender - return (options.gender.result || :male) if maybe_ordinal + return options.gender.result || :male if maybe_ordinal if current_capacity&.positive? && figures[0] == 1 :male diff --git a/lib/numbers_and_words/translations/es.rb b/lib/numbers_and_words/translations/es.rb index 3786c6d..0bebd97 100644 --- a/lib/numbers_and_words/translations/es.rb +++ b/lib/numbers_and_words/translations/es.rb @@ -19,7 +19,7 @@ def ones(number, options = {}) end def tens_with_ones(numbers, options = {}) - super numbers, options.merge(separator: " #{union} ") + super(numbers, options.merge(separator: " #{union} ")) end def twenties_with_ones(numbers, options = {}) diff --git a/lib/numbers_and_words/translations/et.rb b/lib/numbers_and_words/translations/et.rb index 44c138a..7fcc37a 100644 --- a/lib/numbers_and_words/translations/et.rb +++ b/lib/numbers_and_words/translations/et.rb @@ -6,7 +6,7 @@ class Et < Base include NumbersAndWords::Translations::Families::Latin def hundreds(number, _options = {}) - super number, separator: '' + super(number, separator: '') end end end diff --git a/lib/numbers_and_words/translations/fr.rb b/lib/numbers_and_words/translations/fr.rb index 742a606..11f3111 100644 --- a/lib/numbers_and_words/translations/fr.rb +++ b/lib/numbers_and_words/translations/fr.rb @@ -11,14 +11,14 @@ class Fr < Base def tens(number, options = {}) return t(:eighty) if number == SPECIAL_TENS_CASE && options[:alone].nil? - super number, options + super(number, options) end 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: separator)) end def hundreds(number, options = {}) diff --git a/lib/numbers_and_words/translations/hu.rb b/lib/numbers_and_words/translations/hu.rb index db697c6..ed58516 100644 --- a/lib/numbers_and_words/translations/hu.rb +++ b/lib/numbers_and_words/translations/hu.rb @@ -12,7 +12,7 @@ def tens_with_ones(numbers, options = {}) end def hundreds(number, options = {}) - super number, options.merge(separator: '') + super(number, options.merge(separator: '')) end end end diff --git a/lib/numbers_and_words/translations/it.rb b/lib/numbers_and_words/translations/it.rb index f7b875f..518f9e6 100644 --- a/lib/numbers_and_words/translations/it.rb +++ b/lib/numbers_and_words/translations/it.rb @@ -6,7 +6,7 @@ class It < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: '' + super(numbers, separator: '') end def hundreds(number, _options = {}) diff --git a/lib/numbers_and_words/translations/nl.rb b/lib/numbers_and_words/translations/nl.rb index 3298e9d..f2e6318 100644 --- a/lib/numbers_and_words/translations/nl.rb +++ b/lib/numbers_and_words/translations/nl.rb @@ -12,7 +12,7 @@ def tens_with_ones(numbers, _options = {}) def hundreds(number, _options = {}) return t(:hundreds) if number == 1 - super number, separator: '' + super(number, separator: '') end private diff --git a/lib/numbers_and_words/translations/pt.rb b/lib/numbers_and_words/translations/pt.rb index 51069fa..20a6ac0 100644 --- a/lib/numbers_and_words/translations/pt.rb +++ b/lib/numbers_and_words/translations/pt.rb @@ -6,7 +6,7 @@ class Pt < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: " #{union} " + super(numbers, separator: " #{union} ") end def hundreds(number, options = {}) diff --git a/lib/numbers_and_words/translations/se.rb b/lib/numbers_and_words/translations/se.rb index 6677810..fcf6071 100644 --- a/lib/numbers_and_words/translations/se.rb +++ b/lib/numbers_and_words/translations/se.rb @@ -6,7 +6,7 @@ class Se < Base include NumbersAndWords::Translations::Families::Latin def tens_with_ones(numbers, _options = {}) - super numbers, separator: '-' + super(numbers, separator: '-') end end end