Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 6, 2024
2 parents 4aead0c + ae1874f commit a4d8697
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body:
attributes:
label: 👀 Before submitting...
options:
- label: I upgraded to pagy version 8.3.0
- label: I upgraded to pagy version 8.4.0
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
Expand Down
12 changes: 5 additions & 7 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
the [details](https://github.com/ddnexus/pagy/discussions/672#discussioncomment-9212328))
- See the [CHANGELOG](https://ddnexus.github.io/pagy/changelog) for possible breaking changes

### Changes in 8.3.0
### Changes in 8.4.0

<!-- changes start -->
- Discontinue foundation materialize, semantic and uikit CSS extras
- Improve playground:
- Add install option (automated in pagy development)
- Fix HTML validation for all apps
- Remove unused styles from the demo app
- Hardcode version in pagy.gemspec
- Retrieve only @in items:
- improve the performance of the last page in
particular storage conditions (see #696)
- Improve pagy launcher for pagy devs
<!-- changes end -->

[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ If you upgrade from version `< 8.0.0` see the following:

<hr>

## Version 8.4.0

- Retrieve only @in items:
- improve the performance of the last page in
particular storage conditions (see #696)
- Improve pagy launcher for pagy devs

## Version 8.3.0

- Discontinue foundation materialize, semantic and uikit CSS extras
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: gem
specs:
pagy (8.3.0)
pagy (8.4.0)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gem/apps/calendar.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#4-calendar-app

VERSION = '8.3.0'
VERSION = '8.4.0'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/demo.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#3-demo-app

VERSION = '8.3.0'
VERSION = '8.4.0'

require 'bundler/inline'
require 'bundler'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/rails.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#2-rails-app

VERSION = '8.3.0'
VERSION = '8.4.0'

# Gemfile
require 'bundler/inline'
Expand Down
2 changes: 1 addition & 1 deletion gem/apps/repro.ru
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# DOC
# https://ddnexus.github.io/pagy/playground/#1-repro-app

VERSION = '8.3.0'
VERSION = '8.4.0'

require 'bundler/inline'
require 'bundler'
Expand Down
17 changes: 12 additions & 5 deletions gem/bin/pagy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

VERSION = '8.3.0'
VERSION = '8.4.0'
APPS = %w[repro rails demo calendar].freeze

require_relative '../lib/optimist'
Expand Down Expand Up @@ -37,8 +37,9 @@ opts = Optimist.options do
end
Optimist.educate if ARGV.empty?

# Never install if run from pagy repo (pagy devs)
opts[:install] = false if File.exist?(File.expand_path('../pagy.gemspec', __dir__))
run_from_repo = File.exist?(File.expand_path('../pagy.gemspec', __dir__))
# Never install if run from pagy repo (for pagy devs)
opts[:install] = false if run_from_repo

# Handles gems
require 'bundler/inline'
Expand Down Expand Up @@ -77,11 +78,17 @@ else
end
Optimist.die("#{file.inspect} app not found") unless File.exist?(file)
# Run command
rackup = "rackup -I #{File.expand_path('../lib', __dir__)} -r pagy -o #{opts[:host]} -p #{opts[:port]} -E #{opts[:env]} #{file}"
gem_dir = File.expand_path('..', __dir__)
rackup = "rackup -I #{gem_dir}/lib -r pagy -o #{opts[:host]} -p #{opts[:port]} -E #{opts[:env]} #{file}"
rackup << ' -q' if opts[:quiet]
if opts[:rerun]
name = File.basename(file)
rerun = "rerun --name #{name} -d #{File.dirname(file)} -p #{name}"
dir = File.dirname(file)
rerun = if run_from_repo # rerun app also when gem dir files change (for pagy devs)
"rerun --name #{name} -d #{dir},#{gem_dir} -p **/*.{rb,js,css,scss,ru,yml}"
else
"rerun --name #{name} -d #{dir} -p #{name}" # rerun only when app.ru changes
end
rerun << ' -q' if opts[:quiet]
rerun << ' -c' if opts[:clear]
rerun << " -- #{rackup}"
Expand Down
2 changes: 1 addition & 1 deletion gem/config/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Pagy initializer file (8.3.0)
# Pagy initializer file (8.4.0)
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
# Should you just cherry pick part of this file, please maintain the require-order of the extras

Expand Down
4 changes: 2 additions & 2 deletions gem/javascripts/pagy-dev.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gem/javascripts/pagy-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Pagy = (() => {
const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
// Public interface
return {
version: "8.3.0",
version: "8.4.0",
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg) {
const target = arg instanceof Element ? arg : document;
Expand Down
2 changes: 1 addition & 1 deletion gem/javascripts/pagy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gem/lib/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Core class
class Pagy
VERSION = '8.3.0'
VERSION = '8.4.0'

# Gem root pathname to get the path of Pagy files stylesheets, javascripts, apps, locales, etc.
def self.root
Expand Down
2 changes: 1 addition & 1 deletion gem/lib/pagy/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def pagy_get_page(vars)
# Sub-method called only by #pagy: here for easy customization of record-extraction by overriding
# You may need to override this method for collections without offset|limit
def pagy_get_items(collection, pagy)
collection.offset(pagy.offset).limit(pagy.items)
collection.offset(pagy.offset).limit(pagy.in)
end
end
end
2 changes: 1 addition & 1 deletion gem/lib/pagy/extras/overflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(vars)
initialize vars.merge!(page: @last) # re-run with the last page
@vars[:page] = requested_page # restore the requested page
when :empty_page
@offset = @items = @from = @to = 0 # vars relative to the actual page
@offset = @items = @in = @from = @to = 0 # vars relative to the actual page
if defined?(Calendar) && is_a?(Calendar) # only for Calendar instances
edge = @order == :asc ? @final : @initial # get the edge of the overflow side (neat, but any time would do)
@from = @to = edge # set both to the edge utc time (a >=&&< query will get no records)
Expand Down
2 changes: 1 addition & 1 deletion gem/pagy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = 'pagy'
s.version = '8.3.0'
s.version = '8.4.0'
s.authors = ['Domizio Demichelis']
s.email = ['dd.nexus@gmail.com']
s.summary = 'The best pagination ruby gem'
Expand Down
2 changes: 1 addition & 1 deletion quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If you use Bundler, add the gem in the Gemfile, optionally avoiding the next maj
see [RubyGem Specifiers](http://guides.rubygems.org/patterns/#pessimistic-version-constraint)):

```ruby Gemfile
gem 'pagy', '~> 8.3' # omit patch digit
gem 'pagy', '~> 8.4' # omit patch digit
```

+++ Without Bundler
Expand Down
2 changes: 1 addition & 1 deletion retype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ url: https://ddnexus.github.io/pagy

branding:
title: Pagy
label: 8.3.0
label: 8.4.0
colors:
label:
text: "#FFFFFF"
Expand Down
2 changes: 1 addition & 1 deletion scripts/version-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ esc_new_minor_vers=${esc_new_vers%\\*}
sed -i "0,/$esc_old_minor_vers/{s/$esc_old_minor_vers/$esc_new_minor_vers/}" "$root/quick-start.md"

cd "$root/src"
pnpm run build
./build.sh
cd "$root"

# Set tmplog to the commit messages that have changes in the "gem" root path
Expand Down
2 changes: 1 addition & 1 deletion src/pagy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const Pagy = (() => {

// Public interface
return {
version: "8.3.0",
version: "8.4.0",

// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg?:Element | never) {
Expand Down
2 changes: 1 addition & 1 deletion test/pagy/extras/overflow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
_(pagy.page).must_equal 100
_(pagy.offset).must_equal 0
_(pagy.items).must_equal 0
_(pagy.in).must_be_nil
_(pagy.in).must_equal 0
_(pagy.from).must_equal 0
_(pagy.to).must_equal 0
_(pagy.prev).must_equal pagy.last
Expand Down

0 comments on commit a4d8697

Please sign in to comment.