Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Mar 12, 2019
2 parents 449106f + acb435b commit 89ed83b
Show file tree
Hide file tree
Showing 35 changed files with 395 additions and 74 deletions.
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
# CHANGELOG

## Version 2.1.0

### Changes

- Added headers extra
- Added support for overflow :last_page to searchkick and elasticsearch_rails extras
- Added zh-hk locale
- Better docs

### Commits

- [4e83993](http://github.com/ddnexus/pagy/commit/4e83993): updated docs
- [8bd19d6](http://github.com/ddnexus/pagy/commit/8bd19d6): added headers extra (#141)
- [9a26b04](http://github.com/ddnexus/pagy/commit/9a26b04): added support for overflow :last_page to searchkick and elasticsearch_rails extras (#138)
- [c5524fc](http://github.com/ddnexus/pagy/commit/c5524fc): Add zh-hk language yml file (#139)
- [6d5841b](http://github.com/ddnexus/pagy/commit/6d5841b): update travis setup
- [5bd7c0a](http://github.com/ddnexus/pagy/commit/5bd7c0a): updated docs notes for the searchkick and elasticsearch_rails extras
- [0ca5539](http://github.com/ddnexus/pagy/commit/0ca5539): updated comments in config/pagy.rb (#138)

## Version 2.0.1

## Changes
### Changes

- Fix for missing require in config/pagy.rb and fix for pt-br translation typos
- docs fixes and improvements

## Commits
### Commits

- [4e7b30f](http://github.com/ddnexus/pagy/commit/4e7b30f): update Repository Info section in README
- [835e8d2](http://github.com/ddnexus/pagy/commit/835e8d2): Fix for missing require in config/pagy.rb and fix for pt-br translation typos (#134)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Pagy is the ultimate pagination gem that outperforms the others in each and ever
## Improvements in v2.0+

- Lower ruby requirements (ruby v1.9+ || jruby v1.7+) make Pagy very convenient also on older systems
- Added [RFC-8288](https://tools.ietf.org/html/rfc8288) compilant http response `headers` extra
- The i18n internal implementation now includes full dynamic support for multi-language apps, it's ~18x faster and uses ~10x less memory than the i18n gem
- The `searchkick` and `elasticsearch_rails` extras have been refactored with more and better options
- Pagy v2.0+ is even faster and lighter than v1.0+ (see charts below)
Expand Down Expand Up @@ -124,6 +125,7 @@ Use the official extras, or write your own in just a few lines. Extras add speci

### Feature Extras

- [headers](http://ddnexus.github.io/pagy/extras/headers): Add [RFC-8288](https://tools.ietf.org/html/rfc8288) compilant http response headers (and other helpers) useful for API pagination
- [i18n](http://ddnexus.github.io/pagy/extras/i18n): Use the `I18n` gem instead of the pagy implementation
- [items](http://ddnexus.github.io/pagy/extras/items): Allow the client to request a custom number of items per page with an optional selector UI
- [overflow](http://ddnexus.github.io/pagy/extras/overflow): Allow for easy handling of overflowing pages
Expand Down
16 changes: 14 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require "rubocop/rake_task" unless ENV['SKIP_RUBOCOP']
Rake::TestTask.new(:test_common) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList.new.include("test/**/*_test.rb").exclude('test/**/i18n_test.rb', 'test/**/items_test.rb', 'test/**/overflow_test.rb', 'test/**/trim_test.rb')
t.test_files = FileList.new.include("test/**/*_test.rb").exclude('test/**/i18n_test.rb', 'test/**/items_test.rb', 'test/**/overflow_test.rb', 'test/**/trim_test.rb', 'test/**/elasticsearch_rails_test.rb', 'test/**/searchkick_test.rb', 'test/**/support_test.rb')
end

Rake::TestTask.new(:test_extra_i18n) do |t|
Expand All @@ -40,7 +40,19 @@ Rake::TestTask.new(:test_extra_trim) do |t|
t.test_files = FileList['test/**/trim_test.rb']
end

task :test => [:test_common, :test_extra_items, :test_extra_i18n, :test_extra_overflow, :test_extra_trim ]
Rake::TestTask.new(:test_extra_elasticsearch) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/elasticsearch_rails_test.rb', 'test/**/searchkick_test.rb']
end

Rake::TestTask.new(:test_support) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/support_test.rb']
end

task :test => [:test_common, :test_extra_items, :test_extra_i18n, :test_extra_overflow, :test_extra_trim, :test_extra_elasticsearch, :test_support ]

if ENV['SKIP_RUBOCOP']
task :default => [:test]
Expand Down
1 change: 1 addition & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ <h1 id="site-title">{{ site.title | default: site.github.repository_name }} <a c
<a href="{{ site.baseurl }}/extras/countless"><p class="indent1" {% if page.title == 'Countless' %}id="active"{% endif %} >Countless</p></a>
<a href="{{ site.baseurl }}/extras/elasticsearch_rails"><p class="indent1" {% if page.title == 'Elasticsearch Rails' %}id="active"{% endif %} >Elasticsearch Rails</p></a>
<a href="{{ site.baseurl }}/extras/foundation"><p class="indent1" {% if page.title == 'Foundation' %}id="active"{% endif %} >Foundation</p></a>
<a href="{{ site.baseurl }}/extras/headers"><p class="indent1" {% if page.title == 'Headers' %}id="active"{% endif %} >Headers</p></a>
<a href="{{ site.baseurl }}/extras/i18n"><p class="indent1" {% if page.title == 'I18n' %}id="active"{% endif %} >I18n</p></a>
<a href="{{ site.baseurl }}/extras/items"><p class="indent1" {% if page.title == 'Items' %}id="active"{% endif %} >Items</p></a>
<a href="{{ site.baseurl }}/extras/overflow"><p class="indent1" {% if page.title == 'Overflow' %}id="active"{% endif %} >Overflow</p></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: API
The whole core structure of Pagy is very simple: it is organized around 3 small modules of just ~100 lines of code in total:

| Module | Description | Links |
| ---------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|:-----------------|:----------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------|
| `Pagy` | The small class that keeps track of the variables involved in the pagination | [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy.rb), [documentation](api/pagy.md) |
| `Pagy::Backend` | The optional module that you can include in your controllers in order to automatically create the Pagy instance | [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/backend.rb), [documentation](api/backend.md) |
| `Pagy::Frontend` | The module to include in your views in order to get a few helpers for the HTML output | [source](https://github.com/ddnexus/pagy/blob/master/lib/pagy/frontend.rb), [documentation](api/frontend.md) |
Expand Down
8 changes: 4 additions & 4 deletions docs/api/pagy.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The only mandatory instance variable to be passed is the `:count` of the collect
They are all integers:

| Variable | Description | Default |
| --------- | ---------------------------------------------------------------------------------------------- | ------- |
|:----------|:-----------------------------------------------------------------------------------------------|:--------|
| `:count` | the total count of the collection to paginate (mandatory argument) | `nil` |
| `:page` | the requested page number | `1` |
| `:items` | the _requested_ number of items for the page | `20` |
Expand All @@ -82,7 +82,7 @@ They are all integers:
### Other Variables

| Variable | Description | Default |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
|:--------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------|
| `:size` | the size of the page links to show: array of initial pages, before current page, after current page, final pages. _(see also [Control the page links](../how-to.md#controlling-the-page-links))_ | `[1,4,4,1]` |
| `:page_param` | the name of the page param name used in the url. _(see [Customizing the page param](../how-to.md#customizing-the-page-param))_ | `:page` |
| `:params` | the arbitrary param hash to add to the url. _(see [Customizing the params](../how-to.md#customizing-the-params))_ | `{}` |
Expand All @@ -98,7 +98,7 @@ There is no specific validation for non-instance variables.
Pagy exposes all the instance variables needed for the pagination through a few attribute readers. They all return integers (or `nil`), except the `vars` hash:

| Reader | Description |
| -------- | ------------------------------------------------------------------------------------------------------------------ |
|:---------|:-------------------------------------------------------------------------------------------------------------------|
| `count` | the collection `:count` |
| `page` | the current page number |
| `items` | the _actual_ number of items in the current non-empty page (can be less than the requested `:items` variable) |
Expand Down Expand Up @@ -132,7 +132,7 @@ That is self-contained, simple and efficient.
The lowest possible limit of the pagination is reached when the collection has `0` count. In that case the Pagy object created has the following peculiar attributes:

| Attribute | Value |
| --------- | ------- |
|:----------|:--------|
| `count` | `0` |
| `page` | `1` |
| `pages` | `1` |
Expand Down
Loading

0 comments on commit 89ed83b

Please sign in to comment.