pagy_cursor 0.1.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +107 -0
- data/.github/workflows/gempush.yml +28 -0
- data/.gitignore +2 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +173 -0
- data/README.md +41 -3
- data/gemfiles/active_record_60.gemfile +11 -0
- data/gemfiles/active_record_61.gemfile +11 -0
- data/lib/pagy_cursor/pagy/cursor.rb +8 -6
- data/lib/pagy_cursor/pagy/extras/cursor.rb +2 -0
- data/lib/pagy_cursor/pagy/extras/uuid_cursor.rb +2 -0
- data/lib/pagy_cursor/version.rb +1 -1
- data/pagy_cursor.gemspec +3 -16
- metadata +17 -12
- data/.travis.yml +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44004bd3c0d4a31c61ce024c96e7e69a064c49342aed3e24154a42b61431f0b2
|
4
|
+
data.tar.gz: 15bee98c168a66fb9fa7db1312e73d4ee5e8123c599d2106b51b3b18a380a367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58f4f60789e0558c92a060b13cc118cc5696097a34b9b14613bbd526030de18b2aa6b133967262b96c8b45de1ff9b2db04dae786d35ac934075f9d6b5d233307
|
7
|
+
data.tar.gz: e41e82f58a98e13e83173788dc402cc51df263b5d0ac9bf53cb1c22eef9f1dca97904afe8bd653502edabc874717c8dc9eade484de4b16936cbd941ecdd05e12
|
@@ -0,0 +1,107 @@
|
|
1
|
+
name: Pagy Cursor CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: ['**']
|
6
|
+
pull_request:
|
7
|
+
branches: ['**']
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
postgres_test:
|
11
|
+
name: Ruby ${{ matrix.ruby-version }} Test with postgresql
|
12
|
+
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
|
15
|
+
services:
|
16
|
+
postgres:
|
17
|
+
image: postgres
|
18
|
+
env:
|
19
|
+
POSTGRES_USER: postgres
|
20
|
+
POSTGRES_PASSWORD: postgres
|
21
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
22
|
+
ports:
|
23
|
+
- 5432:5432
|
24
|
+
|
25
|
+
strategy:
|
26
|
+
matrix:
|
27
|
+
include:
|
28
|
+
- ruby-version: 2.5
|
29
|
+
env:
|
30
|
+
BUNDLE_GEMFILE: gemfiles/active_record_50.gemfile
|
31
|
+
- ruby-version: 2.6
|
32
|
+
env:
|
33
|
+
BUNDLE_GEMFILE: gemfiles/active_record_51.gemfile
|
34
|
+
- ruby-version: 2.7
|
35
|
+
env:
|
36
|
+
BUNDLE_GEMFILE: gemfiles/active_record_52.gemfile
|
37
|
+
- ruby-version: 2.7
|
38
|
+
env:
|
39
|
+
BUNDLE_GEMFILE: gemfiles/active_record_60.gemfile
|
40
|
+
- ruby-version: 3.0
|
41
|
+
env:
|
42
|
+
BUNDLE_GEMFILE: gemfiles/active_record_61.gemfile
|
43
|
+
|
44
|
+
fail-fast: false
|
45
|
+
env: ${{ matrix.env }}
|
46
|
+
|
47
|
+
steps:
|
48
|
+
- uses: actions/checkout@v2
|
49
|
+
|
50
|
+
- name: Set up ruby
|
51
|
+
uses: ruby/setup-ruby@v1
|
52
|
+
with:
|
53
|
+
ruby-version: ${{ matrix.ruby-version }}
|
54
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
55
|
+
|
56
|
+
- name: Run Ruby Tests
|
57
|
+
run: bundle exec rspec
|
58
|
+
env:
|
59
|
+
DB: postgresql
|
60
|
+
DB_PASSWORD: postgres
|
61
|
+
|
62
|
+
mysql_test:
|
63
|
+
name: Ruby ${{ matrix.ruby-version }} Test with mysql
|
64
|
+
|
65
|
+
runs-on: ubuntu-latest
|
66
|
+
|
67
|
+
services:
|
68
|
+
mysql:
|
69
|
+
image: mysql
|
70
|
+
env:
|
71
|
+
MYSQL_PASSWORD: rootpassword
|
72
|
+
MYSQL_ROOT_PASSWORD: rootpassword
|
73
|
+
ports:
|
74
|
+
- 3306:3306
|
75
|
+
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
|
76
|
+
|
77
|
+
strategy:
|
78
|
+
matrix:
|
79
|
+
include:
|
80
|
+
- ruby-version: 2.5
|
81
|
+
env:
|
82
|
+
BUNDLE_GEMFILE: gemfiles/active_record_50.gemfile
|
83
|
+
- ruby-version: 2.6
|
84
|
+
env:
|
85
|
+
BUNDLE_GEMFILE: gemfiles/active_record_51.gemfile
|
86
|
+
- ruby-version: 2.7
|
87
|
+
env:
|
88
|
+
BUNDLE_GEMFILE: gemfiles/active_record_52.gemfile
|
89
|
+
- ruby-version: 3.0
|
90
|
+
env:
|
91
|
+
BUNDLE_GEMFILE: gemfiles/active_record_60.gemfile
|
92
|
+
fail-fast: false
|
93
|
+
env: ${{ matrix.env }}
|
94
|
+
steps:
|
95
|
+
- uses: actions/checkout@v2
|
96
|
+
|
97
|
+
- name: Set up ruby
|
98
|
+
uses: ruby/setup-ruby@v1
|
99
|
+
with:
|
100
|
+
ruby-version: ${{ matrix.ruby-version }}
|
101
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
102
|
+
|
103
|
+
- name: Run Ruby Tests
|
104
|
+
run: bundle exec rspec
|
105
|
+
env:
|
106
|
+
DB: mysql
|
107
|
+
DB_PASSWORD: rootpassword
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- '*'
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.6
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
version: 2.6.x
|
18
|
+
|
19
|
+
- name: Publish to RubyGems
|
20
|
+
run: |
|
21
|
+
mkdir -p $HOME/.gem
|
22
|
+
touch $HOME/.gem/credentials
|
23
|
+
chmod 0600 $HOME/.gem/credentials
|
24
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
25
|
+
gem build *.gemspec
|
26
|
+
gem push *.gem
|
27
|
+
env:
|
28
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
data/.gitignore
CHANGED
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
gem "rails", "~> 6.1"
|
6
|
+
gem "pg"
|
7
|
+
gem "sqlite3"
|
8
|
+
gem "mysql2"
|
9
|
+
gem "pry"
|
10
|
+
# Specify your gem's dependencies in pagy_cursor.gemspec
|
11
|
+
gemspec path: "./"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pagy_cursor (0.2.1)
|
5
|
+
activerecord (>= 5)
|
6
|
+
pagy (< 5)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (6.1.4.4)
|
12
|
+
actionpack (= 6.1.4.4)
|
13
|
+
activesupport (= 6.1.4.4)
|
14
|
+
nio4r (~> 2.0)
|
15
|
+
websocket-driver (>= 0.6.1)
|
16
|
+
actionmailbox (6.1.4.4)
|
17
|
+
actionpack (= 6.1.4.4)
|
18
|
+
activejob (= 6.1.4.4)
|
19
|
+
activerecord (= 6.1.4.4)
|
20
|
+
activestorage (= 6.1.4.4)
|
21
|
+
activesupport (= 6.1.4.4)
|
22
|
+
mail (>= 2.7.1)
|
23
|
+
actionmailer (6.1.4.4)
|
24
|
+
actionpack (= 6.1.4.4)
|
25
|
+
actionview (= 6.1.4.4)
|
26
|
+
activejob (= 6.1.4.4)
|
27
|
+
activesupport (= 6.1.4.4)
|
28
|
+
mail (~> 2.5, >= 2.5.4)
|
29
|
+
rails-dom-testing (~> 2.0)
|
30
|
+
actionpack (6.1.4.4)
|
31
|
+
actionview (= 6.1.4.4)
|
32
|
+
activesupport (= 6.1.4.4)
|
33
|
+
rack (~> 2.0, >= 2.0.9)
|
34
|
+
rack-test (>= 0.6.3)
|
35
|
+
rails-dom-testing (~> 2.0)
|
36
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
37
|
+
actiontext (6.1.4.4)
|
38
|
+
actionpack (= 6.1.4.4)
|
39
|
+
activerecord (= 6.1.4.4)
|
40
|
+
activestorage (= 6.1.4.4)
|
41
|
+
activesupport (= 6.1.4.4)
|
42
|
+
nokogiri (>= 1.8.5)
|
43
|
+
actionview (6.1.4.4)
|
44
|
+
activesupport (= 6.1.4.4)
|
45
|
+
builder (~> 3.1)
|
46
|
+
erubi (~> 1.4)
|
47
|
+
rails-dom-testing (~> 2.0)
|
48
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
+
activejob (6.1.4.4)
|
50
|
+
activesupport (= 6.1.4.4)
|
51
|
+
globalid (>= 0.3.6)
|
52
|
+
activemodel (6.1.4.4)
|
53
|
+
activesupport (= 6.1.4.4)
|
54
|
+
activerecord (6.1.4.4)
|
55
|
+
activemodel (= 6.1.4.4)
|
56
|
+
activesupport (= 6.1.4.4)
|
57
|
+
activestorage (6.1.4.4)
|
58
|
+
actionpack (= 6.1.4.4)
|
59
|
+
activejob (= 6.1.4.4)
|
60
|
+
activerecord (= 6.1.4.4)
|
61
|
+
activesupport (= 6.1.4.4)
|
62
|
+
marcel (~> 1.0.0)
|
63
|
+
mini_mime (>= 1.1.0)
|
64
|
+
activesupport (6.1.4.4)
|
65
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
|
+
i18n (>= 1.6, < 2)
|
67
|
+
minitest (>= 5.1)
|
68
|
+
tzinfo (~> 2.0)
|
69
|
+
zeitwerk (~> 2.3)
|
70
|
+
builder (3.2.4)
|
71
|
+
coderay (1.1.3)
|
72
|
+
concurrent-ruby (1.1.9)
|
73
|
+
crass (1.0.6)
|
74
|
+
diff-lcs (1.5.0)
|
75
|
+
erubi (1.10.0)
|
76
|
+
globalid (1.0.0)
|
77
|
+
activesupport (>= 5.0)
|
78
|
+
i18n (1.9.1)
|
79
|
+
concurrent-ruby (~> 1.0)
|
80
|
+
loofah (2.13.0)
|
81
|
+
crass (~> 1.0.2)
|
82
|
+
nokogiri (>= 1.5.9)
|
83
|
+
mail (2.7.1)
|
84
|
+
mini_mime (>= 0.1.1)
|
85
|
+
marcel (1.0.2)
|
86
|
+
method_source (1.0.0)
|
87
|
+
mini_mime (1.1.2)
|
88
|
+
minitest (5.15.0)
|
89
|
+
mysql2 (0.5.3)
|
90
|
+
nio4r (2.5.8)
|
91
|
+
nokogiri (1.12.5-x86_64-darwin)
|
92
|
+
racc (~> 1.4)
|
93
|
+
pagy (4.11.0)
|
94
|
+
pg (1.3.1)
|
95
|
+
pry (0.14.1)
|
96
|
+
coderay (~> 1.1)
|
97
|
+
method_source (~> 1.0)
|
98
|
+
racc (1.6.0)
|
99
|
+
rack (2.2.3)
|
100
|
+
rack-test (1.1.0)
|
101
|
+
rack (>= 1.0, < 3)
|
102
|
+
rails (6.1.4.4)
|
103
|
+
actioncable (= 6.1.4.4)
|
104
|
+
actionmailbox (= 6.1.4.4)
|
105
|
+
actionmailer (= 6.1.4.4)
|
106
|
+
actionpack (= 6.1.4.4)
|
107
|
+
actiontext (= 6.1.4.4)
|
108
|
+
actionview (= 6.1.4.4)
|
109
|
+
activejob (= 6.1.4.4)
|
110
|
+
activemodel (= 6.1.4.4)
|
111
|
+
activerecord (= 6.1.4.4)
|
112
|
+
activestorage (= 6.1.4.4)
|
113
|
+
activesupport (= 6.1.4.4)
|
114
|
+
bundler (>= 1.15.0)
|
115
|
+
railties (= 6.1.4.4)
|
116
|
+
sprockets-rails (>= 2.0.0)
|
117
|
+
rails-dom-testing (2.0.3)
|
118
|
+
activesupport (>= 4.2.0)
|
119
|
+
nokogiri (>= 1.6)
|
120
|
+
rails-html-sanitizer (1.4.2)
|
121
|
+
loofah (~> 2.3)
|
122
|
+
railties (6.1.4.4)
|
123
|
+
actionpack (= 6.1.4.4)
|
124
|
+
activesupport (= 6.1.4.4)
|
125
|
+
method_source
|
126
|
+
rake (>= 0.13)
|
127
|
+
thor (~> 1.0)
|
128
|
+
rake (13.0.6)
|
129
|
+
rspec (3.10.0)
|
130
|
+
rspec-core (~> 3.10.0)
|
131
|
+
rspec-expectations (~> 3.10.0)
|
132
|
+
rspec-mocks (~> 3.10.0)
|
133
|
+
rspec-core (3.10.2)
|
134
|
+
rspec-support (~> 3.10.0)
|
135
|
+
rspec-expectations (3.10.2)
|
136
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
137
|
+
rspec-support (~> 3.10.0)
|
138
|
+
rspec-mocks (3.10.3)
|
139
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
140
|
+
rspec-support (~> 3.10.0)
|
141
|
+
rspec-support (3.10.3)
|
142
|
+
sprockets (4.0.2)
|
143
|
+
concurrent-ruby (~> 1.0)
|
144
|
+
rack (> 1, < 3)
|
145
|
+
sprockets-rails (3.4.2)
|
146
|
+
actionpack (>= 5.2)
|
147
|
+
activesupport (>= 5.2)
|
148
|
+
sprockets (>= 3.0.0)
|
149
|
+
sqlite3 (1.4.2)
|
150
|
+
thor (1.2.1)
|
151
|
+
tzinfo (2.0.4)
|
152
|
+
concurrent-ruby (~> 1.0)
|
153
|
+
websocket-driver (0.7.5)
|
154
|
+
websocket-extensions (>= 0.1.0)
|
155
|
+
websocket-extensions (0.1.5)
|
156
|
+
zeitwerk (2.5.4)
|
157
|
+
|
158
|
+
PLATFORMS
|
159
|
+
x86_64-darwin-19
|
160
|
+
|
161
|
+
DEPENDENCIES
|
162
|
+
bundler (~> 2.0)
|
163
|
+
mysql2
|
164
|
+
pagy_cursor!
|
165
|
+
pg
|
166
|
+
pry
|
167
|
+
rails (~> 6.1)
|
168
|
+
rake (~> 13.0)
|
169
|
+
rspec (~> 3.0)
|
170
|
+
sqlite3
|
171
|
+
|
172
|
+
BUNDLED WITH
|
173
|
+
2.2.30
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
|
2
2
|
# PagyCursor
|
3
|
-
![](https://travis-ci.org/Uysim/pagy-cursor.svg?branch=master)
|
4
3
|
|
5
4
|
Extra [Pagy](https://github.com/ddnexus/pagy) to work with cursor pagination
|
6
5
|
|
@@ -15,31 +14,70 @@ gem 'pagy_cursor'
|
|
15
14
|
|
16
15
|
And then execute:
|
17
16
|
|
18
|
-
$ bundle
|
17
|
+
$ bundle install
|
19
18
|
|
20
19
|
## Usage
|
21
20
|
|
22
21
|
Include the backend in some controller:
|
22
|
+
|
23
23
|
```ruby
|
24
|
-
require "pagy_cursor"
|
24
|
+
require "pagy_cursor/pagy/extras/cursor"
|
25
|
+
require "pagy_cursor/pagy/extras/uuid_cursor"
|
25
26
|
|
26
27
|
include Pagy::Backend
|
27
28
|
```
|
28
29
|
Default
|
30
|
+
|
29
31
|
```ruby
|
30
32
|
pagy_cursor(Post.all)
|
31
33
|
```
|
34
|
+
|
32
35
|
Before and After
|
36
|
+
|
33
37
|
```ruby
|
34
38
|
pagy_cursor(Post.all, after: 10)
|
35
39
|
pagy_cursor(Post.all, before: 10)
|
36
40
|
```
|
41
|
+
|
37
42
|
With UUID
|
43
|
+
|
38
44
|
```ruby
|
39
45
|
pagy_uuid_cursor(Post.all, after: "ce5d2741-4e52-49b2-bb76-c41b67ab3aad")
|
40
46
|
pagy_uuid_cursor(Post.all, before: "ce5d2741-4e52-49b2-bb76-c41b67ab3aad")
|
41
47
|
```
|
42
48
|
|
49
|
+
Ordering collection
|
50
|
+
```ruby
|
51
|
+
pagy_cursor(Post.all, after: 10, order: {updated_at: :desc})
|
52
|
+
```
|
53
|
+
|
54
|
+
## Credits
|
55
|
+
|
56
|
+
Many thanks to:
|
57
|
+
- [Uysim](https://github.com/Uysim)
|
58
|
+
- [M. Yunan Helmy](https://github.com/yunanhelmy)
|
59
|
+
- [Eumir Gaspar](https://github.com/corroded)
|
60
|
+
|
61
|
+
## Support Databases
|
62
|
+
|
63
|
+
- SQLite
|
64
|
+
- Postgresql
|
65
|
+
- MySQL
|
66
|
+
|
67
|
+
## Tests & Contributing
|
68
|
+
|
69
|
+
To run tests in root folder of gem:
|
70
|
+
|
71
|
+
- ```export DB=sqlite3``` to work with sqlite (see [support databases](#support-databases))
|
72
|
+
- ```bundle install```
|
73
|
+
- ```bundle exec rspec ```
|
74
|
+
|
75
|
+
To test on specific Rails version
|
76
|
+
```export BUNDLE_GEMFILE=gemfiles/active_record_52.gemfile``` to work with Rails 5.2
|
77
|
+
|
78
|
+
To play with app cd test/dummy and rails s -b 0.0.0.0 (before rails db:migrate).
|
79
|
+
|
80
|
+
|
43
81
|
## License
|
44
82
|
|
45
83
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,11 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
gem "rails", "~> 6.0"
|
6
|
+
gem "pg"
|
7
|
+
gem "sqlite3"
|
8
|
+
gem "mysql2"
|
9
|
+
gem "pry"
|
10
|
+
# Specify your gem's dependencies in pagy_cursor.gemspec
|
11
|
+
gemspec path: "../"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
gem "rails", "~> 6.1"
|
6
|
+
gem "pg"
|
7
|
+
gem "sqlite3"
|
8
|
+
gem "mysql2"
|
9
|
+
gem "pry"
|
10
|
+
# Specify your gem's dependencies in pagy_cursor.gemspec
|
11
|
+
gemspec path: "../"
|
@@ -12,6 +12,8 @@ class Pagy
|
|
12
12
|
@after = vars[:after]
|
13
13
|
@arel_table = vars[:arel_table]
|
14
14
|
@primary_key = vars[:primary_key]
|
15
|
+
@reorder = vars[:order] || {}
|
16
|
+
|
15
17
|
if @before.present? and @after.present?
|
16
18
|
raise(ArgumentError, 'before and after can not be both mentioned')
|
17
19
|
end
|
@@ -20,23 +22,23 @@ class Pagy
|
|
20
22
|
|
21
23
|
@comparation = 'lt' # arel table less than
|
22
24
|
@position = @before
|
23
|
-
@order = { :created_at => :desc , @primary_key => :desc }
|
25
|
+
@order = @reorder.merge({ :created_at => :desc , @primary_key => :desc })
|
24
26
|
|
25
|
-
if @after.present?
|
27
|
+
if @after.present? || (@reorder.present? && @reorder.values.uniq.first.to_sym == :asc)
|
26
28
|
@comparation = 'gt' # arel table greater than
|
27
29
|
@position = @after
|
28
|
-
@order = { :created_at => :asc , @primary_key => :asc }
|
30
|
+
@order = @reorder.merge({ :created_at => :asc , @primary_key => :asc })
|
29
31
|
end
|
30
32
|
else
|
31
33
|
|
32
34
|
@comparation = 'lt'
|
33
35
|
@position = @before
|
34
|
-
@order = { @primary_key => :desc }
|
36
|
+
@order = @reorder.merge({ @primary_key => :desc })
|
35
37
|
|
36
|
-
if @after.present?
|
38
|
+
if @after.present? || (@reorder.present? && @reorder.values.uniq.first.to_sym == :asc)
|
37
39
|
@comparation = 'gt'
|
38
40
|
@position = @after
|
39
|
-
@order = { @primary_key => :asc }
|
41
|
+
@order = @reorder.merge({ @primary_key => :asc })
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
data/lib/pagy_cursor/version.rb
CHANGED
data/pagy_cursor.gemspec
CHANGED
@@ -14,19 +14,6 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/Uysim/pagy-cursor"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
# if spec.respond_to?(:metadata)
|
20
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
#
|
22
|
-
# spec.metadata["homepage_uri"] = spec.homepage
|
23
|
-
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
24
|
-
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
25
|
-
# else
|
26
|
-
# raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
-
# "public gem pushes."
|
28
|
-
# end
|
29
|
-
|
30
17
|
# Specify which files should be added to the gem when it is released.
|
31
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
19
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
@@ -35,10 +22,10 @@ Gem::Specification.new do |spec|
|
|
35
22
|
spec.bindir = "exe"
|
36
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
24
|
spec.require_paths = ["lib"]
|
38
|
-
spec.add_dependency "pagy"
|
25
|
+
spec.add_dependency "pagy", "< 5"
|
39
26
|
spec.add_dependency "activerecord", ">= 5"
|
40
27
|
|
41
|
-
spec.add_development_dependency "bundler", "~>
|
42
|
-
spec.add_development_dependency "rake", "~>
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
43
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
44
31
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagy_cursor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uysim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pagy
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "<"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,10 +87,13 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/ci.yml"
|
91
|
+
- ".github/workflows/gempush.yml"
|
90
92
|
- ".gitignore"
|
91
93
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
94
|
- CODE_OF_CONDUCT.md
|
95
|
+
- Gemfile
|
96
|
+
- Gemfile.lock
|
94
97
|
- LICENSE.txt
|
95
98
|
- README.md
|
96
99
|
- Rakefile
|
@@ -99,6 +102,8 @@ files:
|
|
99
102
|
- gemfiles/active_record_50.gemfile
|
100
103
|
- gemfiles/active_record_51.gemfile
|
101
104
|
- gemfiles/active_record_52.gemfile
|
105
|
+
- gemfiles/active_record_60.gemfile
|
106
|
+
- gemfiles/active_record_61.gemfile
|
102
107
|
- lib/pagy_cursor.rb
|
103
108
|
- lib/pagy_cursor/pagy/cursor.rb
|
104
109
|
- lib/pagy_cursor/pagy/extras/cursor.rb
|
@@ -124,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
129
|
- !ruby/object:Gem::Version
|
125
130
|
version: '0'
|
126
131
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.2.32
|
128
133
|
signing_key:
|
129
134
|
specification_version: 4
|
130
135
|
summary: cursor paginations for pagy
|
data/.travis.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
sudo: false
|
3
|
-
|
4
|
-
language: ruby
|
5
|
-
|
6
|
-
cache: bundler
|
7
|
-
|
8
|
-
services:
|
9
|
-
- postgresql
|
10
|
-
- mysql
|
11
|
-
|
12
|
-
rvm:
|
13
|
-
- 2.6.3
|
14
|
-
- 2.5.5
|
15
|
-
- 2.4.5
|
16
|
-
- 2.3.8
|
17
|
-
|
18
|
-
gemfile:
|
19
|
-
- gemfiles/active_record_52.gemfile
|
20
|
-
- gemfiles/active_record_51.gemfile
|
21
|
-
- gemfiles/active_record_50.gemfile
|
22
|
-
|
23
|
-
env:
|
24
|
-
- DB=sqlite3
|
25
|
-
- DB=postgresql
|
26
|
-
- DB=mysql
|
27
|
-
|
28
|
-
before_install: gem install bundler -v 1.17.3
|
29
|
-
script: bundle exec rspec
|