From 393d2160855960352b9ee08cec39fc787a8bc5bd Mon Sep 17 00:00:00 2001 From: Domizio Demichelis Date: Thu, 22 Apr 2021 12:33:37 +0700 Subject: [PATCH] updated gems --- Gemfile | 7 +------ Gemfile.lock | 16 ++++++++-------- lib/pagy/extras/headers.rb | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index f3366d944..701fb7562 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'rake-manifest' group :test do gem 'codecov', require: false gem 'minitest' - gem 'rubocop', '~> 1.12' + gem 'rubocop' gem 'rubocop-minitest' gem 'rubocop-packaging' gem 'rubocop-performance' @@ -34,8 +34,3 @@ group :performance do gem 'kalibera' gem 'memory_profiler' end - -# group :ide_development do -# gem 'debase' -# gem 'ruby-debug-ide' -# end diff --git a/Gemfile.lock b/Gemfile.lock index 47820102f..32c0b751d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GEM simplecov (>= 0.15, < 0.22) concurrent-ruby (1.1.8) docile (1.3.5) - i18n (1.8.9) + i18n (1.8.10) concurrent-ruby (~> 1.0) kalibera (0.1.1) memoist (~> 0.11.0) @@ -19,7 +19,7 @@ GEM mustermann (1.1.1) ruby2_keywords (~> 0.0.1) nio4r (2.5.7) - oj (3.11.2) + oj (3.11.5) parallel (1.20.1) parser (3.0.1.0) ast (~> 2.4.1) @@ -34,7 +34,7 @@ GEM rbzip2 (0.2.0) regexp_parser (2.1.1) rexml (3.2.5) - rubocop (1.12.1) + rubocop (1.13.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) @@ -45,12 +45,12 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) - rubocop-minitest (0.10.3) - rubocop (>= 0.87, < 2.0) + rubocop-minitest (0.11.1) + rubocop (>= 0.90, < 2.0) rubocop-packaging (0.5.1) rubocop (>= 0.89, < 2.0) - rubocop-performance (1.10.1) - rubocop (>= 0.90.0, < 2.0) + rubocop-performance (1.11.0) + rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rake (0.5.1) rubocop @@ -91,7 +91,7 @@ DEPENDENCIES rack rake rake-manifest - rubocop (~> 1.12) + rubocop rubocop-minitest rubocop-packaging rubocop-performance diff --git a/lib/pagy/extras/headers.rb b/lib/pagy/extras/headers.rb index 892a2aee1..6ec8c6297 100644 --- a/lib/pagy/extras/headers.rb +++ b/lib/pagy/extras/headers.rb @@ -25,10 +25,10 @@ def pagy_headers_hash(pagy) rels = { 'first' => 1, 'prev' => pagy.prev, 'next' => pagy.next } rels['last'] = pagy.last unless countless url_str = pagy_url_for(PAGE_PLACEHOLDER, pagy, :url) - hash = { 'Link' => rels.map do |rel, num| + hash = { 'Link' => rels.filter_map do |rel, num| next unless num [ rel, url_str.sub(PAGE_PLACEHOLDER, num.to_s) ] - end.compact.to_h } + end.to_h } headers = pagy.vars[:headers] hash[headers[:page]] = pagy.page.to_s if headers[:page] hash[headers[:items]] = pagy.vars[:items].to_s if headers[:items]