diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index de24aaaa3..38c0c35ef 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,6 +7,6 @@ Before spending time creating a (potentially complex) Pull Request, you can [Con If you Create A Pull Request, please ensure that the "All checks have passed" indicator gets green light on the Pull Request page (if it's not enabled, a maintainer will enable it for you). For adding translations of locale dictionary files please follow -the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/lib/locales/README.md). +the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/gem/locales/README.md). Thank you! diff --git a/.github/ISSUE_TEMPLATE/Code.yml b/.github/ISSUE_TEMPLATE/Code.yml index 4cdb06d37..6b9a406ef 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 8.0.0 + - label: I upgraded to pagy version 8.0.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 61922d0c4..5fc692695 100644 --- a/.github/latest_release_body.md +++ b/.github/latest_release_body.md @@ -4,7 +4,7 @@ We may drop pagy's less used CSS extras. If you wish to keep your favorites alive, please, [vote here](https://github.com/ddnexus/pagy/discussions/categories/survey) -### ✴ What's new in 8.0.0 ✴ +### ✴ What's new in 8.+ ✴ - Better frontend helpers - New [Pagy Playground](https://ddnexus.github.io/pagy/playground/) to showcase, clone and develop pagy APPs without any setup on diff --git a/.idea/runConfigurations/Calendar.xml b/.idea/runConfigurations/Calendar.xml index 37a2ac510..203de4ec2 100644 --- a/.idea/runConfigurations/Calendar.xml +++ b/.idea/runConfigurations/Calendar.xml @@ -2,7 +2,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/.idea/runConfigurations/Demo.xml b/.idea/runConfigurations/Demo.xml index a4d4b980e..2912b082f 100644 --- a/.idea/runConfigurations/Demo.xml +++ b/.idea/runConfigurations/Demo.xml @@ -2,7 +2,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/.idea/runConfigurations/IRB_pagy.xml b/.idea/runConfigurations/IRB_pagy.xml index 199607b8d..3c536db0f 100644 --- a/.idea/runConfigurations/IRB_pagy.xml +++ b/.idea/runConfigurations/IRB_pagy.xml @@ -1,7 +1,7 @@ - + diff --git a/.idea/runConfigurations/Rails.xml b/.idea/runConfigurations/Rails.xml index a1fbcf0ab..7e3bf4978 100644 --- a/.idea/runConfigurations/Rails.xml +++ b/.idea/runConfigurations/Rails.xml @@ -27,7 +27,7 @@ - + diff --git a/.idea/runConfigurations/Repro.xml b/.idea/runConfigurations/Repro.xml index c1d48dddf..9a67175f6 100644 --- a/.idea/runConfigurations/Repro.xml +++ b/.idea/runConfigurations/Repro.xml @@ -2,11 +2,11 @@ - + - + @@ -24,7 +24,7 @@ - + diff --git a/.rubocop.yml b/.rubocop.yml index bccf6bedd..8e9aa1698 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,7 +16,7 @@ AllCops: # "Unable to find gem panolint; is the gem installed? Gem::MissingSpecError" in all ruby versions - vendor/bundle/**/* - pnpm/**/* - - lib/optimist.rb + - gem/lib/optimist.rb Layout/LineLength: Max: 130 @@ -30,11 +30,11 @@ Layout/ExtraSpacing: Enabled: true Exclude: - test/**/* - - lib/bin/pagy + - gem/bin/pagy Layout/EmptyLines: Exclude: - - lib/config/pagy.rb + - gem/config/pagy.rb Layout/BlockAlignment: Enabled: false diff --git a/.simplecov b/.simplecov index 987871045..00f487545 100644 --- a/.simplecov +++ b/.simplecov @@ -11,19 +11,19 @@ SimpleCov.start do merge_timeout 60 enable_coverage :branch - add_group 'All Extras', %w[lib/pagy/extras] - add_group 'Core', %w[lib/pagy.rb - lib/pagy/backend.rb - lib/pagy/console.rb - lib/pagy/countless.rb - lib/pagy/exceptions.rb - lib/pagy/frontend.rb - lib/pagy/i18n.rb - lib/pagy/url_helpers.rb] - add_group 'Countless', %w[lib/pagy/countless.rb - lib/pagy/extras/countless.rb] - add_group 'Calendar', %w[lib/pagy/extras/calendar.rb - lib/pagy/calendar] + add_group 'All Extras', %w[gem/lib/pagy/extras] + add_group 'Core', %w[gem/lib/pagy.rb + gem/lib/pagy/backend.rb + gem/lib/pagy/console.rb + gem/lib/pagy/countless.rb + gem/lib/pagy/exceptions.rb + gem/lib/pagy/frontend.rb + gem/lib/pagy/i18n.rb + gem/lib/pagy/url_helpers.rb] + add_group 'Countless', %w[gem/lib/pagy/countless.rb + gem/lib/pagy/extras/countless.rb] + add_group 'Calendar', %w[gem/lib/pagy/extras/calendar.rb + gem/lib/pagy/calendar] # add_filter "/test/" add_group 'Tests', %w[test] end diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ef6f43e..3a53fb221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,11 @@ If you upgrade from version `< 8.0.0` see the following: None
+## Version 8.0.1 + +- Reorganize the gem root dir: it was the lib dir (containing everything), now is the gem dir (containing lib and everything else). +- Fix broken link in README + ## Version 8.0.0 ### Breaking changes @@ -45,7 +50,9 @@ None templates or helper overrides. See the complete changes below if you notice any cosmetic changes or get some exception. - The `navs` and `support` extras has been merged into the new [pagy extra](https://ddnexus.github.io/pagy/docs/extras/pagy). Search for `"extra/navs"` and - `"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both) + `"extras/support"` and replace with `"extras/pagy"` (remove the duplicate if you used both) +- The build path for javascript builders has moved from the `lib` to the `gem` dir so the correct setup in `package.json` is: + `build: "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" "` ### Changes diff --git a/docs/api/ARIA.md b/docs/api/ARIA.md index 06e34ac05..5f7c5d9dd 100644 --- a/docs/api/ARIA.md +++ b/docs/api/ARIA.md @@ -18,7 +18,7 @@ page number). It's arguably a better description of the nav content than just "P languages). !!!success Help us with your languages! -Please, check the `pagy.aria_label.nav` in the [locale files](https://github.com/ddnexus/pagy/tree/master/lib/locales) +Please, check the `pagy.aria_label.nav` in the [locale files](https://github.com/ddnexus/pagy/tree/master/gem/locales) used by your app to be already correctly translated and pluralized. If it's not, please, post your translation in the issue linked in the file itself. Thank you! !!! diff --git a/docs/api/backend.md b/docs/api/backend.md index 62fb703cc..e946758c8 100644 --- a/docs/api/backend.md +++ b/docs/api/backend.md @@ -9,9 +9,9 @@ description: This module provides the base functionality for the backend. # Pagy::Backend -This module _(see [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/backend.rb))_ provides a _generic_ pagination -method (`pagy`) that works with `ActiveRecord` out of the box. For any other collection (e.g. `Sequel`, `Mongoid`, ...) you may -need to override some sub-method or [write your own Pagy methods](#writing-your-own-pagy-methods). +This module provides a _generic_ pagination method (`pagy`) that works with `ActiveRecord` out of the box. For any other +collection (e.g. `Sequel`, `Mongoid`, ...) you may need to override some sub-method +or [write your own Pagy methods](#writing-your-own-pagy-methods). For overriding convenience, the `pagy` method calls two sub-methods that you may need to override in order to customize it for any type of collection (e.g. different ORM types, etc.). diff --git a/docs/api/calendar.md b/docs/api/calendar.md index cb4a84bcf..c23efd1f5 100644 --- a/docs/api/calendar.md +++ b/docs/api/calendar.md @@ -57,8 +57,7 @@ with the quarter (1-4). ## DEFAULT variables The calendar defaults are not part of the `Pagy::DEFAULT` variables. Each subclass has its own `Pagy::Calendar::*::DEFAULT` -variable hash that you can set independently. See the [pagy.rb](https://github.com/ddnexus/pagy/blob/master/lib/config/pagy.rb) -configuration file for details. +variable hash that you can set independently. See the pagy initializer file for details. ## Attribute Readers @@ -99,11 +98,6 @@ scope, `ActiveRecord` converts it for you. Set the `Date.beginning_of_week` toto the symbol of the first day of the week (e.g. `Date.beginning_of_week = :sunday`). Notice the default is `:monday` consistently with the ISO-8601 standard (and Rails). -## Files - -- [calendar.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/calendar.rb) -- [calendar units](https://github.com/ddnexus/pagy/blob/master/lib/pagy/calendar/) - ## Methods ==- `label(opts = {})` diff --git a/docs/api/countless.md b/docs/api/countless.md index 706ffd958..2cebaad77 100644 --- a/docs/api/countless.md +++ b/docs/api/countless.md @@ -7,8 +7,7 @@ category: # Pagy::Countless -This is a `Pagy` subclass (see [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/countless.rb)) that provides -pagination without the need of any `:count`. +This is a `Pagy` subclass that provides pagination without the need of any `:count`. That may be especially useful in the following scenarios: @@ -18,7 +17,7 @@ That may be especially useful in the following scenarios: - when the full nav-bar is not a requirement and/or performance is more desirable This class provides support for extras that don't need the full set of pagination support or need to avoid the `:count` variable ( -e.g. the [countless](/docs/extras/countless.md) extra). The class API is documented here, however you should not need to use this +e.g. the [countless extra](/docs/extras/countless.md)). The class API is documented here, however you should not need to use this class directly because it is required and used internally by the extra. ## Caveats @@ -65,7 +64,7 @@ exception. Retrieving these variables may be useful to supply a UI as complete as possible, when used with classic helpers, and can be skipped when it's not needed (like for navless pagination, infinite-scroll, etc.). See -the [countless.rb extra](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/countless.rb) for more details. +the [countless extra](/docs/extras/countless.md) for more details. ## Methods diff --git a/docs/api/frontend.md b/docs/api/frontend.md index 4e5da783e..19d35c48b 100644 --- a/docs/api/frontend.md +++ b/docs/api/frontend.md @@ -9,7 +9,7 @@ categories: This module provides a few methods to deal with the navigation aspect of the pagination. -You will usually include it in some helper module, making its methods available (and overridable) in your views. _([source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/frontend.rb))_ +You will usually include it in some helper module, making its methods available (and overridable) in your views. You can extend this module with a few more nav helpers _(see the [extras](/categories/extra) doc for more details)_ diff --git a/docs/api/i18n.md b/docs/api/i18n.md index dba7a291b..6ed3cb2a9 100644 --- a/docs/api/i18n.md +++ b/docs/api/i18n.md @@ -18,12 +18,12 @@ See [i18n extra](/docs/extras/i18n.md) if you need to use the slower standard `i Pagy provides many ready-to-use dictionaries for different locales/languages usable with single or multi languages apps. -All the pagy strings are stored in the dictionary files of its [locales](https://github.com/ddnexus/pagy/blob/master/lib/locales), +All the pagy strings are stored in the dictionary files of its [locales](https://github.com/ddnexus/pagy/blob/master/gem/locales), ready to be customized and/or used with or without the `I18n` gem. The files follow the same structure of the standard locale files for the `i18n` gem. !!!success PRs Welcome! -If you are using pagy with some language missing from the [locales](https://github.com/ddnexus/pagy/blob/master/lib/locales), +If you are using pagy with some language missing from the [locales](https://github.com/ddnexus/pagy/blob/master/gem/locales), please, [submit your translation](https://github.com/ddnexus/pagy/pulls)! !!! @@ -110,5 +110,5 @@ and [How to customize the item name](/docs/how-to.md#customize-the-item-name))_ ## Contribute a language If you wish to add a new locale to -pagy ([see existing locales in the lib/locales directory](https://github.com/ddnexus/pagy/tree/master/lib/locales)) please follow -the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/lib/locales/README.md). +pagy ([see existing locales in the lib/locales directory](https://github.com/ddnexus/pagy/tree/master/gem/locales)) please follow +the [locales readme instructions here.](https://github.com/ddnexus/pagy/blob/master/gem/locales/README.md). diff --git a/docs/api/javascript/setup.md b/docs/api/javascript/setup.md index c562bec77..dd7d14c71 100644 --- a/docs/api/javascript/setup.md +++ b/docs/api/javascript/setup.md @@ -37,8 +37,9 @@ Your app uses modern build tools * ES6 module to use with webpacker, esbuild, parcel, etc. -_ESM File: [pagy-module.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-module.js); -Types: [pagy-module.d.ts](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-module.d.ts)_ +[!file](/gem/javascripts/pagy-module.js) + +[!file](/gem/javascripts/pagy-module.d.ts) +++ `pagy.js` !!! success @@ -49,7 +50,7 @@ Your app needs standard script or old browser compatibility production pages and without any further processing * Minified (~2k) and polyfilled to work also with quite old browsers -_JS File: [pagy.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy.js)_ +[!file](/gem/javascripts/pagy.js)
Browser compatibility list: @@ -102,7 +103,7 @@ You need to debug the javascript helpers * It works only on new browsers !!! -_JS File: [pagy-dev.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy-dev.js)_ +[!file](/gem/javascripts/pagy-dev.js) +++ ### 2. Configure @@ -166,7 +167,7 @@ unless Rails.env.production? Prepend the `NODE_PATH` environment variable to the `scripts.build` command: ```json package.json { - "build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" " + "build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" " } ``` @@ -174,7 +175,7 @@ Prepend the `NODE_PATH` environment variable to the `scripts.build` command: Prepend the `NODE_PATH` environment variable to the `scripts.build` command: ```json package.json { - "build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" " + "build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" " } ``` @@ -214,7 +215,7 @@ import './pagy.js.erb' Prepend the `NODE_PATH` environment variable to the `scripts.build` command: ```json package.json { - "build": "NODE_PATH=\"$(bundle show 'pagy')/lib/javascripts\" " + "build": "NODE_PATH=\"$(bundle show 'pagy')/gem/javascripts\" " } ``` diff --git a/docs/api/pagy.md b/docs/api/pagy.md index 7df9ef9cb..5cea8a693 100644 --- a/docs/api/pagy.md +++ b/docs/api/pagy.md @@ -10,7 +10,7 @@ categories: The scope of the `Pagy` class is keeping track of the all integers and variables involved in the pagination. It basically takes a few integers (such as the count of the collection, the page number, the items per page, ...), does some simple arithmetic and creates a very small object that allocates less than 3k of -memory ([source](https://github.com/ddnexus/pagy/blob/master/lib/pagy.rb)). +memory. ## Synopsis @@ -61,7 +61,7 @@ Pagy::DEFAULT.freeze ==- `Pagy.root` -This method returns the `pathname` of the `pagy/lib` root dir. It is useful to get the absolute path of locale and javascript +This method returns the `pathname` of the `pagy/gem` root dir. It is useful to get the absolute path of locale and javascript files installed with the gem. ==- `Pagy.new(vars)` diff --git a/docs/api/stylesheets.md b/docs/api/stylesheets.md index b318ab56a..9ee2a78c0 100644 --- a/docs/api/stylesheets.md +++ b/docs/api/stylesheets.md @@ -45,33 +45,33 @@ the rest untouched. +++ pagy.scss -[!file](/lib/stylesheets/pagy.scss) +[!file](/gem/stylesheets/pagy.scss) ```ruby stylesheet_path = Pagy.root.join('stylesheets', 'pagy.scss') ``` -:::code source="/lib/stylesheets/pagy.scss" ::: +:::code source="/gem/stylesheets/pagy.scss" ::: +++ pagy.css -[!file](/lib/stylesheets/pagy.css) +[!file](/gem/stylesheets/pagy.css) ```ruby stylesheet_path = Pagy.root.join('stylesheets', 'pagy.css') ``` -:::code source="/lib/stylesheets/pagy.css" ::: +:::code source="/gem/stylesheets/pagy.css" ::: +++ pagy.tailwind.css -[!file](/lib/stylesheets/pagy.tailwind.css) +[!file](/gem/stylesheets/pagy.tailwind.css) ```ruby stylesheet_path = Pagy.root.join('stylesheets', 'pagy.tailwind.css') ``` -:::code source="/lib/stylesheets/pagy.tailwind.css" ::: +:::code source="/gem/stylesheets/pagy.tailwind.css" ::: +++ diff --git a/docs/extras/arel.md b/docs/extras/arel.md index 42574e4e4..289aefc15 100644 --- a/docs/extras/arel.md +++ b/docs/extras/arel.md @@ -28,10 +28,6 @@ require 'pagy/extras/arel' @pagy, @items = pagy_arel(a_collection, **vars) ``` -## Files - -- [arel.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/arel.rb) - ## Methods ==- `pagy_arel(collection, vars=nil)` diff --git a/docs/extras/array.md b/docs/extras/array.md index 3b4998241..640eb55e0 100644 --- a/docs/extras/array.md +++ b/docs/extras/array.md @@ -43,10 +43,6 @@ require 'pagy/extras/array' @pagy, @items = pagy_array(an_array, **vars) ``` -## Files - -- [array.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/array.rb) - ## Methods ==- `pagy_array(array, vars=nil)` diff --git a/docs/extras/bootstrap.md b/docs/extras/bootstrap.md index dfe9ce5ac..738732c37 100644 --- a/docs/extras/bootstrap.md +++ b/docs/extras/bootstrap.md @@ -25,10 +25,6 @@ require 'pagy/extras/bootstrap' See: [Javascript](/docs/api/javascript.md) if you use `pagy_bootstrap_nav_js` or `pagy_bootstrap_combo_nav_js`. -## Files - -- [bootstrap.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/bootstrap.rb) - ## Methods This extra adds 3 nav helpers to the `Pagy::Frontend` module. diff --git a/docs/extras/bulma.md b/docs/extras/bulma.md index a72f32de6..22083310a 100644 --- a/docs/extras/bulma.md +++ b/docs/extras/bulma.md @@ -24,14 +24,6 @@ require 'pagy/extras/bulma' See [Javascript](/docs/api/javascript.md) if you use `pagy_bulma_nav_js` or `pagy_bulma_combo_nav_js`. -## Files - -- [bulma.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/bulma.rb) - -| Variable | Description | Default | -|:---------------------|:------------------------------------------------------------------------------|:----------------| -| `:bulma_nav_classes` | Edit the classes for the nav element. You can try "is-small", "is-round" etc. | `"is-centered"` | - ## Methods This extra adds 3 nav helpers to the `Pagy::Frontend` module. diff --git a/docs/extras/calendar.md b/docs/extras/calendar.md index ff88f9b70..28867e7da 100644 --- a/docs/extras/calendar.md +++ b/docs/extras/calendar.md @@ -1,8 +1,8 @@ --- title: Calendar categories: -- Backend -- Extra + - Backend + - Extra image: none --- @@ -47,9 +47,9 @@ end # some action: def index - @calendar, @pagy, @records = pagy_calendar(collection, year: { size: [1, 1, 1, 1], ... }, - month: { size: [0, 12, 12, 0], ... }, - pagy: { items: 10, ...}) + @calendar, @pagy, @records = pagy_calendar(collection, year: { size: [1, 1, 1, 1], ... }, + month: { size: [0, 12, 12, 0], ... }, + pagy: { items: 10, ... }) end ``` @@ -88,10 +88,6 @@ The whole usage boils down to these steps: See [Pagy::Calendar](/docs/api/calendar.md#variables) -## Files - -- [calendar.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/calendar.rb) - ## Methods All the methods in this module are prefixed with the `"pagy_calendar"` string in order to avoid any possible conflict with your @@ -176,7 +172,6 @@ If the `:pagy` key/value is omitted, a default `Pagy` instance will be created b The calendar is active by default, however you can add an optional `:active` boolean flag to the `configuration` hash in order to switch it ON or OFF, depending on its usefulness in different conditions (see the [Use cases](#use-cases)). - ==- `pagy_calendar_period(collection)` !!!primary Must implement @@ -199,7 +194,7 @@ time from anywhere): # Simpler version (2 queries) def pagy_calendar_period(collection) starting = collection.minimum('created_at') - ending = collection.maximum('created_at') + ending = collection.maximum('created_at') [starting.in_time_zone, ending.in_time_zone] end @@ -248,8 +243,9 @@ If you use `ActiveRecord` the `collection` is going to be an `ActiveRecord::Rela an example with the `created_at` field again (but you can use anything, of course): ```ruby controller + def pagy_calendar_filter(collection, from, to) - collection.where(created_at: from...to) # 3-dots range excluding the end value + collection.where(created_at: from...to) # 3-dots range excluding the end value end ``` @@ -326,9 +322,8 @@ You have a couple of options: - Use the [i18n extra](i18n.md), which delegates the translation and localization to the `I18n` gem. Notice however that you would lose the performance gain offered by the built-in `pagy_t` translation. -- Uncomment the block in the calendar section in the [pagy.rb](https://github.com/ddnexus/pagy/blob/master/lib/config/pagy.rb) - initializer, which will add the localization from the `I18n` gem without using the [i18n extra](/docs/extras/i18n.md), so - preserving the builtin `pagy_t` translation. +- Uncomment the block in the calendar section in the pagy initializer, which will add the localization from the `I18n` gem without + using the [i18n extra](/docs/extras/i18n.md), so preserving the builtin `pagy_t` translation. ## Caveats diff --git a/docs/extras/countless.md b/docs/extras/countless.md index 9c99cb94b..ebab83d68 100644 --- a/docs/extras/countless.md +++ b/docs/extras/countless.md @@ -83,10 +83,6 @@ This mode is enabled by the `:countless_minimal` variable. |:---------------------|:----------------------------------|:--------| | `:countless_minimal` | enable the countless minimal mode | `false` | -## Files - -- [countless.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/countless.rb) - ## Methods ==- `pagy_countless(collection, vars=nil)` diff --git a/docs/extras/elasticsearch_rails.md b/docs/extras/elasticsearch_rails.md index d8acd64bd..78aacba44 100644 --- a/docs/extras/elasticsearch_rails.md +++ b/docs/extras/elasticsearch_rails.md @@ -58,10 +58,6 @@ Pagy creates its object out of your result. +++ -## Files - -- [elasticsearch_rails.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/elasticsearch_rails.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/foundation.md b/docs/extras/foundation.md index 60877681f..b9d3717f6 100644 --- a/docs/extras/foundation.md +++ b/docs/extras/foundation.md @@ -26,10 +26,6 @@ require 'pagy/extras/foundation' See [Javascript](/docs/api/javascript.md) if you use `pagy_foundation_nav_js` or `pagy_foundation_combo_nav_js`. -## Files - -- [foundation.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/foundation.rb) - ## Methods === `pagy_foundation_nav(pagy)` diff --git a/docs/extras/gearbox.md b/docs/extras/gearbox.md index 61c7777a7..73863a1eb 100644 --- a/docs/extras/gearbox.md +++ b/docs/extras/gearbox.md @@ -66,10 +66,6 @@ Pagy::DEFAULT[:gearbox_items] = [10, 20, 50] # your own default @pagy, @records = pagy(collection, items_extra: false, gearbox_items: [30, 60, 100]) ``` -## Files - -- [gearbox.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/gearbox.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/headers.md b/docs/extras/headers.md index 63c9486a1..8f291b5b8 100644 --- a/docs/extras/headers.md +++ b/docs/extras/headers.md @@ -51,10 +51,6 @@ end pagy_render(collection) ``` -## Files - -- [headers.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/headers.rb) - ## Headers This extra generates the standard `link` header defined in the diff --git a/docs/extras/i18n.md b/docs/extras/i18n.md index 0099026ea..23eb9429f 100644 --- a/docs/extras/i18n.md +++ b/docs/extras/i18n.md @@ -28,7 +28,3 @@ of your app. ```ruby pagy.rb (initializer) require 'pagy/extras/i18n' ``` - -## Files - -- [i18n.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/i18n.rb) diff --git a/docs/extras/items.md b/docs/extras/items.md index 0c60bc4d8..d7b38a2c7 100644 --- a/docs/extras/items.md +++ b/docs/extras/items.md @@ -59,10 +59,6 @@ Pagy::DEFAULT[:max_items] = 200 # default 100 See [Javascript](/docs/api/javascript.md) (only if you use the `pagy_items_selector_js` UI) -## Files - -- [items.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/items.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/jsonapi.md b/docs/extras/jsonapi.md index d42510020..5d7c29226 100644 --- a/docs/extras/jsonapi.md +++ b/docs/extras/jsonapi.md @@ -58,10 +58,6 @@ links_hash = pagy_jsonapi_links(@pagy) # next: 'https://example.com/products?page[number]=33&page[size]=50&...'} ``` -## Files - -- [items.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/jsonapi.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/materialize.md b/docs/extras/materialize.md index 6ef5abada..b74928164 100644 --- a/docs/extras/materialize.md +++ b/docs/extras/materialize.md @@ -26,10 +26,6 @@ require 'pagy/extras/materialize' See [Javascript](/docs/api/javascript.md) if you use `pagy_materialize_nav_js` or `pagy_materialize_combo_nav_js`. -## Files - -- [materialize.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/materialize.rb) - ## Methods This extra adds 3 nav helpers to the `Pagy::Frontend` module. You can customize them by direct overriding in your own view helper. diff --git a/docs/extras/meilisearch.md b/docs/extras/meilisearch.md index 00c04b2d4..e53c78f7e 100644 --- a/docs/extras/meilisearch.md +++ b/docs/extras/meilisearch.md @@ -60,10 +60,6 @@ Pagy creates its object out of your result. +++ -## Files - -- [meilisearch.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/meilisearch.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/metadata.md b/docs/extras/metadata.md index 3d99746e7..63b50e009 100644 --- a/docs/extras/metadata.md +++ b/docs/extras/metadata.md @@ -23,10 +23,6 @@ render json: { data: records, pagy: pagy_metadata(pagy, ...) } ``` -## Files - -- [metadata.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/metadata.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/overflow.md b/docs/extras/overflow.md index 18648c35d..f0a043682 100644 --- a/docs/extras/overflow.md +++ b/docs/extras/overflow.md @@ -29,10 +29,6 @@ Pagy::DEFAULT[:overflow] = :exception ``` -## Files - -- [overflow.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/overflow.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/pagy.md b/docs/extras/pagy.md index 3b4d92ff2..514ebd090 100644 --- a/docs/extras/pagy.md +++ b/docs/extras/pagy.md @@ -35,10 +35,6 @@ pagy_next_url(@pagy, absolute: bool) See [Javascript](/docs/api/javascript.md). -## Files - -- [pagy.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/pagy.rb) - ## Methods ==- `pagy_nav(pagy, **vars)` diff --git a/docs/extras/searchkick.md b/docs/extras/searchkick.md index 543dd9ae2..16e9b8126 100644 --- a/docs/extras/searchkick.md +++ b/docs/extras/searchkick.md @@ -61,10 +61,6 @@ Pagy creates its object out of your result. +++ -## Files - -- [searchkick.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/searchkick.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/semantic.md b/docs/extras/semantic.md index 2f7f761e8..b460c46b9 100644 --- a/docs/extras/semantic.md +++ b/docs/extras/semantic.md @@ -24,10 +24,6 @@ require 'pagy/extras/semantic' <%== pagy_semantic_combo_nav_js(@pagy, **vars) %> ``` -## Files - -- [semantic.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/semantic.rb) - ## Methods This extra adds 3 nav helpers to the `Pagy::Frontend` module. You can customize them by direct overriding in your own view helper. diff --git a/docs/extras/standalone.md b/docs/extras/standalone.md index edb7e8ba5..3f0626401 100644 --- a/docs/extras/standalone.md +++ b/docs/extras/standalone.md @@ -38,10 +38,6 @@ Pagy::DEFAULT[:url] = 'http://www.example.com/subdir' @pagy, @products = pagy(collection, url: 'http://www.example.com/subdir', params: {...}) ``` -## Files - -- [standalone.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/standalone.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/trim.md b/docs/extras/trim.md index 2dd32e25f..2b445b734 100644 --- a/docs/extras/trim.md +++ b/docs/extras/trim.md @@ -32,10 +32,6 @@ Pagy::DEFAULT[:trim_extra] = false # default true @pagy, @records = pagy(collection, trim_extra: true) ``` -## Files - -- [trim.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/trim.rb) - ## Variables | Variable | Description | Default | diff --git a/docs/extras/uikit.md b/docs/extras/uikit.md index f44c1a383..d4e74cff7 100644 --- a/docs/extras/uikit.md +++ b/docs/extras/uikit.md @@ -23,10 +23,6 @@ require 'pagy/extras/uikit' <%== pagy_uikit_combo_nav_js(@pagy, **vars) %> ``` -## Files - -- [uikit.rb](https://github.com/ddnexus/pagy/blob/master/lib/pagy/extras/uikit.rb) - ## Methods This extra adds the above nav helpers to the `Pagy::Frontend` module. You can customize it by direct overriding in your own view diff --git a/docs/how-to.md b/docs/how-to.md index 886c7d8c9..8edc0af84 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -134,7 +134,7 @@ specific app. Default en dictionary -:::code source="/lib/locales/en.yml" ::: +:::code source="/gem/locales/en.yml" :::

@@ -280,7 +280,7 @@ by Ben Koshy. The `pagy_info` and the `pagy_items_selector_js` helpers use the "item"/"items" generic name in their output. You can change that by editing the values of the `"pagy.item_name"` i18n key in -the [dictionary files](https://github.com/ddnexus/pagy/blob/master/lib/locales) that your app is using. +the [dictionary files](https://github.com/ddnexus/pagy/blob/master/gem/locales) that your app is using. Besides you can also pass the `:item_name` by passing an already pluralized string directly to the helper call: @@ -657,8 +657,7 @@ Then of course, regardless the kind of collection, you can render the navigation <%== pagy_nav(@pagy) %> ``` -See the [Pagy::Backend source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/backend.rb) and -the [Pagy::Backend API documentation](api/backend.md) for more details. +See the [Pagy::Backend API documentation](api/backend.md) for more details. ## Use the pagy_nav* helpers diff --git a/docs/migration-guide.md b/docs/migration-guide.md index 5bfafbad0..5da8c88c0 100644 --- a/docs/migration-guide.md +++ b/docs/migration-guide.md @@ -35,8 +35,8 @@ Don't worry about missing something in this step: if anything won't work as befo #### Preparation -- Copy the [pagy.rb](https://github.com/ddnexus/pagy/blob/master/lib/config/pagy.rb) initializer: you will edit it during the - process. +- Download the pagy initializer: you will edit it during the process. + [!file](/gem/config/pagy.rb) - Replace the legacy gem with `gem "pagy"` in the `Gemfile` and `bundle`, or install and require the gem if you don't use bundler. - Ensure that the legacy gem will not get loaded anymore (or it could mask some old statement still in place and not converted) - Add the `include Pagy::Backend` statement to the application controller. diff --git a/e2e/pagy_app.ru b/e2e/pagy_app.ru index d96af1d06..bbdd3e024 100644 --- a/e2e/pagy_app.ru +++ b/e2e/pagy_app.ru @@ -14,7 +14,7 @@ require 'bundler' Bundler.require(:default, :apps) require 'oj' # require false in Gemfile -$LOAD_PATH.unshift File.expand_path('../lib', __dir__) +$LOAD_PATH.unshift File.expand_path('../gem/lib', __dir__) require 'pagy' # pagy initializer diff --git a/lib/apps/calendar.ru b/gem/apps/calendar.ru similarity index 99% rename from lib/apps/calendar.ru rename to gem/apps/calendar.ru index 2c7f8f680..f82a585d9 100644 --- a/lib/apps/calendar.ru +++ b/gem/apps/calendar.ru @@ -18,7 +18,7 @@ # DOC # https://ddnexus.github.io/pagy/playground/#4-calendar-app -VERSION = '8.0.0' +VERSION = '8.0.1' require 'bundler/inline' gemfile(true) do diff --git a/lib/apps/demo.ru b/gem/apps/demo.ru similarity index 99% rename from lib/apps/demo.ru rename to gem/apps/demo.ru index fb806c736..394775264 100644 --- a/lib/apps/demo.ru +++ b/gem/apps/demo.ru @@ -18,7 +18,7 @@ # DOC # https://ddnexus.github.io/pagy/playground/#3-demo-app -VERSION = '8.0.0' +VERSION = '8.0.1' require 'bundler/inline' gemfile(true) do diff --git a/lib/apps/rails.ru b/gem/apps/rails.ru similarity index 99% rename from lib/apps/rails.ru rename to gem/apps/rails.ru index 7786b2470..e5b209dfb 100644 --- a/lib/apps/rails.ru +++ b/gem/apps/rails.ru @@ -15,7 +15,7 @@ # DOC # https://ddnexus.github.io/pagy/playground/#2-rails-app -VERSION = '8.0.0' +VERSION = '8.0.1' # Gemfile require 'bundler/inline' diff --git a/lib/apps/repro.ru b/gem/apps/repro.ru similarity index 99% rename from lib/apps/repro.ru rename to gem/apps/repro.ru index a72bd79c8..d1919c0d1 100644 --- a/lib/apps/repro.ru +++ b/gem/apps/repro.ru @@ -15,7 +15,7 @@ # DOC # https://ddnexus.github.io/pagy/playground/#1-repro-app -VERSION = '8.0.0' +VERSION = '8.0.1' require 'bundler/inline' gemfile(true) do diff --git a/lib/bin/pagy b/gem/bin/pagy similarity index 92% rename from lib/bin/pagy rename to gem/bin/pagy index ab3f29e0c..2a1c93a4c 100755 --- a/lib/bin/pagy +++ b/gem/bin/pagy @@ -1,10 +1,10 @@ #!/usr/bin/env ruby # frozen_string_literal: true -VERSION = '8.0.0' +VERSION = '8.0.1' APPS = %w[repro rails demo calendar].freeze -require_relative '../optimist' +require_relative '../lib/optimist' opts = Optimist.options do text <<~HEAD Pagy #{VERSION} (https://ddnexus.github.io/pagy/playground) @@ -24,7 +24,7 @@ opts = Optimist.options do pagy ~/my-repro.ru Develop ~/my-repro.ru at http://0.0.0.0:8000 HEAD text 'Rackup options' - opt :env, 'Environment', default: 'development' + opt :env, 'Environment', default: 'development' opt :host, 'Host', default: '0.0.0.0', short: :o opt :port, 'Port', default: 8000 text 'Rerun options' @@ -70,7 +70,7 @@ else end Optimist.die("#{file.inspect} app not found") unless File.exist?(file) # Run command - rackup = "rackup -I #{File.expand_path('..', __dir__)} -r pagy -o #{opts[:host]} -p #{opts[:port]} -E #{opts[:env]} #{file}" + rackup = "rackup -I #{File.expand_path('../lib', __dir__)} -r pagy -o #{opts[:host]} -p #{opts[:port]} -E #{opts[:env]} #{file}" rackup << ' -q' if opts[:quiet] if opts[:rerun] name = File.basename(file) diff --git a/lib/config/pagy.rb b/gem/config/pagy.rb similarity index 99% rename from lib/config/pagy.rb rename to gem/config/pagy.rb index 560220d97..b5f009db5 100644 --- a/lib/config/pagy.rb +++ b/gem/config/pagy.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Pagy initializer file (8.0.0) +# Pagy initializer file (8.0.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/lib/javascripts/pagy-dev.js b/gem/javascripts/pagy-dev.js similarity index 99% rename from lib/javascripts/pagy-dev.js rename to gem/javascripts/pagy-dev.js index e3e9f5fea..54e7a5bd1 100644 --- a/lib/javascripts/pagy-dev.js +++ b/gem/javascripts/pagy-dev.js @@ -80,7 +80,7 @@ window.Pagy = (() => { const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), ""); // Public interface return { - version: "8.0.0", + version: "8.0.1", // 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; @@ -109,4 +109,4 @@ window.Pagy = (() => { } }; })(); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWtCQSxNQUFNLElBQUksR0FBRyxDQUFDLEdBQUcsRUFBRTtJQUNmLDRDQUE0QztJQUM1QyxNQUFNLFdBQVcsR0FBRyxJQUFJLGNBQWMsQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUNOLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFhLFdBQVcsQ0FBQyxDQUFDLE9BQU8sQ0FDM0UsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7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NvbnN0IGZpbGxJbiA9IChhOnN0cmluZywgcGFnZTpzdHJpbmcsIGxhYmVsOnN0cmluZyk6c3RyaW5nID0+XG4gICAgICAgICAgICBhLnJlcGxhY2UoL19fcGFneV9wYWdlX18vZywgcGFnZSkucmVwbGFjZSgvX19wYWd5X2xhYmVsX18vZywgbGFiZWwpO1xuICAgICAgICAoZWwucGFneVJlbmRlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gd2lkdGhzLmZpbmQodyA9PiB3IDwgY29udGFpbmVyLmNsaWVudFdpZHRoKSB8fCAwO1xuICAgICAgICAgICAgaWYgKHdpZHRoID09PSBsYXN0V2lkdGgpIHsgcmV0dXJuIH0gLy8gbm8gY2hhbmdlOiBhYm9ydFxuICAgICAgICAgICAgbGV0IGh0bWwgPSB0b2tlbnMuYmVmb3JlOyAgLy8gYWxyZWFkeSB0cmltbWVkIGluIGh0bWxcbiAgICAgICAgICAgIGNvbnN0IHNlcmllcyA9IHNlcXVlbHNbd2lkdGgudG9TdHJpbmcoKV07XG4gICAgICAgICAgICBjb25zdCBsYWJlbHMgPSBsYWJlbFNlcXVlbHM/Llt3aWR0aC50b1N0cmluZygpXSA/PyBzZXJpZXMubWFwKGwgPT4gbC50b1N0cmluZygpKTtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaSBpbiBzZXJpZXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtID0gc2VyaWVzW2ldO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxhYmVsID0gbGFiZWxzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGZpbGxJbih0b2tlbnMuYSwgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh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luLCB2YWwsIG1heF0gPSBbaW5wdXQubWluLCBpbnB1dC52YWx1ZSwgaW5wdXQubWF4XS5tYXAobiA9PiBwYXJzZUludChuKSB8fCAwKTtcbiAgICAgICAgICAgIGlmICh2YWwgPCBtaW4gfHwgdmFsID4gbWF4KSB7ICAvLyByZXNldCBpbnZhbGlkL291dC1vZi1yYW5nZVxuICAgICAgICAgICAgICAgIGlucHV0LnZhbHVlID0gaW5pdGlhbDtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZWxlY3QoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgW3BhZ2UsIHVybF0gPSBnZXRWYXJzKGlucHV0LnZhbHVlKTsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIHByZWZlci1jb25zdFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgcGFnZSA9PT0gXCIxXCIpIHsgdXJsID0gdHJpbSh1cmwsIHRyaW1QYXJhbSkgfVxuICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7XG4gICAgICAgIH07XG4gICAgICAgIFtcImNoYW5nZVwiLCBcImZvY3VzXCJdLmZvckVhY2goZSA9PiBpbnB1dC5hZGRFdmVudExpc3RlbmVyKGUsIGlucHV0LnNlbGVjdCkpOyAgICAgICAgLy8gYXV0by1zZWxlY3RcbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImZvY3Vzb3V0XCIsIGFjdGlvbik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBhY3Rpb25cbiAgICAgICAgaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihcImtleXByZXNzXCIsIGUgPT4geyBpZiAoZS5rZXkgPT09IFwiRW50ZXJcIikgeyBhY3Rpb24oKSB9IH0pOyAvLyB0cmlnZ2VyIGFjdGlvblxuIC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4YXJyYXkpKTsgLy8gYmFzZTY0LXV0ZjggLT4gSlNPTiAtPiBBcnJheVxuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5d29yZCA9PT0gXCJuYXZcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdE5hdihlbCBhcyBOYXZFbGVtZW50LCBhcmdzIGFzIE5hdkFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwiY29tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbWJvKGVsLCBhcmdzIGFzIENvbWJvQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VsZWN0b3IoZWwsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlNraXBwZWQgUGFneS5pbml0KCkgZm9yOiAlb1xcblVua25vd24ga2V5d29yZCAnJXMnXCIsIGVsLCBrZXl3b3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgeyBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG4lc1wiLCBlbCwgZXJyKSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkoKTtcbiJdfQ== \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFneS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhZ3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWtCQSxNQUFNLElBQUksR0FBRyxDQUFDLEdBQUcsRUFBR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AgICAgICAgICAgICBjb25zdCBpdGVtID0gc2VyaWVzW2ldO1xuICAgICAgICAgICAgICAgIGNvbnN0IGxhYmVsID0gbGFiZWxzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpdGVtID09PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGZpbGxJbih0b2tlbnMuYSwgaXRlbS50b1N0cmluZygpLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdGVtID09PSBcImdhcFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRva2Vucy5nYXA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gYWN0aXZlIHBhZ2VcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gZmlsbEluKHRva2Vucy5jdXJyZW50LCBpdGVtLCBsYWJlbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGh0bWwgKz0gKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgaXRlbSA9PSAxKSA/IHRyaW0oZmlsbGVkLCB0cmltUGFyYW0pIDogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaHRtbCArPSB0b2tlbnMuYWZ0ZXI7ICAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBhbGlnbi1hc3NpZ25tZW50cy9hbGlnbi1hc3NpZ25tZW50c1xuICAgICAgICAgICAgZWwuaW5uZXJIVE1MID0gXCJcIjtcbiAgICAgICAgICAgIGVsLmluc2VydEFkamFjZW50SFRNTChcImFmdGVyYmVnaW5cIiwgaHRtbCk7XG4gICAgICAgICAgICBsYXN0V2lkdGggPSB3aWR0aDtcbiAgICAgICAgfSkoKTtcbiAgICAgICAgaWYgKGVsLmNsYXNzTGlzdC5jb250YWlucyhcInBhZ3ktcmpzXCIpKSB7I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bmcpID0+IHtcbiAgICAgICAgY29uc3QgaW5wdXQgPSBlbC5xdWVyeVNlbGVjdG9yKFwiaW5wdXRcIikgYXMgSFRNTElucHV0RWxlbWVudDtcbiAgICAgICAgY29uc3QgaW5pdGlhbCA9IGlucHV0LnZhbHVlO1xuICAgICAgICBjb25zdCBhY3Rpb24gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQudmFsdWUgPT09IGluaXRpYWwpIHsgcmV0dXJuIH0gIC8vIG5vdCBjaGFuZ2VkXG4gICAgICAgICAgICBjb25zdCBbbWluLCB2YWwsIG1heF0gPSBbaW5wdXQubWluLCBpbnB1dC52YWx1ZSwgaW5wdXQubWF4XS5tYXAobiA9PiBwYXJzZUludChuKSB8fCAwKTtcbiAgICAgICAgICAgIGlmICh2YWwgPCBtaW4gfHwgdmFsID4gbWF4KSB7ICAvLyByZXNldCBpbnZhbGlkL291dC1vZi1yYW5nZVxuICAgICAgICAgICAgICAgIGlucHV0LnZhbHVlID0gaW5pdGlhbDtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZWxlY3QoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgW3BhZ2UsIHVybF0gPSBnZXRWYXJzKGlucHV0LnZhbHVlKTsgICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIHByZWZlci1jb25zdFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmltUGFyYW0gPT09IFwic3RyaW5nXCIgJiYgcGFnZSA9PT0gXCIxXCIpIHsgdXJsID0gdHJpbSh1cmwsIHRyaW1QYXJhbSkgfVxuICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7XG4gICAgICAgIH07XG4gICAgICAgIFtcImNoYW5nZVwiLCBcImZvY3VzXCJdLmZvckVhY2goZSA9PiBpbnB1dC5hZGRFdmVudExpc3RlbmVyKGUsIGlucHV0LnNlbGVjdCkpOyAg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VtZW50cykge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQ4YXJyYXkgPSBVaW50OEFycmF5LmZyb20oYXRvYihlbC5nZXRBdHRyaWJ1dGUoXCJkYXRhLXBhZ3lcIikgYXMgc3RyaW5nKSwgYyA9PiBjLmNoYXJDb2RlQXQoMCkpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBba2V5d29yZCwgLi4uYXJnc10gPSBKU09OLnBhcnNlKChuZXcgVGV4dERlY29kZXIoKSkuZGVjb2RlKHVpbnQ4YXJyYXkpKTsgLy8gYmFzZTY0LXV0ZjggLT4gSlNPTiAtPiBBcnJheVxuICAgICAgICAgICAgICAgICAgICBpZiAoa2V5d29yZCA9PT0gXCJuYXZcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdE5hdihlbCBhcyBOYXZFbGVtZW50LCBhcmdzIGFzIE5hdkFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleXdvcmQgPT09IFwiY29tYm9cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbWJvKGVsLCBhcmdzIGFzIENvbWJvQXJncyk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2V5d29yZCA9PT0gXCJzZWxlY3RvclwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0U2VsZWN0b3IoZWwsIGFyZ3MgYXMgU2VsZWN0b3JBcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIlNraXBwZWQgUGFneS5pbml0KCkgZm9yOiAlb1xcblVua25vd24ga2V5d29yZCAnJXMnXCIsIGVsLCBrZXl3b3JkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikgeyBjb25zb2xlLndhcm4oXCJTa2lwcGVkIFBhZ3kuaW5pdCgpIGZvcjogJW9cXG4lc1wiLCBlbCwgZXJyKSB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufSkoKTtcbiJdfQ== \ No newline at end of file diff --git a/lib/javascripts/pagy-module.d.ts b/gem/javascripts/pagy-module.d.ts similarity index 100% rename from lib/javascripts/pagy-module.d.ts rename to gem/javascripts/pagy-module.d.ts diff --git a/lib/javascripts/pagy-module.js b/gem/javascripts/pagy-module.js similarity index 99% rename from lib/javascripts/pagy-module.js rename to gem/javascripts/pagy-module.js index ec7c814cd..ba3e09166 100644 --- a/lib/javascripts/pagy-module.js +++ b/gem/javascripts/pagy-module.js @@ -79,7 +79,7 @@ const Pagy = (() => { const trim = (a, param) => a.replace(new RegExp(`[?&]${param}=1\\b(?!&)|\\b${param}=1&`), ""); // Public interface return { - version: "8.0.0", + version: "8.0.1", // 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; diff --git a/lib/javascripts/pagy.js b/gem/javascripts/pagy.js similarity index 96% rename from lib/javascripts/pagy.js rename to gem/javascripts/pagy.js index 3ddf2d181..b2bf316b9 100644 --- a/lib/javascripts/pagy.js +++ b/gem/javascripts/pagy.js @@ -1 +1 @@ -!function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,n,a,i])=>{let l=t.parentElement??t,p=Object.keys(n).map(e=>parseInt(e)).sort((e,t)=>t-e),c=-1,s=(e,t,r)=>e.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,r);(t.pagyRender=function(){let e=p.find(e=>ee.toString());for(let e in f){let t;let n=f[e],a=y[e];t="number"==typeof n?s(r.a,n.toString(),a):"gap"===n?r.gap:s(r.current,n,a),g+="string"==typeof i&&1==n?o(t,i):t}g+=r.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",g),c=e})(),t.classList.contains("pagy-rjs")&&e.observe(l)},r=(e,[t,r])=>a(e,e=>[e,t.replace(/__pagy_page__/,e)],r),n=(e,[t,r,n])=>{a(e,e=>{let n=Math.max(Math.ceil(t/parseInt(e)),1).toString(),a=r.replace(/__pagy_page__/,n).replace(/__pagy_items__/,e);return[n,a]},n)},a=(e,t,r)=>{let n=e.querySelector("input"),a=n.value,i=function(){if(n.value===a)return;let[e,i,l]=[n.min,n.value,n.max].map(e=>parseInt(e)||0);if(il){n.value=a,n.select();return}let[p,c]=t(n.value);"string"==typeof r&&"1"===p&&(c=o(c,r)),window.location.href=c};["change","focus"].forEach(e=>n.addEventListener(e,n.select)),n.addEventListener("focusout",i),n.addEventListener("keypress",e=>{"Enter"===e.key&&i()})},o=(e,t)=>e.replace(RegExp(`[?&]${t}=1\\b(?!&)|\\b${t}=1&`),"");return{version:"8.0.0",init(e){for(let a of(e instanceof Element?e:document).querySelectorAll("[data-pagy]"))try{let e=Uint8Array.from(atob(a.getAttribute("data-pagy")),e=>e.charCodeAt(0)),[o,...i]=JSON.parse(new TextDecoder().decode(e));"nav"===o?t(a,i):"combo"===o?r(a,i):"selector"===o?n(a,i):console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",a,o)}catch(e){console.warn("Skipped Pagy.init() for: %o\n%s",a,e)}}}})();window.Pagy=e}(); \ No newline at end of file +!function(){let e=(()=>{let e=new ResizeObserver(e=>e.forEach(e=>e.target.querySelectorAll(".pagy-rjs").forEach(e=>e.pagyRender()))),t=(t,[r,n,a,i])=>{let l=t.parentElement??t,p=Object.keys(n).map(e=>parseInt(e)).sort((e,t)=>t-e),c=-1,s=(e,t,r)=>e.replace(/__pagy_page__/g,t).replace(/__pagy_label__/g,r);(t.pagyRender=function(){let e=p.find(e=>ee.toString());for(let e in f){let t;let n=f[e],a=y[e];t="number"==typeof n?s(r.a,n.toString(),a):"gap"===n?r.gap:s(r.current,n,a),g+="string"==typeof i&&1==n?o(t,i):t}g+=r.after,t.innerHTML="",t.insertAdjacentHTML("afterbegin",g),c=e})(),t.classList.contains("pagy-rjs")&&e.observe(l)},r=(e,[t,r])=>a(e,e=>[e,t.replace(/__pagy_page__/,e)],r),n=(e,[t,r,n])=>{a(e,e=>{let n=Math.max(Math.ceil(t/parseInt(e)),1).toString(),a=r.replace(/__pagy_page__/,n).replace(/__pagy_items__/,e);return[n,a]},n)},a=(e,t,r)=>{let n=e.querySelector("input"),a=n.value,i=function(){if(n.value===a)return;let[e,i,l]=[n.min,n.value,n.max].map(e=>parseInt(e)||0);if(il){n.value=a,n.select();return}let[p,c]=t(n.value);"string"==typeof r&&"1"===p&&(c=o(c,r)),window.location.href=c};["change","focus"].forEach(e=>n.addEventListener(e,n.select)),n.addEventListener("focusout",i),n.addEventListener("keypress",e=>{"Enter"===e.key&&i()})},o=(e,t)=>e.replace(RegExp(`[?&]${t}=1\\b(?!&)|\\b${t}=1&`),"");return{version:"8.0.1",init(e){for(let a of(e instanceof Element?e:document).querySelectorAll("[data-pagy]"))try{let e=Uint8Array.from(atob(a.getAttribute("data-pagy")),e=>e.charCodeAt(0)),[o,...i]=JSON.parse(new TextDecoder().decode(e));"nav"===o?t(a,i):"combo"===o?r(a,i):"selector"===o?n(a,i):console.warn("Skipped Pagy.init() for: %o\nUnknown keyword '%s'",a,o)}catch(e){console.warn("Skipped Pagy.init() for: %o\n%s",a,e)}}}})();window.Pagy=e}(); \ No newline at end of file diff --git a/lib/optimist.rb b/gem/lib/optimist.rb similarity index 100% rename from lib/optimist.rb rename to gem/lib/optimist.rb diff --git a/lib/pagy.rb b/gem/lib/pagy.rb similarity index 96% rename from lib/pagy.rb rename to gem/lib/pagy.rb index 91ad0d16f..ccb613323 100644 --- a/lib/pagy.rb +++ b/gem/lib/pagy.rb @@ -5,11 +5,11 @@ # Core class class Pagy - VERSION = '8.0.0' + VERSION = '8.0.1' - # Root pathname to get the path of Pagy files like templates or dictionaries + # Gem root pathname to get the path of Pagy files stylesheets, javascripts, apps, locales, etc. def self.root - @root ||= Pathname.new(__dir__).freeze + @root ||= Pathname.new(__dir__).parent.freeze end # Core defult: constant for easy access, but mutable for customizable defaults diff --git a/lib/pagy/backend.rb b/gem/lib/pagy/backend.rb similarity index 100% rename from lib/pagy/backend.rb rename to gem/lib/pagy/backend.rb diff --git a/lib/pagy/calendar.rb b/gem/lib/pagy/calendar.rb similarity index 100% rename from lib/pagy/calendar.rb rename to gem/lib/pagy/calendar.rb diff --git a/lib/pagy/calendar/day.rb b/gem/lib/pagy/calendar/day.rb similarity index 100% rename from lib/pagy/calendar/day.rb rename to gem/lib/pagy/calendar/day.rb diff --git a/lib/pagy/calendar/helper.rb b/gem/lib/pagy/calendar/helper.rb similarity index 100% rename from lib/pagy/calendar/helper.rb rename to gem/lib/pagy/calendar/helper.rb diff --git a/lib/pagy/calendar/month.rb b/gem/lib/pagy/calendar/month.rb similarity index 100% rename from lib/pagy/calendar/month.rb rename to gem/lib/pagy/calendar/month.rb diff --git a/lib/pagy/calendar/quarter.rb b/gem/lib/pagy/calendar/quarter.rb similarity index 100% rename from lib/pagy/calendar/quarter.rb rename to gem/lib/pagy/calendar/quarter.rb diff --git a/lib/pagy/calendar/week.rb b/gem/lib/pagy/calendar/week.rb similarity index 100% rename from lib/pagy/calendar/week.rb rename to gem/lib/pagy/calendar/week.rb diff --git a/lib/pagy/calendar/year.rb b/gem/lib/pagy/calendar/year.rb similarity index 100% rename from lib/pagy/calendar/year.rb rename to gem/lib/pagy/calendar/year.rb diff --git a/lib/pagy/console.rb b/gem/lib/pagy/console.rb similarity index 100% rename from lib/pagy/console.rb rename to gem/lib/pagy/console.rb diff --git a/lib/pagy/countless.rb b/gem/lib/pagy/countless.rb similarity index 100% rename from lib/pagy/countless.rb rename to gem/lib/pagy/countless.rb diff --git a/lib/pagy/exceptions.rb b/gem/lib/pagy/exceptions.rb similarity index 100% rename from lib/pagy/exceptions.rb rename to gem/lib/pagy/exceptions.rb diff --git a/lib/pagy/extras/arel.rb b/gem/lib/pagy/extras/arel.rb similarity index 100% rename from lib/pagy/extras/arel.rb rename to gem/lib/pagy/extras/arel.rb diff --git a/lib/pagy/extras/array.rb b/gem/lib/pagy/extras/array.rb similarity index 100% rename from lib/pagy/extras/array.rb rename to gem/lib/pagy/extras/array.rb diff --git a/lib/pagy/extras/bootstrap.rb b/gem/lib/pagy/extras/bootstrap.rb similarity index 100% rename from lib/pagy/extras/bootstrap.rb rename to gem/lib/pagy/extras/bootstrap.rb diff --git a/lib/pagy/extras/bulma.rb b/gem/lib/pagy/extras/bulma.rb similarity index 100% rename from lib/pagy/extras/bulma.rb rename to gem/lib/pagy/extras/bulma.rb diff --git a/lib/pagy/extras/calendar.rb b/gem/lib/pagy/extras/calendar.rb similarity index 100% rename from lib/pagy/extras/calendar.rb rename to gem/lib/pagy/extras/calendar.rb diff --git a/lib/pagy/extras/countless.rb b/gem/lib/pagy/extras/countless.rb similarity index 100% rename from lib/pagy/extras/countless.rb rename to gem/lib/pagy/extras/countless.rb diff --git a/lib/pagy/extras/elasticsearch_rails.rb b/gem/lib/pagy/extras/elasticsearch_rails.rb similarity index 100% rename from lib/pagy/extras/elasticsearch_rails.rb rename to gem/lib/pagy/extras/elasticsearch_rails.rb diff --git a/lib/pagy/extras/foundation.rb b/gem/lib/pagy/extras/foundation.rb similarity index 100% rename from lib/pagy/extras/foundation.rb rename to gem/lib/pagy/extras/foundation.rb diff --git a/lib/pagy/extras/gearbox.rb b/gem/lib/pagy/extras/gearbox.rb similarity index 100% rename from lib/pagy/extras/gearbox.rb rename to gem/lib/pagy/extras/gearbox.rb diff --git a/lib/pagy/extras/headers.rb b/gem/lib/pagy/extras/headers.rb similarity index 100% rename from lib/pagy/extras/headers.rb rename to gem/lib/pagy/extras/headers.rb diff --git a/lib/pagy/extras/i18n.rb b/gem/lib/pagy/extras/i18n.rb similarity index 100% rename from lib/pagy/extras/i18n.rb rename to gem/lib/pagy/extras/i18n.rb diff --git a/lib/pagy/extras/items.rb b/gem/lib/pagy/extras/items.rb similarity index 100% rename from lib/pagy/extras/items.rb rename to gem/lib/pagy/extras/items.rb diff --git a/lib/pagy/extras/js_tools.rb b/gem/lib/pagy/extras/js_tools.rb similarity index 100% rename from lib/pagy/extras/js_tools.rb rename to gem/lib/pagy/extras/js_tools.rb diff --git a/lib/pagy/extras/jsonapi.rb b/gem/lib/pagy/extras/jsonapi.rb similarity index 100% rename from lib/pagy/extras/jsonapi.rb rename to gem/lib/pagy/extras/jsonapi.rb diff --git a/lib/pagy/extras/materialize.rb b/gem/lib/pagy/extras/materialize.rb similarity index 100% rename from lib/pagy/extras/materialize.rb rename to gem/lib/pagy/extras/materialize.rb diff --git a/lib/pagy/extras/meilisearch.rb b/gem/lib/pagy/extras/meilisearch.rb similarity index 100% rename from lib/pagy/extras/meilisearch.rb rename to gem/lib/pagy/extras/meilisearch.rb diff --git a/lib/pagy/extras/metadata.rb b/gem/lib/pagy/extras/metadata.rb similarity index 100% rename from lib/pagy/extras/metadata.rb rename to gem/lib/pagy/extras/metadata.rb diff --git a/lib/pagy/extras/overflow.rb b/gem/lib/pagy/extras/overflow.rb similarity index 100% rename from lib/pagy/extras/overflow.rb rename to gem/lib/pagy/extras/overflow.rb diff --git a/lib/pagy/extras/pagy.rb b/gem/lib/pagy/extras/pagy.rb similarity index 100% rename from lib/pagy/extras/pagy.rb rename to gem/lib/pagy/extras/pagy.rb diff --git a/lib/pagy/extras/searchkick.rb b/gem/lib/pagy/extras/searchkick.rb similarity index 100% rename from lib/pagy/extras/searchkick.rb rename to gem/lib/pagy/extras/searchkick.rb diff --git a/lib/pagy/extras/semantic.rb b/gem/lib/pagy/extras/semantic.rb similarity index 100% rename from lib/pagy/extras/semantic.rb rename to gem/lib/pagy/extras/semantic.rb diff --git a/lib/pagy/extras/standalone.rb b/gem/lib/pagy/extras/standalone.rb similarity index 100% rename from lib/pagy/extras/standalone.rb rename to gem/lib/pagy/extras/standalone.rb diff --git a/lib/pagy/extras/trim.rb b/gem/lib/pagy/extras/trim.rb similarity index 100% rename from lib/pagy/extras/trim.rb rename to gem/lib/pagy/extras/trim.rb diff --git a/lib/pagy/extras/uikit.rb b/gem/lib/pagy/extras/uikit.rb similarity index 100% rename from lib/pagy/extras/uikit.rb rename to gem/lib/pagy/extras/uikit.rb diff --git a/lib/pagy/frontend.rb b/gem/lib/pagy/frontend.rb similarity index 100% rename from lib/pagy/frontend.rb rename to gem/lib/pagy/frontend.rb diff --git a/lib/pagy/i18n.rb b/gem/lib/pagy/i18n.rb similarity index 100% rename from lib/pagy/i18n.rb rename to gem/lib/pagy/i18n.rb diff --git a/lib/pagy/url_helpers.rb b/gem/lib/pagy/url_helpers.rb similarity index 100% rename from lib/pagy/url_helpers.rb rename to gem/lib/pagy/url_helpers.rb diff --git a/lib/locales/README.md b/gem/locales/README.md similarity index 90% rename from lib/locales/README.md rename to gem/locales/README.md index 5d5efbba3..f855dd0c0 100644 --- a/lib/locales/README.md +++ b/gem/locales/README.md @@ -14,13 +14,13 @@ You can create a Pull Request for your language, and get all the help you need t - [ ] Find the locale file you need in the [list of pluralization](https://github.com/svenfuchs/rails-i18n/tree/master/rails/pluralization) and check the pluralization rule in it. For example it is `::RailsI18n::Pluralization::OneOther.with_locale(:en)` for [`en.rb`](https://github.com/svenfuchs/rails-i18n/blob/master/rails/pluralization/en.rb). Note the rule part i.e. `OneOther`. In pagy that translates to the symbol `:one_other`. - - [ ] If the pluralization rule of your language is not the `:one_other` default, confirm that pagy already defines the pluralization rule of your dictionary file in the IRB console, with `require 'pagy'; p Pagy::I18n::P11n::RULE.keys` or check for it directly in the [i18n.rb file](https://github.com/ddnexus/pagy/blob/072c2c1cf57b36519fa39b0ce46b2796c2ab5716/lib/pagy/i18n.rb#L26-L91). + - [ ] If the pluralization rule of your language is not the `:one_other` default, confirm that pagy already defines the pluralization rule of your dictionary file in the IRB console, with `require 'pagy'; p Pagy::I18n::P11n::RULE.keys` or check for it directly in the [i18n.rb file](https://github.com/ddnexus/pagy/blob/master/gem/lib/pagy/i18n.rb#L26-L91). - [ ] If the rule is not defined, you can either: a) Add the rule as a new rule/lambda entry in the `Pagy::I18n::P11n::RULE` constant hash and relative tests or b) Just create an issue requesting the addition to the rule/lambda entry and tests. - - [ ] Add an entry for your locale to the [`Pagy::I18n::P11n::LOCALE` hash](https://github.com/ddnexus/pagy/blob/072c2c1cf57b36519fa39b0ce46b2796c2ab5716/lib/pagy/i18n.rb#L95C1-L115). + - [ ] Add an entry for your locale to the [`Pagy::I18n::P11n::LOCALE` hash](https://github.com/ddnexus/pagy/blob/master/gem/lib/pagy/i18n.rb#L95C1-L115). -- [ ] add/edit the first line comment in the language rule in your dictionary file (e.g. `# :one_other pluralization ...`. For example, the [Japanese locale file](https://github.com/ddnexus/pagy/blob/072c2c1cf57b36519fa39b0ce46b2796c2ab5716/lib/locales/ja.yml#L1) uses the: `# :other pluralization ...` +- [ ] add/edit the first line comment in the language rule in your dictionary file (e.g. `# :one_other pluralization ...`. For example, the [Japanese locale file](https://github.com/ddnexus/pagy/blob/master/gem/lib/locales/ja.yml#L1) uses the: `# :other pluralization ...` - [ ] The mandatory pluralized entry in the dictionary file is the `item_name`. Please, provide all the plurals needed by your language. E.g. if your language uses the `:east_slavic` you should provide the plurals for `one`, `few`, `many` and `other`, if it uses `:one_other`, you should provide `one` and `other` plurals. If it uses `:other` you should only provide a single value. Look into other dictionary files to get some example. Ask if in doubt. diff --git a/lib/locales/ar.yml b/gem/locales/ar.yml similarity index 100% rename from lib/locales/ar.yml rename to gem/locales/ar.yml diff --git a/lib/locales/be.yml b/gem/locales/be.yml similarity index 100% rename from lib/locales/be.yml rename to gem/locales/be.yml diff --git a/lib/locales/bg.yml b/gem/locales/bg.yml similarity index 100% rename from lib/locales/bg.yml rename to gem/locales/bg.yml diff --git a/lib/locales/bs.yml b/gem/locales/bs.yml similarity index 100% rename from lib/locales/bs.yml rename to gem/locales/bs.yml diff --git a/lib/locales/ca.yml b/gem/locales/ca.yml similarity index 100% rename from lib/locales/ca.yml rename to gem/locales/ca.yml diff --git a/lib/locales/ckb.yml b/gem/locales/ckb.yml similarity index 100% rename from lib/locales/ckb.yml rename to gem/locales/ckb.yml diff --git a/lib/locales/cs.yml b/gem/locales/cs.yml similarity index 100% rename from lib/locales/cs.yml rename to gem/locales/cs.yml diff --git a/lib/locales/da.yml b/gem/locales/da.yml similarity index 100% rename from lib/locales/da.yml rename to gem/locales/da.yml diff --git a/lib/locales/de.yml b/gem/locales/de.yml similarity index 100% rename from lib/locales/de.yml rename to gem/locales/de.yml diff --git a/lib/locales/en.yml b/gem/locales/en.yml similarity index 100% rename from lib/locales/en.yml rename to gem/locales/en.yml diff --git a/lib/locales/es.yml b/gem/locales/es.yml similarity index 100% rename from lib/locales/es.yml rename to gem/locales/es.yml diff --git a/lib/locales/fr.yml b/gem/locales/fr.yml similarity index 100% rename from lib/locales/fr.yml rename to gem/locales/fr.yml diff --git a/lib/locales/hr.yml b/gem/locales/hr.yml similarity index 100% rename from lib/locales/hr.yml rename to gem/locales/hr.yml diff --git a/lib/locales/id.yml b/gem/locales/id.yml similarity index 100% rename from lib/locales/id.yml rename to gem/locales/id.yml diff --git a/lib/locales/it.yml b/gem/locales/it.yml similarity index 100% rename from lib/locales/it.yml rename to gem/locales/it.yml diff --git a/lib/locales/ja.yml b/gem/locales/ja.yml similarity index 100% rename from lib/locales/ja.yml rename to gem/locales/ja.yml diff --git a/lib/locales/km.yml b/gem/locales/km.yml similarity index 100% rename from lib/locales/km.yml rename to gem/locales/km.yml diff --git a/lib/locales/ko.yml b/gem/locales/ko.yml similarity index 100% rename from lib/locales/ko.yml rename to gem/locales/ko.yml diff --git a/lib/locales/nb.yml b/gem/locales/nb.yml similarity index 100% rename from lib/locales/nb.yml rename to gem/locales/nb.yml diff --git a/lib/locales/nl.yml b/gem/locales/nl.yml similarity index 100% rename from lib/locales/nl.yml rename to gem/locales/nl.yml diff --git a/lib/locales/nn.yml b/gem/locales/nn.yml similarity index 100% rename from lib/locales/nn.yml rename to gem/locales/nn.yml diff --git a/lib/locales/pl.yml b/gem/locales/pl.yml similarity index 100% rename from lib/locales/pl.yml rename to gem/locales/pl.yml diff --git a/lib/locales/pt-BR.yml b/gem/locales/pt-BR.yml similarity index 100% rename from lib/locales/pt-BR.yml rename to gem/locales/pt-BR.yml diff --git a/lib/locales/pt.yml b/gem/locales/pt.yml similarity index 100% rename from lib/locales/pt.yml rename to gem/locales/pt.yml diff --git a/lib/locales/ru.yml b/gem/locales/ru.yml similarity index 100% rename from lib/locales/ru.yml rename to gem/locales/ru.yml diff --git a/lib/locales/sr.yml b/gem/locales/sr.yml similarity index 100% rename from lib/locales/sr.yml rename to gem/locales/sr.yml diff --git a/lib/locales/sv-SE.yml b/gem/locales/sv-SE.yml similarity index 100% rename from lib/locales/sv-SE.yml rename to gem/locales/sv-SE.yml diff --git a/lib/locales/sv.yml b/gem/locales/sv.yml similarity index 100% rename from lib/locales/sv.yml rename to gem/locales/sv.yml diff --git a/lib/locales/sw.yml b/gem/locales/sw.yml similarity index 100% rename from lib/locales/sw.yml rename to gem/locales/sw.yml diff --git a/lib/locales/ta.yml b/gem/locales/ta.yml similarity index 100% rename from lib/locales/ta.yml rename to gem/locales/ta.yml diff --git a/lib/locales/tr.yml b/gem/locales/tr.yml similarity index 100% rename from lib/locales/tr.yml rename to gem/locales/tr.yml diff --git a/lib/locales/uk.yml b/gem/locales/uk.yml similarity index 100% rename from lib/locales/uk.yml rename to gem/locales/uk.yml diff --git a/lib/locales/vi.yml b/gem/locales/vi.yml similarity index 100% rename from lib/locales/vi.yml rename to gem/locales/vi.yml diff --git a/lib/locales/zh-CN.yml b/gem/locales/zh-CN.yml similarity index 100% rename from lib/locales/zh-CN.yml rename to gem/locales/zh-CN.yml diff --git a/lib/locales/zh-HK.yml b/gem/locales/zh-HK.yml similarity index 100% rename from lib/locales/zh-HK.yml rename to gem/locales/zh-HK.yml diff --git a/lib/locales/zh-TW.yml b/gem/locales/zh-TW.yml similarity index 100% rename from lib/locales/zh-TW.yml rename to gem/locales/zh-TW.yml diff --git a/lib/stylesheets/pagy.css b/gem/stylesheets/pagy.css similarity index 100% rename from lib/stylesheets/pagy.css rename to gem/stylesheets/pagy.css diff --git a/lib/stylesheets/pagy.scss b/gem/stylesheets/pagy.scss similarity index 100% rename from lib/stylesheets/pagy.scss rename to gem/stylesheets/pagy.scss diff --git a/lib/stylesheets/pagy.tailwind.css b/gem/stylesheets/pagy.tailwind.css similarity index 100% rename from lib/stylesheets/pagy.tailwind.css rename to gem/stylesheets/pagy.tailwind.css diff --git a/pagy.gemspec b/pagy.gemspec index ece57d942..79d70a540 100644 --- a/pagy.gemspec +++ b/pagy.gemspec @@ -1,6 +1,6 @@ # frozen_string_literal: true -lib = File.expand_path('lib', __dir__) +lib = File.expand_path('gem/lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'pagy' @@ -20,12 +20,10 @@ Gem::Specification.new do |s| 'bug_tracker_uri' => 'https://github.com/ddnexus/pagy/issues', 'changelog_uri' => 'https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md', 'support' => 'https://github.com/ddnexus/pagy/discussions/categories/q-a' } - # The pagy repo contains a lot of dir and files, so we conveniently use the 'lib' dir - # as the root container for whatever will get published in rubygems, including executables - s.bindir = 'lib/bin' + s.require_paths = ['gem/lib'] + s.bindir = 'gem/bin' s.executables << 'pagy' s.post_install_message = <<~PIM - *********************** PAGY WARNING! *********************** We may drop pagy's less used CSS extras. @@ -33,7 +31,6 @@ Gem::Specification.new do |s| https://github.com/ddnexus/pagy/discussions/categories/survey ************************************************************* - PIM s.required_ruby_version = '>= 3.1' end diff --git a/pagy.manifest b/pagy.manifest index a9a2a0a80..33d1e558f 100644 --- a/pagy.manifest +++ b/pagy.manifest @@ -1,90 +1,90 @@ -lib/apps/calendar.ru -lib/apps/demo.ru -lib/apps/rails.ru -lib/apps/repro.ru -lib/bin/pagy -lib/config/pagy.rb -lib/javascripts/pagy-dev.js -lib/javascripts/pagy-module.d.ts -lib/javascripts/pagy-module.js -lib/javascripts/pagy.js -lib/locales/ar.yml -lib/locales/be.yml -lib/locales/bg.yml -lib/locales/bs.yml -lib/locales/ca.yml -lib/locales/ckb.yml -lib/locales/cs.yml -lib/locales/da.yml -lib/locales/de.yml -lib/locales/en.yml -lib/locales/es.yml -lib/locales/fr.yml -lib/locales/hr.yml -lib/locales/id.yml -lib/locales/it.yml -lib/locales/ja.yml -lib/locales/km.yml -lib/locales/ko.yml -lib/locales/nb.yml -lib/locales/nl.yml -lib/locales/nn.yml -lib/locales/pl.yml -lib/locales/pt-BR.yml -lib/locales/pt.yml -lib/locales/ru.yml -lib/locales/sr.yml -lib/locales/sv-SE.yml -lib/locales/sv.yml -lib/locales/sw.yml -lib/locales/ta.yml -lib/locales/tr.yml -lib/locales/uk.yml -lib/locales/vi.yml -lib/locales/zh-CN.yml -lib/locales/zh-HK.yml -lib/locales/zh-TW.yml -lib/optimist.rb -lib/pagy.rb -lib/pagy/backend.rb -lib/pagy/calendar.rb -lib/pagy/calendar/day.rb -lib/pagy/calendar/helper.rb -lib/pagy/calendar/month.rb -lib/pagy/calendar/quarter.rb -lib/pagy/calendar/week.rb -lib/pagy/calendar/year.rb -lib/pagy/console.rb -lib/pagy/countless.rb -lib/pagy/exceptions.rb -lib/pagy/extras/arel.rb -lib/pagy/extras/array.rb -lib/pagy/extras/bootstrap.rb -lib/pagy/extras/bulma.rb -lib/pagy/extras/calendar.rb -lib/pagy/extras/countless.rb -lib/pagy/extras/elasticsearch_rails.rb -lib/pagy/extras/foundation.rb -lib/pagy/extras/gearbox.rb -lib/pagy/extras/headers.rb -lib/pagy/extras/i18n.rb -lib/pagy/extras/items.rb -lib/pagy/extras/js_tools.rb -lib/pagy/extras/jsonapi.rb -lib/pagy/extras/materialize.rb -lib/pagy/extras/meilisearch.rb -lib/pagy/extras/metadata.rb -lib/pagy/extras/overflow.rb -lib/pagy/extras/pagy.rb -lib/pagy/extras/searchkick.rb -lib/pagy/extras/semantic.rb -lib/pagy/extras/standalone.rb -lib/pagy/extras/trim.rb -lib/pagy/extras/uikit.rb -lib/pagy/frontend.rb -lib/pagy/i18n.rb -lib/pagy/url_helpers.rb -lib/stylesheets/pagy.css -lib/stylesheets/pagy.scss -lib/stylesheets/pagy.tailwind.css +gem/apps/calendar.ru +gem/apps/demo.ru +gem/apps/rails.ru +gem/apps/repro.ru +gem/bin/pagy +gem/config/pagy.rb +gem/javascripts/pagy-dev.js +gem/javascripts/pagy-module.d.ts +gem/javascripts/pagy-module.js +gem/javascripts/pagy.js +gem/lib/optimist.rb +gem/lib/pagy.rb +gem/lib/pagy/backend.rb +gem/lib/pagy/calendar.rb +gem/lib/pagy/calendar/day.rb +gem/lib/pagy/calendar/helper.rb +gem/lib/pagy/calendar/month.rb +gem/lib/pagy/calendar/quarter.rb +gem/lib/pagy/calendar/week.rb +gem/lib/pagy/calendar/year.rb +gem/lib/pagy/console.rb +gem/lib/pagy/countless.rb +gem/lib/pagy/exceptions.rb +gem/lib/pagy/extras/arel.rb +gem/lib/pagy/extras/array.rb +gem/lib/pagy/extras/bootstrap.rb +gem/lib/pagy/extras/bulma.rb +gem/lib/pagy/extras/calendar.rb +gem/lib/pagy/extras/countless.rb +gem/lib/pagy/extras/elasticsearch_rails.rb +gem/lib/pagy/extras/foundation.rb +gem/lib/pagy/extras/gearbox.rb +gem/lib/pagy/extras/headers.rb +gem/lib/pagy/extras/i18n.rb +gem/lib/pagy/extras/items.rb +gem/lib/pagy/extras/js_tools.rb +gem/lib/pagy/extras/jsonapi.rb +gem/lib/pagy/extras/materialize.rb +gem/lib/pagy/extras/meilisearch.rb +gem/lib/pagy/extras/metadata.rb +gem/lib/pagy/extras/overflow.rb +gem/lib/pagy/extras/pagy.rb +gem/lib/pagy/extras/searchkick.rb +gem/lib/pagy/extras/semantic.rb +gem/lib/pagy/extras/standalone.rb +gem/lib/pagy/extras/trim.rb +gem/lib/pagy/extras/uikit.rb +gem/lib/pagy/frontend.rb +gem/lib/pagy/i18n.rb +gem/lib/pagy/url_helpers.rb +gem/locales/ar.yml +gem/locales/be.yml +gem/locales/bg.yml +gem/locales/bs.yml +gem/locales/ca.yml +gem/locales/ckb.yml +gem/locales/cs.yml +gem/locales/da.yml +gem/locales/de.yml +gem/locales/en.yml +gem/locales/es.yml +gem/locales/fr.yml +gem/locales/hr.yml +gem/locales/id.yml +gem/locales/it.yml +gem/locales/ja.yml +gem/locales/km.yml +gem/locales/ko.yml +gem/locales/nb.yml +gem/locales/nl.yml +gem/locales/nn.yml +gem/locales/pl.yml +gem/locales/pt-BR.yml +gem/locales/pt.yml +gem/locales/ru.yml +gem/locales/sr.yml +gem/locales/sv-SE.yml +gem/locales/sv.yml +gem/locales/sw.yml +gem/locales/ta.yml +gem/locales/tr.yml +gem/locales/uk.yml +gem/locales/vi.yml +gem/locales/zh-CN.yml +gem/locales/zh-HK.yml +gem/locales/zh-TW.yml +gem/stylesheets/pagy.css +gem/stylesheets/pagy.scss +gem/stylesheets/pagy.tailwind.css LICENSE.txt diff --git a/quick-start.md b/quick-start.md index 843b370b1..84ebda5a6 100644 --- a/quick-start.md +++ b/quick-start.md @@ -61,12 +61,12 @@ require 'pagy' +++ With Rails Download the configuration file linked below and save it into the `config/initializers` dir -[!file](/lib/config/pagy.rb) +[!file](/gem/config/pagy.rb) +++ Without Rails Download the configuration file linked below and require it when your app starts -[!file](/lib/config/pagy.rb) +[!file](/gem/config/pagy.rb) +++ !!! Pagy doesn't load unnecessary code in your app! diff --git a/retype.yml b/retype.yml index eef3b0cca..b419698be 100644 --- a/retype.yml +++ b/retype.yml @@ -8,7 +8,7 @@ url: https://ddnexus.github.io/pagy branding: title: Pagy - label: 8.0.0 + label: 8.0.1 colors: label: text: "#FFFFFF" @@ -45,9 +45,7 @@ exclude: - /e2e/** include: - - /apps/**/*.ru - - /apps/**/*.rb - - /lib/**/* + - /gem/**/* - /README.md edit: diff --git a/scripts/version-bump.sh b/scripts/version-bump.sh index 1f142a924..4f99f2424 100755 --- a/scripts/version-bump.sh +++ b/scripts/version-bump.sh @@ -11,7 +11,7 @@ ROOT="$(cd -P -- "$(dirname -- "$dir")" && printf '%s\n' "$(pwd -P)")" cd $ROOT # Prompt for the new version -old_vers=$(ruby -Ilib -rpagy -e 'puts Pagy::VERSION') +old_vers=$(ruby -Igem/lib -rpagy -e 'puts Pagy::VERSION') echo "Current Pagy::VERSION: $old_vers" read -rp 'Enter the new version> ' new_vers @@ -29,13 +29,13 @@ function bump(){ bump "$ROOT/retype.yml" bump "$ROOT/.github/ISSUE_TEMPLATE/Code.yml" -bump "$ROOT/lib/pagy.rb" -bump "$ROOT/lib/apps/calendar.ru" -bump "$ROOT/lib/apps/demo.ru" -bump "$ROOT/lib/apps/rails.ru" -bump "$ROOT/lib/apps/repro.ru" -bump "$ROOT/lib/bin/pagy" -bump "$ROOT/lib/config/pagy.rb" +bump "$ROOT/gem/apps/calendar.ru" +bump "$ROOT/gem/apps/demo.ru" +bump "$ROOT/gem/apps/rails.ru" +bump "$ROOT/gem/apps/repro.ru" +bump "$ROOT/gem/bin/pagy" +bump "$ROOT/gem/config/pagy.rb" +bump "$ROOT/gem/lib/pagy.rb" bump "$ROOT/src/pagy.ts" # Bumps docs example diff --git a/src/build.sh b/src/build.sh index 737ccd62b..d491bef3b 100755 --- a/src/build.sh +++ b/src/build.sh @@ -22,4 +22,4 @@ echo 'generating pagy.js from main.js' #parcel build --cache-dir .parcel-cache parcel build --no-cache --cache-dir .parcel-cache # avoid test version error when the file did not change -mv -vt ../lib/javascripts pagy-module.d.ts pagy-module.js pagy-dev.js +mv -vt ../gem/javascripts pagy-module.d.ts pagy-module.js pagy-dev.js diff --git a/src/package.json b/src/package.json index 934e8018f..e768a8079 100644 --- a/src/package.json +++ b/src/package.json @@ -21,7 +21,7 @@ "pagy": "pagy.js", "targets": { "pagy": { - "distDir": "../lib/javascripts", + "distDir": "../gem/javascripts", "source": "main.js", "outputFormat": "global", "sourceMap": false diff --git a/src/pagy.ts b/src/pagy.ts index 68149a306..84b75900e 100644 --- a/src/pagy.ts +++ b/src/pagy.ts @@ -96,7 +96,7 @@ const Pagy = (() => { // Public interface return { - version: "8.0.0", + version: "8.0.1", // Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args init(arg?:Element | never) { diff --git a/tasks/rubygem_release.rake b/tasks/rubygem_release.rake index 73f1d91c0..b662b4d18 100644 --- a/tasks/rubygem_release.rake +++ b/tasks/rubygem_release.rake @@ -6,7 +6,7 @@ require 'bundler/gem_tasks' require 'rake/manifest' Rake::Manifest::Task.new do |t| - t.patterns = FileList.new.include('lib/**/*', 'LICENSE.txt').exclude('**/*.md') + t.patterns = FileList.new.include('gem/**/*', 'LICENSE.txt').exclude('**/*.md') t.manifest_file = 'pagy.manifest' end diff --git a/test/test_helper.rb b/test/test_helper.rb index 44385f5b6..506ce50a3 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,7 +8,7 @@ end # We cannot use gemspec in the gemfile which would load pagy before simplecov so missing the coverage -$LOAD_PATH.unshift File.expand_path('../lib', __dir__) +$LOAD_PATH.unshift File.expand_path('../gem/lib', __dir__) require 'pagy' require 'minitest/autorun'