diff --git a/.github/ISSUE_TEMPLATE/Code.yml b/.github/ISSUE_TEMPLATE/Code.yml
index 2afe7e6fe..aad805a7b 100644
--- a/.github/ISSUE_TEMPLATE/Code.yml
+++ b/.github/ISSUE_TEMPLATE/Code.yml
@@ -19,7 +19,7 @@ body:
attributes:
label: 👀 Before submitting...
options:
- - label: I upgraded to pagy version 9.2.0
+ - label: I upgraded to pagy version 9.2.1
required: true
- label: I searched through the [Documentation](https://ddnexus.github.io/pagy/)
required: true
diff --git a/.github/latest_release_body.md b/.github/latest_release_body.md
index 05b101e0f..ff70dfae8 100644
--- a/.github/latest_release_body.md
+++ b/.github/latest_release_body.md
@@ -6,13 +6,14 @@
- See the [Changelog](https://ddnexus.github.io/pagy/changelog) for possible breaking changes
-### Changes in 9.2.0
+### Changes in 9.2.1
-- Simplify the keyset API:
- - Deprecate the :after_latest variable in favour of :filter_newest
- - Add the keyset argument to the :filter_newest lambda
- - Rename protected after_latest_query > filter_newest_query
+- Improve bin/pagy to dynamically find apps and descriptions
+- Apps refactoring:
+ - Update rails to 8.0
+ - Replace rails AR keyset apps with sinatra apps
+ - Improve consistency
[CHANGELOG](https://ddnexus.github.io/pagy/changelog)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f245a8525..7f46d1c5f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,14 @@ If you upgrade from version `< 9.0.0` see the following:
- `:after_latest` keyset variable: use `:filter_newest`
Pagy Calendar App
-
Self-contained, standalone Rails app implementing nested calendar pagination for year, month, day units.
+
Self-contained, standalone app implementing nested calendar pagination for year, month, day units.
See the Pagy Calendar Extra for details.
Please, report the following versions in any new issue.
Versions
diff --git a/gem/apps/demo.ru b/gem/apps/demo.ru
index 4caf7b09e..5638ede0f 100644
--- a/gem/apps/demo.ru
+++ b/gem/apps/demo.ru
@@ -1,25 +1,27 @@
# frozen_string_literal: true
-# Interactive showcase for all the pagy helpers and CSS styles
-
+# DESCRIPTION
+# Showcase all the helpers and styles
+#
+# DOC
+# https://ddnexus.github.io/pagy/playground/#3-demo-app
+#
+# BIN HELP
+# bundle exec pagy -h
+#
# DEMO USAGE
-# pagy demo
-
+# bundle exec pagy demo
+#
# DEV USAGE
-# pagy clone demo
-# pagy ./demo.ru
-
+# bundle exec pagy clone demo
+# bundle exec pagy ./demo.ru
+#
# URL
# http://0.0.0.0:8000
-# HELP
-# pagy -h
-
-# DOC
-# https://ddnexus.github.io/pagy/playground/#3-demo-app
-
-VERSION = '9.2.0'
+VERSION = '9.2.1'
+# Bundle
require 'bundler/inline'
require 'bundler'
Bundler.configure
@@ -45,10 +47,10 @@ require 'pagy/extras/limit'
require 'pagy/extras/trim'
Pagy::DEFAULT[:trim_extra] = false # opt-in trim
-# sinatra setup
+# Sinatra setup
require 'sinatra/base'
-# sinatra application
+# Sinatra application
class PagyDemo < Sinatra::Base
configure do
enable :inline_templates
diff --git a/gem/apps/keyset_ar.ru b/gem/apps/keyset_ar.ru
index 9ac3ca371..f6b2d77f6 100644
--- a/gem/apps/keyset_ar.ru
+++ b/gem/apps/keyset_ar.ru
@@ -1,69 +1,96 @@
# frozen_string_literal: true
-# Starting point to reproduce keyset related pagy issues
-
+# DESCRIPTION
+# Showcase the keyset ActiveRecord pagination
+#
+# DOC
+# https://ddnexus.github.io/pagy/playground/#5-keyset-apps
+#
+# BIN HELP
+# bundle exec pagy -h
+#
# DEV USAGE
-# pagy clone rails
-# pagy ./keyset.ru
-
+# bundle exec pagy clone keyset_ar
+# bundle exec pagy ./keyset_ar.ru
+#
# URL
# http://0.0.0.0:8000
-# HELP
-# pagy -h
-
-# DOC
-# https://ddnexus.github.io/pagy/playground/#5-keyset-app
-
-VERSION = '8.6.2'
+VERSION = '9.2.1'
-# Gemfile
+# Bundle
require 'bundler/inline'
require 'bundler'
Bundler.configure
gemfile(ENV['PAGY_INSTALL_BUNDLE'] == 'true') do
source 'https://rubygems.org'
- gem 'oj'
+ gem 'activerecord'
gem 'puma'
- gem 'rails'
- # activerecord/sqlite3_adapter.rb probably useless) constraint !!!
- # https://github.com/rails/rails/blame/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14
- gem 'sqlite3', '~> 1.4.0'
+ gem 'sinatra'
+ gem 'sinatra-contrib'
+ gem 'sqlite3'
end
-# require 'rails/all' # too much stuff
-require 'action_controller/railtie'
-require 'active_record'
+# Pagy initializer
+require 'pagy/extras/limit'
+require 'pagy/extras/keyset'
+require 'pagy/extras/pagy'
+Pagy::DEFAULT[:limit] = 10
+Pagy::DEFAULT.freeze
-OUTPUT = Rails.env.showcase? ? IO::NULL : $stdout
+# Sinatra setup
+require 'sinatra/base'
+# Sinatra application
+class PagyKeyset < Sinatra::Base
+ configure do
+ # Templates defined in the __END__ section as @@ ...
+ enable :inline_templates
+ end
-# Rails config
-class PagyKeyset < Rails::Application # :nodoc:
- config.root = __dir__
- config.session_store :cookie_store, key: 'cookie_store_key'
- Rails.application.credentials.secret_key_base = 'absolute_secret'
+ # Controller
+ include Pagy::Backend
+ # Root route/action
+ get '/' do
+ Time.zone = 'UTC'
- config.logger = Logger.new(OUTPUT)
- Rails.logger = config.logger
+ @order = { animal: :asc, name: :asc, birthdate: :desc, id: :asc }
+ @pagy, @pets = pagy_keyset(Pet.order(@order))
+ erb :main
+ end
+ # Helper
+ helpers do
+ include Pagy::Frontend
- routes.draw do
- root to: 'pets#index'
+ def order_symbol(dir)
+ { asc: '↗', desc: '↘' }[dir]
+ end
end
end
-dir = Rails.env.development? ? '.' : Dir.pwd # app dir in dev or pwd otherwise
-unless File.writable?(dir)
- warn "ERROR: directory #{dir.inspect} is not writable (the pagy-rails-app needs to create DB files)"
- exit 1
+# ActiveRecord setup
+require 'active_record'
+# Log
+output = ENV['APP_ENV'].equal?('showcase') ? IO::NULL : $stdout
+ActiveRecord::Base.logger = Logger.new(output)
+# SQLite DB files
+dir = ENV['APP_ENV'].equal?('development') ? '.' : Dir.pwd # app dir in dev or pwd otherwise
+abort "ERROR: Cannot create DB files: the directory #{dir.inspect} is not writable." \
+ unless File.writable?(dir)
+# Connection
+ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: "#{dir}/tmp/pagy-keyset-ar.sqlite3")
+# Schema
+ActiveRecord::Schema.define do
+ create_table :pets, force: true do |t|
+ t.string :animal
+ t.string :name
+ t.date :birthdate
+ end
end
-# Pagy initializer
-require 'pagy/extras/pagy'
-require 'pagy/extras/limit'
-require 'pagy/extras/keyset'
-Pagy::DEFAULT[:limit] = 10
-Pagy::DEFAULT.freeze
+# Models
+class Pet < ActiveRecord::Base; end
+# Data
PETS = <<~PETS
Luna | dog | 2018-03-10
Coco | cat | 2019-05-15
@@ -117,21 +144,6 @@ PETS = <<~PETS
Coco | dog | 2023-05-27
PETS
-# Activerecord initializer
-ActiveRecord::Base.logger = Logger.new(OUTPUT)
-ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: "#{dir}/tmp/pagy-keyset-ar.sqlite3")
-ActiveRecord::Schema.define do
- create_table :pets, force: true do |t|
- t.string :animal
- t.string :name
- t.date :birthdate
- end
-end
-
-# Models
-class Pet < ActiveRecord::Base
-end
-
# DB seed
pets = []
PETS.each_line(chomp: true) do |pet|
@@ -140,97 +152,75 @@ PETS.each_line(chomp: true) do |pet|
end
Pet.insert_all(pets)
-# Helpers
-module PetsHelper
- include Pagy::Frontend
-
- def order_symbol(dir)
- { asc: '↗', desc: '↘' }[dir]
- end
-end
-
-# Controllers
-class PetsController < ActionController::Base # :nodoc:
- include Rails.application.routes.url_helpers
- include Pagy::Backend
-
- def index
- Time.zone = 'UTC'
-
- @order = { animal: :asc, name: :asc, birthdate: :desc, id: :asc }
- @pagy, @pets = pagy_keyset(Pet.order(@order))
- render inline: TEMPLATE
- end
-end
-
-TEMPLATE = <<~ERB
-
-
-
-
-
Pagy Keyset App
-
-
-
-
-
-
-
-
Pagy Keyset App
-
Self-contained, standalone Rails app usable to easily reproduce any keyset related pagy issue with ActiveRecord sets.
-
Please, report the following versions in any new issue.
-
Versions
-
- Ruby: <%== RUBY_VERSION %>
- Rack: <%== Rack::RELEASE %>
- Rails: <%== Rails.version %>
- Pagy: <%== Pagy::VERSION %>
-
-
-
Collection
-
-
-
- animal <%== order_symbol(@order[:animal]) %>
- name <%== order_symbol(@order[:name]) %>
- birthdate <%== order_symbol(@order[:birthdate]) %>
- id <%== order_symbol(@order[:id]) %>
-
- <% @pets.each do |pet| %>
-
- <%= pet.animal %>
- <%= pet.name %>
- <%= pet.birthdate %>
- <%= pet.id %>
-
- <% end %>
-
-
-
-
- <%== pagy_next_a(@pagy, text: 'Next page >') %>
-
-
-
-
-
-ERB
-
run PagyKeyset
+
+__END__
+
+@@ layout
+
+
+
+
+
Pagy Keyset App
+
+
+
+
+ <%= yield %>
+
+
+
+@@ main
+
+
Pagy Keyset App
+
Self-contained, standalone app usable to easily reproduce any keyset related pagy issue with ActiveRecord sets.
+
Please, report the following versions in any new issue.
+
Versions
+
+ Ruby: <%= RUBY_VERSION %>
+ Rack: <%= Rack::RELEASE %>
+ Sinatra: <%= Sinatra::VERSION %>
+ Pagy: <%= Pagy::VERSION %>
+
+
+
Collection
+
+
+
+ animal <%= order_symbol(@order[:animal]) %>
+ name <%= order_symbol(@order[:name]) %>
+ birthdate <%= order_symbol(@order[:birthdate]) %>
+ id <%= order_symbol(@order[:id]) %>
+
+ <% @pets.each do |pet| %>
+
+ <%= pet.animal %>
+ <%= pet.name %>
+ <%= pet.birthdate %>
+ <%= pet.id %>
+
+ <% end %>
+
+
+
+
+ <%= pagy_next_a(@pagy, text: 'Next page >') %>
+
+
diff --git a/gem/apps/keyset_s.ru b/gem/apps/keyset_s.ru
index 329b71c48..e8e6b22c4 100644
--- a/gem/apps/keyset_s.ru
+++ b/gem/apps/keyset_s.ru
@@ -1,70 +1,94 @@
# frozen_string_literal: true
-# Starting point to reproduce keyset related pagy issues
-
+# DESCRIPTION
+# Showcase the keyset ActiveRecord pagination
+#
+# DOC
+# https://ddnexus.github.io/pagy/playground/#5-keyset-apps
+#
+# BIN HELP
+# bundle exec pagy -h
+#
# DEV USAGE
-# pagy clone rails
-# pagy ./keyset.ru
-
+# bundle exec pagy clone keyset_ar
+# bundle exec pagy ./keyset_ar.ru
+#
# URL
# http://0.0.0.0:8000
-# HELP
-# pagy -h
-
-# DOC
-# https://ddnexus.github.io/pagy/playground/#5-keyset-app
-
-VERSION = '8.6.2'
+VERSION = '9.2.1'
-# Gemfile
+# Bundle
require 'bundler/inline'
require 'bundler'
Bundler.configure
gemfile(ENV['PAGY_INSTALL_BUNDLE'] == 'true') do
source 'https://rubygems.org'
- gem 'oj'
gem 'puma'
- gem 'rails'
- # activerecord/sqlite3_adapter.rb probably useless) constraint !!!
- # https://github.com/rails/rails/blame/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14
- gem 'sqlite3', '~> 1.4.0'
gem 'sequel'
+ gem 'sinatra'
+ gem 'sinatra-contrib'
+ gem 'sqlite3'
end
-# require 'rails/all' # too much stuff
-require 'action_controller/railtie'
-require 'sequel'
-
-OUTPUT = Rails.env.showcase? ? IO::NULL : $stdout
+# Pagy initializer
+require 'pagy/extras/limit'
+require 'pagy/extras/keyset'
+require 'pagy/extras/pagy'
+Pagy::DEFAULT[:limit] = 10
+Pagy::DEFAULT.freeze
-# Rails config
-class PagyKeyset < Rails::Application # :nodoc:
- config.root = __dir__
- config.session_store :cookie_store, key: 'cookie_store_key'
- Rails.application.credentials.secret_key_base = 'absolute_secret'
+# Sinatra setup
+require 'sinatra/base'
+require 'logger'
+# Sinatra application
+class PagyKeyset < Sinatra::Base
+ configure do
+ # Templates defined in the __END__ section as @@ ...
+ enable :inline_templates
+ end
- config.logger = Logger.new(OUTPUT)
- Rails.logger = config.logger
+ # Controller
+ include Pagy::Backend
+ # Root route/action
+ get '/' do
+ @order = { animal: :asc, name: :asc, birthdate: :desc, id: :asc }
+ @pagy, @pets = pagy_keyset(Pet.order(:animal, :name, Sequel.desc(:birthdate), :id))
+ erb :main
+ end
+ # Helper
+ helpers do
+ include Pagy::Frontend
- routes.draw do
- root to: 'pets#index'
+ def order_symbol(dir)
+ { asc: '↗', desc: '↘' }[dir]
+ end
end
end
-dir = Rails.env.development? ? '.' : Dir.pwd # app dir in dev or pwd otherwise
+# Sequel setup
+require 'sequel'
+Sequel.default_timezone = :utc
+# SQLite DB files
+dir = ENV['APP_ENV'].equal?('development') ? '.' : Dir.pwd # app dir in dev or pwd otherwise
+abort "ERROR: Cannot create DB files: the directory #{dir.inspect} is not writable." \
unless File.writable?(dir)
- warn "ERROR: directory #{dir.inspect} is not writable (the pagy-rails-app needs to create DB files)"
- exit 1
+# Connection
+output = ENV['APP_ENV'].equal?('showcase') ? IO::NULL : $stdout
+DB = Sequel.connect(adapter: 'sqlite', user: 'root', password: 'password', host: 'localhost', port: '3306',
+ database: "#{dir}/tmp/pagy-keyset-s.sqlite3", max_connections: 10, loggers: [Logger.new(output)])
+# Schema
+DB.create_table! :pets do
+ primary_key :id
+ String :animal, unique: false, null: false
+ String :name, unique: false, null: false
+ Date :birthdate, unique: false, null: false
end
-# Pagy initializer
-require 'pagy/extras/pagy'
-require 'pagy/extras/limit'
-require 'pagy/extras/keyset'
-Pagy::DEFAULT[:limit] = 10
-Pagy::DEFAULT.freeze
+# Models
+class Pet < Sequel::Model; end
+# Data
PETS = <<~PETS
Luna | dog | 2018-03-10
Coco | cat | 2019-05-15
@@ -118,121 +142,81 @@ PETS = <<~PETS
Coco | dog | 2023-05-27
PETS
-Sequel.default_timezone = :utc
-
-## Sequel initializer
-DB = Sequel.connect(adapter: 'sqlite', user: 'root', password: 'password', host: 'localhost', port: '3306',
- database: "#{dir}/tmp/pagy-keyset-s.sqlite3", max_connections: 10, loggers: [Logger.new(OUTPUT)])
-
-DB.create_table! :pets do
- primary_key :id
- String :animal, unique: false, null: false
- String :name, unique: false, null: false
- Date :birthdate, unique: false, null: false
-end
-
dataset = DB[:pets]
-
PETS.each_line(chomp: true) do |pet|
name, animal, birthdate = pet.split('|').map(&:strip)
dataset.insert(name:, animal:, birthdate:)
end
-# Models
-class Pet < Sequel::Model
-end
-
-# Helpers
-module PetsHelper
- include Pagy::Frontend
-
- def order_symbol(dir)
- { asc: '↗', desc: '↘' }[dir]
- end
-end
-
-# Controllers
-class PetsController < ActionController::Base # :nodoc:
- include Rails.application.routes.url_helpers
- include Pagy::Backend
-
- def index
- Time.zone = 'UTC'
-
- @order = { animal: :asc, name: :asc, birthdate: :desc, id: :asc }
- @pagy, @pets = pagy_keyset(Pet.order(:animal, :name, Sequel.desc(:birthdate), :id))
- render inline: TEMPLATE
- end
-end
-
-TEMPLATE = <<~ERB
-
-
-
-
-
Pagy Keyset App
-
-
-
-
-
-
-
-
Pagy Keyset App
-
Self-contained, standalone Rails app usable to easily reproduce any keyset related pagy issue with Sequel sets.
-
Please, report the following versions in any new issue.
-
Versions
-
- Ruby: <%== RUBY_VERSION %>
- Rack: <%== Rack::RELEASE %>
- Rails: <%== Rails.version %>
- Pagy: <%== Pagy::VERSION %>
-
-
-
Collection
-
-
-
- animal <%== order_symbol(@order[:animal]) %>
- name <%== order_symbol(@order[:name]) %>
- birthdate <%== order_symbol(@order[:birthdate]) %>
- id <%== order_symbol(@order[:id]) %>
-
- <% @pets.each do |pet| %>
-
- <%= pet.animal %>
- <%= pet.name %>
- <%= pet.birthdate %>
- <%= pet.id %>
-
- <% end %>
-
-
-
-
- <%== pagy_next_a(@pagy, text: 'Next page >') %>
-
-
-
-
-
-ERB
-
run PagyKeyset
+
+__END__
+
+@@ layout
+
+
+
+
+
Pagy Keyset App
+
+
+
+
+ <%= yield %>
+
+
+
+@@ main
+
+
Pagy Keyset App
+
Self-contained, standalone app usable to easily reproduce any keyset related pagy issue with ActiveRecord sets.
+
Please, report the following versions in any new issue.
+
Versions
+
+ Ruby: <%= RUBY_VERSION %>
+ Rack: <%= Rack::RELEASE %>
+ Sinatra: <%= Sinatra::VERSION %>
+ Pagy: <%= Pagy::VERSION %>
+
+
+
Collection
+
+
+
+ animal <%= order_symbol(@order[:animal]) %>
+ name <%= order_symbol(@order[:name]) %>
+ birthdate <%= order_symbol(@order[:birthdate]) %>
+ id <%= order_symbol(@order[:id]) %>
+
+ <% @pets.each do |pet| %>
+
+ <%= pet.animal %>
+ <%= pet.name %>
+ <%= pet.birthdate %>
+ <%= pet.id %>
+
+ <% end %>
+
+
+
+
+ <%= pagy_next_a(@pagy, text: 'Next page >') %>
+
+
diff --git a/gem/apps/rails.ru b/gem/apps/rails.ru
index c3d38096f..384548a58 100644
--- a/gem/apps/rails.ru
+++ b/gem/apps/rails.ru
@@ -1,21 +1,22 @@
# frozen_string_literal: true
-# Starting point to reproduce rails related pagy issues
-
+# DESCRIPTION
+# Reproduce rails related issues
+#
+# DOC
+# https://ddnexus.github.io/pagy/playground/#2-rails-app
+#
+# BIN HELP
+# bundle exec pagy -h
+#
# DEV USAGE
-# pagy clone rails
-# pagy ./rails.ru
-
+# bundle exec pagy clone rails
+# bundle exec pagy ./rails.ru
+#
# URL
# http://0.0.0.0:8000
-# HELP
-# pagy -h
-
-# DOC
-# https://ddnexus.github.io/pagy/playground/#2-rails-app
-
-VERSION = '9.2.0'
+VERSION = '9.2.1'
# Gemfile
require 'bundler/inline'
@@ -25,10 +26,8 @@ gemfile(ENV['PAGY_INSTALL_BUNDLE'] == 'true') do
source 'https://rubygems.org'
gem 'oj'
gem 'puma'
- gem 'rails'
- # activerecord/sqlite3_adapter.rb probably useless) constraint !!!
- # https://github.com/rails/rails/blame/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14
- gem 'sqlite3', '~> 1.4.0'
+ gem 'rails', '~> 8.0'
+ gem 'sqlite3'
end
# require 'rails/all' # too much stuff
diff --git a/gem/apps/repro.ru b/gem/apps/repro.ru
index 0fb2b0df3..ed15bd07d 100644
--- a/gem/apps/repro.ru
+++ b/gem/apps/repro.ru
@@ -1,22 +1,24 @@
# frozen_string_literal: true
-# Starting point app to try pagy or reproduce issues
-
+# DESCRIPTION
+# Reproduce generic/simple issues
+#
+# DOC
+# https://ddnexus.github.io/pagy/playground/#1-repro-app
+#
+# BIN HELP
+# bundle exec pagy -h
+#
# DEV USAGE
-# pagy clone repro
-# pagy ./repro.ru
-
+# bundle exec pagy clone repro
+# bundle exec pagy ./repro.ru
+#
# URL
# http://0.0.0.0:8000
-# HELP
-# pagy -h
-
-# DOC
-# https://ddnexus.github.io/pagy/playground/#1-repro-app
-
-VERSION = '9.2.0'
+VERSION = '9.2.1'
+# Bundle
require 'bundler/inline'
require 'bundler'
Bundler.configure
@@ -36,6 +38,7 @@ require 'pagy/extras/overflow'
Pagy::DEFAULT[:overflow] = :empty_page
Pagy::DEFAULT.freeze
+# Sinatra setup
require 'sinatra/base'
# Sinatra application
class PagyRepro < Sinatra::Base
@@ -141,7 +144,7 @@ __END__
@@ main
Pagy Repro App
-
Self-contained, standalone Sinatra app usable to easily reproduce any pagy issue.
+
Self-contained, standalone app usable to easily reproduce any pagy issue.
Please, report the following versions in any new issue.
Versions
diff --git a/gem/bin/pagy b/gem/bin/pagy
index 709a3a4d6..a70cf6bb7 100755
--- a/gem/bin/pagy
+++ b/gem/bin/pagy
@@ -1,24 +1,23 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
-VERSION = '9.2.0'
-APPS = %w[repro rails demo calendar keyset_ar keyset_s].freeze
+VERSION = '9.2.1'
LINUX = RbConfig::CONFIG['host_os'].include?('linux')
HOST = '0.0.0.0'
PORT = '8000'
require_relative '../lib/optimist'
+
+apps = Dir[File.expand_path('../apps/*.ru', __dir__)].to_h { |f| [File.basename(f, '.ru'), f] }
opts = Optimist.options do
text <<~HEAD
Pagy #{VERSION} (https://ddnexus.github.io/pagy/playground)
Playground to showcase, clone and develop pagy APPs
APPs
- repro Reproduce generic/simple issues
- rails Reproduce rails related issues
- demo Showcase all the helpers and styles
- calendar Showcase the calendar; reproduce related issues
- keyset_ar Showcase the keyset ActiveRecord pagination
- keyset_s Showcase the keyset Sequel pagination
+ #{ apps.map do |name, path|
+ " #{name}#{' ' * (27 - name.length)}#{File.readlines(path)[3].sub('# ', '').strip}"
+ end.join("\n")
+ }
USAGE
pagy APP [options] Showcase APP from the installed gem
pagy clone APP Clone APP to the current dir
@@ -46,7 +45,7 @@ Optimist.educate if ARGV.empty?
run_from_repo = File.exist?(File.expand_path('../pagy.gemspec', __dir__))
-# Handles gems
+# Bundle
require 'bundler/inline'
require 'bundler'
Bundler.configure
@@ -56,28 +55,25 @@ gemfile(opts[:install]) do
gem 'rerun' if LINUX
end
-path = ->(app) { File.expand_path("../apps/#{app}.ru", __dir__) }
-arg = ARGV.shift
+arg = ARGV.shift
if arg.eql?('clone')
- arg = ARGV.shift
- Optimist.die("Expected APP to be in [#{APPS.join(', ')}]; got #{arg.inspect}") unless APPS.include?(arg)
- file = path.(arg)
- name = File.basename(file)
+ name = ARGV.shift
+ Optimist.die("Expected APP to be in [#{apps.keys.join(', ')}]; got #{arg.inspect}") unless apps.key?(arg)
if File.exist?(name)
print "Do you want to overwrite the #{name.inspect} file? (y/n)> "
answer = gets.chomp
Optimist.die("#{name.inspect} file already present") unless answer.start_with?(/y/i)
end
require 'fileutils'
- FileUtils.cp(file, '.', verbose: true)
+ FileUtils.cp(apps[arg], '.', verbose: true)
else
- if APPS.include?(arg) # showcase env
+ if apps.key?(arg) # showcase env
opts[:env] = 'showcase'
opts[:rerun] = false
opts[:quiet] = true
# Avoid the creation of './tmp/local_secret.txt' for showcase env
ENV['SECRET_KEY_BASE'] = 'absolute secret!' if arg.eql?('rails')
- file = path.(arg)
+ file = apps[arg]
else # development env
file = arg
end
diff --git a/gem/config/pagy.rb b/gem/config/pagy.rb
index 86e8f4c0a..b18248ede 100644
--- a/gem/config/pagy.rb
+++ b/gem/config/pagy.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-# Pagy initializer file (9.2.0)
+# Pagy initializer file (9.2.1)
# 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
diff --git a/gem/javascripts/pagy.min.js b/gem/javascripts/pagy.min.js
index 253506ed3..542becde1 100644
--- a/gem/javascripts/pagy.min.js
+++ b/gem/javascripts/pagy.min.js
@@ -1,4 +1,4 @@
-window.Pagy=(()=>{const j=new ResizeObserver((B)=>B.forEach((D)=>D.target.querySelectorAll(".pagy-rjs").forEach((E)=>E.pagyRender()))),x=(B,[D,E,z,G])=>{const F=B.parentElement??B,K=Object.keys(E).map((H)=>parseInt(H)).sort((H,M)=>M-H);let L=-1;const T=(H,M,R)=>H.replace(/__pagy_page__/g,M).replace(/__pagy_label__/g,R);if((B.pagyRender=function(){const H=K.find((Q)=>QQ.toString());R.forEach((Q,J)=>{const $=X[J];let U;if(typeof Q==="number")U=T(D.a,Q.toString(),$);else if(Q==="gap")U=D.gap;else U=T(D.current,Q,$);M+=typeof G==="string"&&Q==1?Z(U,G):U}),M+=D.after,B.innerHTML="",B.insertAdjacentHTML("afterbegin",M),L=H})(),B.classList.contains("pagy-rjs"))j.observe(F)},A=(B,[D,E])=>Y(B,(z)=>[z,D.replace(/__pagy_page__/,z)],E),C=(B,[D,E,z])=>{Y(B,(G)=>{const F=Math.max(Math.ceil(D/parseInt(G)),1).toString(),K=E.replace(/__pagy_page__/,F).replace(/__pagy_limit__/,G);return[F,K]},z)},Y=(B,D,E)=>{const z=B.querySelector("input"),G=B.querySelector("a"),F=z.value,K=function(){if(z.value===F)return;const[L,T,H]=[z.min,z.value,z.max].map((X)=>parseInt(X)||0);if(TH){z.value=F,z.select();return}let[M,R]=D(z.value);if(typeof E==="string"&&M==="1")R=Z(R,E);G.href=R,G.click()};["change","focus"].forEach((L)=>z.addEventListener(L,()=>z.select())),z.addEventListener("focusout",K),z.addEventListener("keypress",(L)=>{if(L.key==="Enter")K()})},Z=(B,D)=>B.replace(new RegExp(`[?&]${D}=1\\b(?!&)|\\b${D}=1&`),"");return{version:"9.2.0",init(B){const E=(B instanceof Element?B:document).querySelectorAll("[data-pagy]");for(let z of E)try{const G=Uint8Array.from(atob(z.getAttribute("data-pagy")),(L)=>L.charCodeAt(0)),[F,...K]=JSON.parse(new TextDecoder().decode(G));if(F==="nav")x(z,K);else if(F==="combo")A(z,K);else if(F==="selector")C(z,K);else console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",z,F)}catch(G){console.warn("Skipped Pagy.init() for: %o\n%s",z,G)}}}})();
+window.Pagy=(()=>{const j=new ResizeObserver((B)=>B.forEach((D)=>D.target.querySelectorAll(".pagy-rjs").forEach((E)=>E.pagyRender()))),x=(B,[D,E,z,G])=>{const F=B.parentElement??B,K=Object.keys(E).map((H)=>parseInt(H)).sort((H,M)=>M-H);let L=-1;const T=(H,M,R)=>H.replace(/__pagy_page__/g,M).replace(/__pagy_label__/g,R);if((B.pagyRender=function(){const H=K.find((Q)=>QQ.toString());R.forEach((Q,J)=>{const $=X[J];let U;if(typeof Q==="number")U=T(D.a,Q.toString(),$);else if(Q==="gap")U=D.gap;else U=T(D.current,Q,$);M+=typeof G==="string"&&Q==1?Z(U,G):U}),M+=D.after,B.innerHTML="",B.insertAdjacentHTML("afterbegin",M),L=H})(),B.classList.contains("pagy-rjs"))j.observe(F)},A=(B,[D,E])=>Y(B,(z)=>[z,D.replace(/__pagy_page__/,z)],E),C=(B,[D,E,z])=>{Y(B,(G)=>{const F=Math.max(Math.ceil(D/parseInt(G)),1).toString(),K=E.replace(/__pagy_page__/,F).replace(/__pagy_limit__/,G);return[F,K]},z)},Y=(B,D,E)=>{const z=B.querySelector("input"),G=B.querySelector("a"),F=z.value,K=function(){if(z.value===F)return;const[L,T,H]=[z.min,z.value,z.max].map((X)=>parseInt(X)||0);if(TH){z.value=F,z.select();return}let[M,R]=D(z.value);if(typeof E==="string"&&M==="1")R=Z(R,E);G.href=R,G.click()};["change","focus"].forEach((L)=>z.addEventListener(L,()=>z.select())),z.addEventListener("focusout",K),z.addEventListener("keypress",(L)=>{if(L.key==="Enter")K()})},Z=(B,D)=>B.replace(new RegExp(`[?&]${D}=1\\b(?!&)|\\b${D}=1&`),"");return{version:"9.2.1",init(B){const E=(B instanceof Element?B:document).querySelectorAll("[data-pagy]");for(let z of E)try{const G=Uint8Array.from(atob(z.getAttribute("data-pagy")),(L)=>L.charCodeAt(0)),[F,...K]=JSON.parse(new TextDecoder().decode(G));if(F==="nav")x(z,K);else if(F==="combo")A(z,K);else if(F==="selector")C(z,K);else console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",z,F)}catch(G){console.warn("Skipped Pagy.init() for: %o\n%s",z,G)}}}})();
-//# debugId=709E57C4114925F564756E2164756E21
+//# debugId=54B9F760378D0A6964756E2164756E21
//# sourceMappingURL=pagy.min.js.map
diff --git a/gem/javascripts/pagy.min.js.map b/gem/javascripts/pagy.min.js.map
index abb8b9ec9..00b9a5d87 100644
--- a/gem/javascripts/pagy.min.js.map
+++ b/gem/javascripts/pagy.min.js.map
@@ -2,9 +2,9 @@
"version": 3,
"sources": ["../../src/pagy.ts"],
"sourcesContent": [
- "type NavArgs = readonly [Tokens, Sequels, null | LabelSequels, string?]\ntype ComboArgs = readonly [string, string?]\ntype SelectorArgs = readonly [number, string, string?]\ntype JsonArgs = ['nav', NavArgs] | ['combo', ComboArgs] | ['selector', SelectorArgs]\n\ninterface Tokens {\n readonly before:string\n readonly a:string\n readonly current:string\n readonly gap:string\n readonly after:string\n}\ninterface Sequels {readonly [width:string]:(string | number)[]}\ninterface LabelSequels {readonly [width:string]:string[]}\ninterface NavElement extends Element {pagyRender():void}\n\nconst Pagy = (() => {\n // The observer instance for responsive navs\n const rjsObserver = new ResizeObserver(\n entries => entries.forEach(e => e.target.querySelectorAll(\".pagy-rjs\")\n .forEach(el => el.pagyRender())));\n // Init the *_nav_js helpers\n const initNav = (el:NavElement, [tokens, sequels, labelSequels, trimParam]:NavArgs) => {\n const container = el.parentElement ?? el;\n const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);\n let lastWidth = -1;\n const fillIn = (a:string, page:string, label:string):string =>\n a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);\n (el.pagyRender = function () {\n const width = widths.find(w => w < container.clientWidth) || 0;\n if (width === lastWidth) { return } // no change: abort\n let html = tokens.before; // already trimmed in html\n const series = sequels[width.toString()];\n const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());\n series.forEach((item, i) => {\n const label = labels[i];\n let filled;\n if (typeof item === \"number\") {\n filled = fillIn(tokens.a, item.toString(), label);\n } else if (item === \"gap\") {\n filled = tokens.gap;\n } else { // active page\n filled = fillIn(tokens.current, item, label);\n }\n html += (typeof trimParam === \"string\" && item == 1) ? trim(filled, trimParam) : filled;\n });\n html += tokens.after;\n el.innerHTML = \"\";\n el.insertAdjacentHTML(\"afterbegin\", html);\n lastWidth = width;\n })();\n if (el.classList.contains(\"pagy-rjs\")) { rjsObserver.observe(container) }\n };\n\n // Init the *_combo_nav_js helpers\n const initCombo = (el:Element, [url_token, trimParam]:ComboArgs) =>\n initInput(el, inputValue => [inputValue, url_token.replace(/__pagy_page__/, inputValue)], trimParam);\n\n // Init the limit_selector_js helper\n const initSelector = (el:Element, [from, url_token, trimParam]:SelectorArgs) => {\n initInput(el, inputValue => {\n const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();\n const url = url_token.replace(/__pagy_page__/, page).replace(/__pagy_limit__/, inputValue);\n return [page, url];\n }, trimParam);\n };\n\n // Init the input element\n const initInput = (el:Element, getVars:(v:string) => [string, string], trimParam?:string) => {\n const input = el.querySelector(\"input\") as HTMLInputElement;\n const link = el.querySelector(\"a\") as HTMLAnchorElement;\n const initial = input.value;\n const action = function () {\n if (input.value === initial) { return } // not changed\n const [min, val, max] = [input.min, input.value, input.max].map(n => parseInt(n) || 0);\n if (val < min || val > max) { // reset invalid/out-of-range\n input.value = initial;\n input.select();\n return;\n }\n let [page, url] = getVars(input.value); // eslint-disable-line prefer-const\n if (typeof trimParam === \"string\" && page === \"1\") { url = trim(url, trimParam) }\n link.href = url;\n link.click();\n };\n [\"change\", \"focus\"].forEach(e => input.addEventListener(e, () => input.select())); // auto-select\n input.addEventListener(\"focusout\", action); // trigger action\n input.addEventListener(\"keypress\", e => { if (e.key === \"Enter\") { action() } }); // trigger action\n };\n\n // Trim the ${page-param}=1 params in links\n const trim = (a:string, param:string) =>\n a.replace(new RegExp(`[?&]${param}=1\\\\b(?!&)|\\\\b${param}=1&`), \"\");\n\n // Public interface\n return {\n version: \"9.2.0\",\n\n // Scan for elements with a \"data-pagy\" attribute and call their init functions with the decoded args\n init(arg?:Element) {\n const target = arg instanceof Element ? arg : document;\n const elements = target.querySelectorAll(\"[data-pagy]\");\n for (const el of elements) {\n try {\n const uint8array = Uint8Array.from(atob(el.getAttribute(\"data-pagy\") as string), c => c.charCodeAt(0));\n const [keyword, ...args] = JSON.parse((new TextDecoder()).decode(uint8array)) as JsonArgs; // base64-utf8 -> JSON -> Array\n if (keyword === \"nav\") {\n initNav(el as NavElement, args as unknown as NavArgs);\n } else if (keyword === \"combo\") {\n initCombo(el, args as unknown as ComboArgs);\n } else if (keyword === \"selector\") {\n initSelector(el, args as unknown as SelectorArgs);\n } else {\n console.warn(\"Skipped Pagy.init() for: %o\\nUnknown keyword '%s'\", el, keyword);\n }\n } catch (err) { console.warn(\"Skipped Pagy.init() for: %o\\n%s\", el, err) }\n }\n }\n };\n})();\n\nexport default Pagy;\n"
+ "type NavArgs = readonly [Tokens, Sequels, null | LabelSequels, string?]\ntype ComboArgs = readonly [string, string?]\ntype SelectorArgs = readonly [number, string, string?]\ntype JsonArgs = ['nav', NavArgs] | ['combo', ComboArgs] | ['selector', SelectorArgs]\n\ninterface Tokens {\n readonly before:string\n readonly a:string\n readonly current:string\n readonly gap:string\n readonly after:string\n}\ninterface Sequels {readonly [width:string]:(string | number)[]}\ninterface LabelSequels {readonly [width:string]:string[]}\ninterface NavElement extends Element {pagyRender():void}\n\nconst Pagy = (() => {\n // The observer instance for responsive navs\n const rjsObserver = new ResizeObserver(\n entries => entries.forEach(e => e.target.querySelectorAll(\".pagy-rjs\")\n .forEach(el => el.pagyRender())));\n // Init the *_nav_js helpers\n const initNav = (el:NavElement, [tokens, sequels, labelSequels, trimParam]:NavArgs) => {\n const container = el.parentElement ?? el;\n const widths = Object.keys(sequels).map(w => parseInt(w)).sort((a, b) => b - a);\n let lastWidth = -1;\n const fillIn = (a:string, page:string, label:string):string =>\n a.replace(/__pagy_page__/g, page).replace(/__pagy_label__/g, label);\n (el.pagyRender = function () {\n const width = widths.find(w => w < container.clientWidth) || 0;\n if (width === lastWidth) { return } // no change: abort\n let html = tokens.before; // already trimmed in html\n const series = sequels[width.toString()];\n const labels = labelSequels?.[width.toString()] ?? series.map(l => l.toString());\n series.forEach((item, i) => {\n const label = labels[i];\n let filled;\n if (typeof item === \"number\") {\n filled = fillIn(tokens.a, item.toString(), label);\n } else if (item === \"gap\") {\n filled = tokens.gap;\n } else { // active page\n filled = fillIn(tokens.current, item, label);\n }\n html += (typeof trimParam === \"string\" && item == 1) ? trim(filled, trimParam) : filled;\n });\n html += tokens.after;\n el.innerHTML = \"\";\n el.insertAdjacentHTML(\"afterbegin\", html);\n lastWidth = width;\n })();\n if (el.classList.contains(\"pagy-rjs\")) { rjsObserver.observe(container) }\n };\n\n // Init the *_combo_nav_js helpers\n const initCombo = (el:Element, [url_token, trimParam]:ComboArgs) =>\n initInput(el, inputValue => [inputValue, url_token.replace(/__pagy_page__/, inputValue)], trimParam);\n\n // Init the limit_selector_js helper\n const initSelector = (el:Element, [from, url_token, trimParam]:SelectorArgs) => {\n initInput(el, inputValue => {\n const page = Math.max(Math.ceil(from / parseInt(inputValue)), 1).toString();\n const url = url_token.replace(/__pagy_page__/, page).replace(/__pagy_limit__/, inputValue);\n return [page, url];\n }, trimParam);\n };\n\n // Init the input element\n const initInput = (el:Element, getVars:(v:string) => [string, string], trimParam?:string) => {\n const input = el.querySelector(\"input\") as HTMLInputElement;\n const link = el.querySelector(\"a\") as HTMLAnchorElement;\n const initial = input.value;\n const action = function () {\n if (input.value === initial) { return } // not changed\n const [min, val, max] = [input.min, input.value, input.max].map(n => parseInt(n) || 0);\n if (val < min || val > max) { // reset invalid/out-of-range\n input.value = initial;\n input.select();\n return;\n }\n let [page, url] = getVars(input.value); // eslint-disable-line prefer-const\n if (typeof trimParam === \"string\" && page === \"1\") { url = trim(url, trimParam) }\n link.href = url;\n link.click();\n };\n [\"change\", \"focus\"].forEach(e => input.addEventListener(e, () => input.select())); // auto-select\n input.addEventListener(\"focusout\", action); // trigger action\n input.addEventListener(\"keypress\", e => { if (e.key === \"Enter\") { action() } }); // trigger action\n };\n\n // Trim the ${page-param}=1 params in links\n const trim = (a:string, param:string) =>\n a.replace(new RegExp(`[?&]${param}=1\\\\b(?!&)|\\\\b${param}=1&`), \"\");\n\n // Public interface\n return {\n version: \"9.2.1\",\n\n // Scan for elements with a \"data-pagy\" attribute and call their init functions with the decoded args\n init(arg?:Element) {\n const target = arg instanceof Element ? arg : document;\n const elements = target.querySelectorAll(\"[data-pagy]\");\n for (const el of elements) {\n try {\n const uint8array = Uint8Array.from(atob(el.getAttribute(\"data-pagy\") as string), c => c.charCodeAt(0));\n const [keyword, ...args] = JSON.parse((new TextDecoder()).decode(uint8array)) as JsonArgs; // base64-utf8 -> JSON -> Array\n if (keyword === \"nav\") {\n initNav(el as NavElement, args as unknown as NavArgs);\n } else if (keyword === \"combo\") {\n initCombo(el, args as unknown as ComboArgs);\n } else if (keyword === \"selector\") {\n initSelector(el, args as unknown as SelectorArgs);\n } else {\n console.warn(\"Skipped Pagy.init() for: %o\\nUnknown keyword '%s'\", el, keyword);\n }\n } catch (err) { console.warn(\"Skipped Pagy.init() for: %o\\n%s\", el, err) }\n }\n }\n };\n})();\n\nexport default Pagy;\n"
],
"mappings": "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",
- "debugId": "709E57C4114925F564756E2164756E21",
+ "debugId": "54B9F760378D0A6964756E2164756E21",
"names": []
}
\ No newline at end of file
diff --git a/gem/javascripts/pagy.mjs b/gem/javascripts/pagy.mjs
index 3ecd29e57..0155a0a67 100644
--- a/gem/javascripts/pagy.mjs
+++ b/gem/javascripts/pagy.mjs
@@ -73,7 +73,7 @@ const Pagy = (() => {
};
const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), "");
return {
- version: "9.2.0",
+ version: "9.2.1",
init(arg) {
const target = arg instanceof Element ? arg : document;
const elements = target.querySelectorAll("[data-pagy]");
diff --git a/gem/lib/pagy.rb b/gem/lib/pagy.rb
index 89db1a807..e872d8899 100644
--- a/gem/lib/pagy.rb
+++ b/gem/lib/pagy.rb
@@ -6,7 +6,7 @@
# Top superclass: it should define only what's common to all the subclasses
class Pagy
- VERSION = '9.2.0'
+ VERSION = '9.2.1'
# Core default: constant for easy access, but mutable for customizable defaults
DEFAULT = { count_args: [:all], # rubocop:disable Style/MutableConstant
diff --git a/gem/pagy.gemspec b/gem/pagy.gemspec
index 14f2b712d..cdd1319dd 100644
--- a/gem/pagy.gemspec
+++ b/gem/pagy.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = 'pagy'
- s.version = '9.2.0'
+ s.version = '9.2.1'
s.authors = ['Domizio Demichelis']
s.email = ['dd.nexus@gmail.com']
s.summary = 'The best pagination ruby gem'
diff --git a/package.json b/package.json
index 9ee822080..6b68ab7a7 100644
--- a/package.json
+++ b/package.json
@@ -5,20 +5,20 @@
"type": "module",
"devDependencies": {
"@cypress/snapshot": "^2.1.7",
- "@types/node": "22.8.2",
- "cypress": "13.15.1",
+ "@types/node": "22.9.0",
+ "cypress": "13.15.2",
"cypress-html-validate": "6.1.0",
- "eslint-plugin-cypress": "4.0.0",
+ "eslint-plugin-cypress": "4.1.0",
"eslint-plugin-promise": "7.1.0",
"html-validate": "8.24.2",
"start-server-and-test": "2.0.8",
- "@eslint/js": "9.13.0",
+ "@eslint/js": "9.14.0",
"@types/eslint__js": "^8.42.3",
- "eslint": "9.13.0",
+ "eslint": "9.14.0",
"eslint-plugin-align-assignments": "^1.1.2",
"retypeapp-linux-x64": "3.6.0",
"typescript": "5.6.3",
- "typescript-eslint": "8.12.1"
+ "typescript-eslint": "8.13.0"
},
"workspaces": ["e2e"]
}
diff --git a/retype.yml b/retype.yml
index a97d79e6f..d06d1bc96 100644
--- a/retype.yml
+++ b/retype.yml
@@ -8,7 +8,7 @@ url: https://ddnexus.github.io/pagy
branding:
title: Pagy
- label: 9.2.0
+ label: 9.2.1
colors:
label:
text: "#FFFFFF"
diff --git a/scripts/bump.rb b/scripts/bump.rb
index fd7629d7c..bdc07d34b 100755
--- a/scripts/bump.rb
+++ b/scripts/bump.rb
@@ -70,6 +70,8 @@
.github/latest_release_body.md
gem/apps/calendar.ru
gem/apps/demo.ru
+ gem/apps/keyset_ar.ru
+ gem/apps/keyset_s.ru
gem/apps/rails.ru
gem/apps/repro.ru
gem/bin/pagy
diff --git a/src/pagy.ts b/src/pagy.ts
index f68d7c4ad..c398bd5cc 100644
--- a/src/pagy.ts
+++ b/src/pagy.ts
@@ -94,7 +94,7 @@ const Pagy = (() => {
// Public interface
return {
- version: "9.2.0",
+ version: "9.2.1",
// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg?:Element) {
diff --git a/test/files/db/test.sqlite3-wal b/test/files/db/test.sqlite3-wal
deleted file mode 100644
index e69de29bb..000000000