Skip to content

Commit

Permalink
fix for frozen error handled differently on ruby <3
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jun 8, 2021
1 parent 8a2cf76 commit d6d71a5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/pagy/extras/bulma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def pagy_bulma_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '
private

def pagy_bulma_prev_next_html(pagy, link)
html = if (p_prev = pagy.prev)
html = +if (p_prev = pagy.prev)
link.call p_prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"'
else
%(<a class="pagination-previous" disabled>#{pagy_t 'pagy.nav.prev'}</a>)
Expand Down
2 changes: 1 addition & 1 deletion lib/pagy/extras/items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def pagy_items_selector_js(pagy, deprecated_id=nil, pagy_id: nil, item_name: nil
link = pagy_marked_link(pagy_link_proc(pagy, link_extra: link_extra))
p_vars[:items] = p_items # restore the items

html = %(<span#{p_id} class="pagy-items-selector-js" #{pagy_json_attr pagy, :items_selector, pagy.from, link}>)
html = +%(<span#{p_id} class="pagy-items-selector-js" #{pagy_json_attr pagy, :items_selector, pagy.from, link}>)
input = %(<input type="number" min="1" max="#{p_vars[:max_items]}" value="#{p_items}" style="padding: 0; text-align: center; width: #{p_items.to_s.length+1}rem;">)
html << pagy_t('pagy.items_selector_js', item_name: item_name || pagy_t(i18n_key || p_vars[:i18n_key], count: p_items),
items_input: input,
Expand Down
2 changes: 1 addition & 1 deletion lib/pagy/extras/trim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def pagy_link_proc(pagy, deprecated_link_extra=nil, link_extra: '')
link_proc = super(pagy, link_extra: link_extra)
return link_proc unless pagy.vars[:enable_trim_extra]
lambda do |num, text=num, extra=''|
link = link_proc.call(num, text, extra)
link = +link_proc.call(num, text, extra)
return link unless num == 1
link.sub!(/[?&]#{pagy.vars[:page_param]}=1\b(?!&)|\b#{pagy.vars[:page_param]}=1&/, '')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pagy/extras/uikit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pagy_uikit_nav(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: link_extra)

html = %(<ul#{p_id} class="pagy-uikit-nav uk-pagination uk-flex-center">#{pagy_uikit_prev_html pagy, link})
html = +%(<ul#{p_id} class="pagy-uikit-nav uk-pagination uk-flex-center">#{pagy_uikit_prev_html pagy, link})
pagy.series.each do |item|
html << case item
when Integer then %(<li>#{link.call item}</li>)
Expand Down

0 comments on commit d6d71a5

Please sign in to comment.