lib/pagy.rb in pagy-2.1.2 vs lib/pagy.rb in pagy-2.1.3
- old
+ new
@@ -2,11 +2,11 @@
# encoding: utf-8
# frozen_string_literal: true
require 'pathname'
-class Pagy ; VERSION = '2.1.2'
+class Pagy ; VERSION = '2.1.3'
class OverflowError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end
# Root pathname to get the path of Pagy files like templates or dictionaries
def self.root; @root ||= Pathname.new(__FILE__).dirname.freeze end
@@ -42,10 +42,10 @@
elsif a+1 == b; series.push(a) # no gap -> no additions
elsif a+2 == b; series.push(a, a+1) # 1 page gap -> fill with missing page
else series.push(a, :gap) # n page gap -> add :gap
end # skip the end boundary (last+1)
end # shift the start boundary (0) and
- series.tap{|s| s.shift; s[s.index(@page)] = @page.to_s} # convert the current page to String
+ series.shift; series[series.index(@page)] = @page.to_s; series # convert the current page to String
end
end
require 'pagy/backend'