Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Feb 18, 2024
2 parents fb09d28 + b18c648 commit f7a1e2d
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GEM=pagy
VERSION=7.0.1
VERSION=7.0.2
23 changes: 18 additions & 5 deletions .github/ISSUE_TEMPLATE/Code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@ body:
attributes:
value: |
Thanks for taking the time to fill out this bug report!
### IMPORTANT
_Code Issues are reserved for real, reproducible pagy bugs. If you are not sure it's a bug,
please ask for help in the
[Q&A](https://github.com/ddnexus/pagy/discussions/categories/q-a) discussion area._
### PREREQUISITE
**We need a code support to reproduce the problem with a single click or command
in order to start to work on the solution immediately.**
Code Issues are reserved for real, reproducible pagy bug. If you are not sure it's a bug, please ask in the
[Q&A](https://github.com/ddnexus/pagy/discussions/categories/q-a) discussion area.
Please, understand that we cannot write the code that fails for you.
No matter how well you can describe your code, not matter how many snippets
you paste in the description, we need a self contained code that we can run with a single click or command
or in very simple cases a copy and paste in vanilla IRB (no rails console).
By following the steps below you will either solve your problem or ensure that it's a real reproducible bug to fix.
Please, choose the support that is most convenient for you below...
- type: checkboxes
id: prereq
Expand All @@ -36,8 +49,8 @@ body:
...at least one of the following code supports reproducing the issue:
options:
- label: |
Simple step by step list that would work in IRB with the [Pagy::Console](https://ddnexus.github
.io/pagy/docs/api/console) without invoking any external code
Simple snippet that would work **as-is in IRB without invoking any external code!** (You can use the
[Pagy::Console](https://ddnexus.github.io/pagy/docs/api/console) for easy output)
- label: |
Plain ruby file that can run as `ruby my-problem.rb`
- label: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ None

<hr>

## Version 7.0.2

- Fix for missing to fetch count_args default (close #645)
- Non-code improvements

## Version 7.0.1

- Updates ckb translations to be complaint with ARIA in v7.x.x (#643)
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/config/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

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

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

Large diffs are not rendered by default.

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

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

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

# Core class
class Pagy
VERSION = '7.0.1'
VERSION = '7.0.2'

# Root pathname to get the path of Pagy files like templates or dictionaries
def self.root
Expand Down
3 changes: 2 additions & 1 deletion lib/pagy/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def pagy(collection, vars = {})
# You may need to override the count call for non AR collections
def pagy_get_vars(collection, vars)
pagy_set_items_from_params(vars) if defined?(ItemsExtra)
vars[:count] ||= (count = collection.count(*vars[:count_args])).is_a?(Hash) ? count.size : count
count_args = vars[:count_args] || DEFAULT[:count_args]
vars[:count] ||= (count = collection.count(*count_args)).is_a?(Hash) ? count.size : count
vars[:page] ||= pagy_get_page(vars)
vars
end
Expand Down
2 changes: 1 addition & 1 deletion retype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ url: https://ddnexus.github.io/pagy

branding:
title: Pagy
label: 7.0.1
label: 7.0.2
colors:
label:
text: "#FFFFFF"
Expand Down
18 changes: 0 additions & 18 deletions script/release.sh

This file was deleted.

8 changes: 4 additions & 4 deletions script/update_top100.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'net/http'

URL_FMT = 'https://api.github.com/repos/ddnexus/pagy/contributors?page=%s'
WIDTH = '60'
IMG_WIDTH = '60'
MAX_COUNT = 100
START_TAG = '<!-- top100 start -->'
END_TAG = '<!-- top100 end -->'
Expand All @@ -17,9 +17,9 @@
contributors.each do |c|
break if count >= MAX_COUNT

commits = c['contributions'] == 1 ? 'commit' : 'commits'
top100 << %([<img src="#{c['avatar_url']}" WIDTH="#{WIDTH}" title="@#{
c['login']}: #{c['contributions']} #{commits}">](https://github.com/#{c['login']}))
contribution = c['contributions'] == 1 ? 'contribution' : 'contributions'
top100 << %([<img src="#{c['avatar_url']}" width="#{IMG_WIDTH}" title="@#{
c['login']}: #{c['contributions']} #{contribution}">](https://github.com/#{c['login']}))
count += 1
end
page += 1
Expand Down
2 changes: 1 addition & 1 deletion src/pagy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Pagy = (() => {

// Public interface
return {
version: "7.0.1",
version: "7.0.2",

// Scan for elements with a "data-pagy" attribute and call their init functions with the decoded args
init(arg?:Element | never) {
Expand Down
26 changes: 0 additions & 26 deletions tasks/gem_management.rake

This file was deleted.

33 changes: 33 additions & 0 deletions tasks/safe_release.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

# Gem release cycle

require 'bundler/gem_tasks'
require 'rake/manifest'

Rake::Manifest::Task.new do |t|
t.patterns = FileList.new.include('lib/**/*', 'LICENSE.txt').exclude('**/*.md')
t.manifest_file = 'pagy.manifest'
end

module Bundler # :nodoc: all
class GemHelper
def version_tag
"#{@tag_prefix}#{version}" # remove that stupid 'v' prepended to the version number
end
end
end

desc 'Checks-build-release-tag-cleanup cycle'
task :safe_release do
output = `git status --porcelain`
abort 'Working tree dirty!' unless output.empty?

branch = `git rev-parse --abbrev-ref HEAD`
abort 'Wrong branch to release!' unless /^master/.match?(branch)

Rake::Task['manifest:check'].invoke
Rake::Task['build'].invoke
Rake::Task['release'].invoke
FileUtils.rm_rf('pkg', secure: true)
end

0 comments on commit f7a1e2d

Please sign in to comment.