grape-kaminari 0.1.7 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -1
- data/.rubocop.yml +26 -0
- data/.travis.yml +6 -0
- data/Gemfile.lock +117 -0
- data/LICENSE.txt +1 -0
- data/README.md +6 -7
- data/Rakefile +6 -3
- data/grape-kaminari.gemspec +19 -19
- data/lib/grape-kaminari.rb +1 -11
- data/lib/grape/kaminari.rb +42 -33
- data/lib/grape/kaminari/max_value_validator.rb +7 -16
- data/lib/grape/kaminari/version.rb +1 -1
- data/spec/kaminari_spec.rb +18 -26
- data/spec/paginate_helper_spec.rb +13 -4
- data/spec/spec_helper.rb +2 -6
- metadata +54 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 690c3b70419498572169fa3e2daee43ba5adef9c93e46ba8b0da6944f2afdcc0
|
4
|
+
data.tar.gz: 49f722ee554da32f4ecc3351abc2e5edc44454882046cfadf39f0d99c7ba2ba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08980fd147c292e51c546c19166a095b012fe0727e95a30d5ac9a5682eecfd66fdbf907167b0c2c5160c854269728ecca34cee6808009660e02075eaed67d35
|
7
|
+
data.tar.gz: ffdf0838305fd025f5fda2fb96ee6c58b9f46bfbe0fe511f13de9b06d9683f1f6651d45a23d8b923434974f65d930242bcfb00723a3042dffa9cdecd6dba8960
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: "2.5"
|
3
|
+
NewCops: enable
|
4
|
+
|
5
|
+
Metrics/AbcSize:
|
6
|
+
Enabled: false
|
7
|
+
Metrics/BlockLength:
|
8
|
+
Exclude:
|
9
|
+
- spec/**/*_spec.rb
|
10
|
+
Metrics/MethodLength:
|
11
|
+
Max: 20
|
12
|
+
|
13
|
+
Naming/FileName:
|
14
|
+
Exclude:
|
15
|
+
- lib/grape-kaminari.rb
|
16
|
+
|
17
|
+
Style/Documentation:
|
18
|
+
Enabled: false
|
19
|
+
Style/FrozenStringLiteralComment:
|
20
|
+
Enabled: false
|
21
|
+
Style/TrailingCommaInArguments:
|
22
|
+
EnforcedStyleForMultiline: consistent_comma
|
23
|
+
Style/TrailingCommaInArrayLiteral:
|
24
|
+
EnforcedStyleForMultiline: consistent_comma
|
25
|
+
Style/TrailingCommaInHashLiteral:
|
26
|
+
EnforcedStyleForMultiline: consistent_comma
|
data/.travis.yml
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
grape-kaminari (0.3.0)
|
5
|
+
grape (>= 1.0, != 1.4.0)
|
6
|
+
kaminari-grape
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (6.0.3.2)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 0.7, < 2)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
17
|
+
ast (2.4.1)
|
18
|
+
builder (3.2.4)
|
19
|
+
concurrent-ruby (1.1.7)
|
20
|
+
diff-lcs (1.4.4)
|
21
|
+
dry-configurable (0.11.6)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-core (~> 0.4, >= 0.4.7)
|
24
|
+
dry-equalizer (~> 0.2)
|
25
|
+
dry-container (0.7.2)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
28
|
+
dry-core (0.4.9)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-equalizer (0.3.0)
|
31
|
+
dry-inflector (0.2.0)
|
32
|
+
dry-logic (1.0.6)
|
33
|
+
concurrent-ruby (~> 1.0)
|
34
|
+
dry-core (~> 0.2)
|
35
|
+
dry-equalizer (~> 0.2)
|
36
|
+
dry-types (1.4.0)
|
37
|
+
concurrent-ruby (~> 1.0)
|
38
|
+
dry-container (~> 0.3)
|
39
|
+
dry-core (~> 0.4, >= 0.4.4)
|
40
|
+
dry-equalizer (~> 0.3)
|
41
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
42
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
43
|
+
grape (1.3.3)
|
44
|
+
activesupport
|
45
|
+
builder
|
46
|
+
dry-types (>= 1.1)
|
47
|
+
mustermann-grape (~> 1.0.0)
|
48
|
+
rack (>= 1.3.0)
|
49
|
+
rack-accept
|
50
|
+
i18n (1.8.5)
|
51
|
+
concurrent-ruby (~> 1.0)
|
52
|
+
kaminari-core (1.2.1)
|
53
|
+
kaminari-grape (1.0.1)
|
54
|
+
grape
|
55
|
+
kaminari-core (~> 1.0)
|
56
|
+
minitest (5.14.1)
|
57
|
+
mustermann (1.1.1)
|
58
|
+
ruby2_keywords (~> 0.0.1)
|
59
|
+
mustermann-grape (1.0.1)
|
60
|
+
mustermann (>= 1.0.0)
|
61
|
+
parallel (1.19.2)
|
62
|
+
parser (2.7.1.4)
|
63
|
+
ast (~> 2.4.1)
|
64
|
+
rack (2.2.3)
|
65
|
+
rack-accept (0.4.5)
|
66
|
+
rack (>= 0.4)
|
67
|
+
rack-test (1.1.0)
|
68
|
+
rack (>= 1.0, < 3)
|
69
|
+
rainbow (3.0.0)
|
70
|
+
rake (13.0.1)
|
71
|
+
regexp_parser (1.7.1)
|
72
|
+
rexml (3.2.4)
|
73
|
+
rspec (3.9.0)
|
74
|
+
rspec-core (~> 3.9.0)
|
75
|
+
rspec-expectations (~> 3.9.0)
|
76
|
+
rspec-mocks (~> 3.9.0)
|
77
|
+
rspec-core (3.9.2)
|
78
|
+
rspec-support (~> 3.9.3)
|
79
|
+
rspec-expectations (3.9.2)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.9.0)
|
82
|
+
rspec-mocks (3.9.1)
|
83
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
+
rspec-support (~> 3.9.0)
|
85
|
+
rspec-support (3.9.3)
|
86
|
+
rubocop (0.89.0)
|
87
|
+
parallel (~> 1.10)
|
88
|
+
parser (>= 2.7.1.1)
|
89
|
+
rainbow (>= 2.2.2, < 4.0)
|
90
|
+
regexp_parser (>= 1.7)
|
91
|
+
rexml
|
92
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
93
|
+
ruby-progressbar (~> 1.7)
|
94
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
95
|
+
rubocop-ast (0.3.0)
|
96
|
+
parser (>= 2.7.1.4)
|
97
|
+
ruby-progressbar (1.10.1)
|
98
|
+
ruby2_keywords (0.0.2)
|
99
|
+
thread_safe (0.3.6)
|
100
|
+
tzinfo (1.2.7)
|
101
|
+
thread_safe (~> 0.1)
|
102
|
+
unicode-display_width (1.7.0)
|
103
|
+
zeitwerk (2.4.0)
|
104
|
+
|
105
|
+
PLATFORMS
|
106
|
+
ruby
|
107
|
+
|
108
|
+
DEPENDENCIES
|
109
|
+
bundler
|
110
|
+
grape-kaminari!
|
111
|
+
rack-test
|
112
|
+
rake
|
113
|
+
rspec
|
114
|
+
rubocop
|
115
|
+
|
116
|
+
BUNDLED WITH
|
117
|
+
2.1.4
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
3
|
Copyright (c) 2013-2014 Monterail.com LLC
|
4
|
+
Copyright (c) 2020 Black Square Media Ltd
|
4
5
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
7
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
# Grape::Kaminari
|
1
|
+
# Grape::Kaminari
|
2
2
|
|
3
|
-
[
|
3
|
+
[![Build Status](https://travis-ci.org/bsm/grape-kaminari.png?branch=master)](https://travis-ci.org/bsm/grape-kaminari)
|
4
|
+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
5
|
+
|
6
|
+
[kaminari](https://github.com/kaminari/kaminari) paginator integration for [grape](https://github.com/intridea/grape) API framework.
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -87,8 +90,4 @@ X-Offset: 10
|
|
87
90
|
|
88
91
|
## Contributing
|
89
92
|
|
90
|
-
|
91
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
92
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
93
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
94
|
-
5. Create new Pull Request
|
93
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bsm/grape-kaminari.
|
data/Rakefile
CHANGED
data/grape-kaminari.gemspec
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'grape/kaminari/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'grape-kaminari'
|
8
7
|
spec.version = Grape::Kaminari::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
8
|
+
spec.authors = ['Tymon Tobolski', 'Black Square Media']
|
9
|
+
spec.email = ['info@blacksquaremedia.com']
|
10
|
+
spec.description = 'kaminari paginator integration for grape API framework'
|
11
|
+
spec.summary = 'kaminari integration for grape'
|
12
|
+
spec.homepage = ''
|
13
|
+
spec.license = 'MIT'
|
15
14
|
|
16
|
-
spec.files = `git ls-files`.split(
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
spec.
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?('spec/') }
|
16
|
+
spec.test_files = `git ls-files -z -- spec/*`.split("\x0")
|
17
|
+
spec.require_paths = ['lib']
|
18
|
+
spec.required_ruby_version = '>= 2.5'
|
20
19
|
|
20
|
+
spec.add_runtime_dependency 'grape', '>= 1.0', '!= 1.4.0'
|
21
|
+
spec.add_runtime_dependency 'kaminari-grape'
|
21
22
|
|
22
|
-
spec.
|
23
|
-
spec.
|
24
|
-
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency 'rspec', '~> 2.9'
|
23
|
+
spec.add_development_dependency 'bundler'
|
24
|
+
spec.add_development_dependency 'rack-test'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rspec'
|
27
|
+
spec.add_development_dependency 'rubocop'
|
28
28
|
end
|
data/lib/grape-kaminari.rb
CHANGED
data/lib/grape/kaminari.rb
CHANGED
@@ -1,41 +1,50 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require 'grape'
|
2
|
+
require 'grape/kaminari/version'
|
3
|
+
require 'grape/kaminari/max_value_validator'
|
4
|
+
require 'kaminari/grape'
|
4
5
|
|
5
6
|
module Grape
|
6
7
|
module Kaminari
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
helpers HelperMethods
|
12
|
+
base_instance.extend DSLMethods
|
13
|
+
end
|
14
|
+
|
15
|
+
module HelperMethods # :nodoc:
|
16
|
+
def paginate(collection)
|
17
|
+
collection.page(params[:page].to_i)
|
18
|
+
.per(params[:per_page].to_i)
|
19
|
+
.padding(params[:offset].to_i)
|
20
|
+
.tap do |data|
|
21
|
+
header 'X-Total', data.total_count.to_s
|
22
|
+
header 'X-Total-Pages', data.total_pages.to_s
|
23
|
+
header 'X-Per-Page', data.limit_value.to_s
|
24
|
+
header 'X-Page', data.current_page.to_s
|
25
|
+
header 'X-Next-Page', data.next_page.to_s
|
26
|
+
header 'X-Prev-Page', data.prev_page.to_s
|
27
|
+
header 'X-Offset', params[:offset].to_s
|
21
28
|
end
|
29
|
+
end
|
30
|
+
end
|
22
31
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
module DSLMethods # :nodoc:
|
33
|
+
def paginate(**options)
|
34
|
+
options.reverse_merge!(
|
35
|
+
per_page: ::Kaminari.config.default_per_page || 10,
|
36
|
+
max_per_page: ::Kaminari.config.max_per_page,
|
37
|
+
offset: 0,
|
38
|
+
)
|
39
|
+
params do
|
40
|
+
optional :page, type: Integer, default: 1,
|
41
|
+
desc: 'Page offset to fetch.'
|
42
|
+
optional :per_page, type: Integer, default: options[:per_page],
|
43
|
+
desc: 'Number of results to return per page.',
|
44
|
+
max_value: options[:max_per_page]
|
45
|
+
if options[:offset].is_a? Numeric
|
46
|
+
optional :offset, type: Integer, default: options[:offset],
|
47
|
+
desc: 'Pad a number of results.'
|
39
48
|
end
|
40
49
|
end
|
41
50
|
end
|
@@ -1,23 +1,14 @@
|
|
1
1
|
module Grape
|
2
2
|
module Kaminari
|
3
|
-
|
4
|
-
Grape::Validations::Base
|
5
|
-
else
|
6
|
-
Grape::Validations::SingleOptionValidator
|
7
|
-
end
|
8
|
-
|
9
|
-
class MaxValueValidator < base
|
3
|
+
class MaxValueValidator < Grape::Validations::Base
|
10
4
|
def validate_param!(attr_name, params)
|
11
|
-
return unless params[attr_name]
|
12
|
-
|
13
5
|
attr = params[attr_name]
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
6
|
+
return unless attr.is_a?(Integer) && @option && attr > @option
|
7
|
+
|
8
|
+
raise Grape::Exceptions::Validation.new(
|
9
|
+
params: [@scope.full_name(attr_name)],
|
10
|
+
message: "must be less than or equal #{@option}",
|
11
|
+
)
|
21
12
|
end
|
22
13
|
end
|
23
14
|
end
|
data/spec/kaminari_spec.rb
CHANGED
@@ -9,7 +9,6 @@ class PaginatedAPI < Grape::API
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe Grape::Kaminari do
|
12
|
-
|
13
12
|
describe 'unpaginated api' do
|
14
13
|
subject { Class.new(UnPaginatedAPI) }
|
15
14
|
|
@@ -23,19 +22,16 @@ describe Grape::Kaminari do
|
|
23
22
|
|
24
23
|
it 'adds to declared parameters' do
|
25
24
|
subject.paginate
|
26
|
-
|
27
|
-
expect(subject.inheritable_setting.route[:declared_params]).to eq([:page, :per_page, :offset])
|
28
|
-
else
|
29
|
-
expect(subject.settings[:declared_params]).to eq([:page, :per_page, :offset])
|
30
|
-
end
|
25
|
+
expect(subject.inheritable_setting.route[:declared_params]).to eq(%i[page per_page offset])
|
31
26
|
end
|
32
27
|
|
33
28
|
describe 'descriptions, validation, and defaults' do
|
29
|
+
let(:params) { subject.routes.first.params }
|
30
|
+
|
34
31
|
before do
|
35
32
|
subject.paginate
|
36
|
-
subject.get
|
33
|
+
subject.get('/') {}
|
37
34
|
end
|
38
|
-
let(:params) {subject.routes.first.route_params}
|
39
35
|
|
40
36
|
it 'does not require :page' do
|
41
37
|
expect(params['page'][:required]).to eq(false)
|
@@ -84,21 +80,18 @@ describe Grape::Kaminari do
|
|
84
80
|
it 'defaults :offset to 0' do
|
85
81
|
expect(params['offset'][:default]).to eq(0)
|
86
82
|
end
|
87
|
-
|
88
|
-
|
89
83
|
end
|
90
|
-
|
91
84
|
end
|
92
85
|
|
93
86
|
describe 'custom paginated api' do
|
94
87
|
subject { Class.new(PaginatedAPI) }
|
95
|
-
|
88
|
+
let(:app) { subject }
|
89
|
+
let(:params) { subject.routes.first.params }
|
96
90
|
|
97
91
|
before do
|
98
|
-
subject.paginate per_page:99, max_per_page: 999, offset: 9
|
99
|
-
subject.get
|
92
|
+
subject.paginate per_page: 99, max_per_page: 999, offset: 9
|
93
|
+
subject.get('/') {}
|
100
94
|
end
|
101
|
-
let(:params) {subject.routes.first.route_params}
|
102
95
|
|
103
96
|
it 'defaults :per_page to customized value' do
|
104
97
|
expect(params['per_page'][:default]).to eq(99)
|
@@ -106,19 +99,24 @@ describe Grape::Kaminari do
|
|
106
99
|
|
107
100
|
it 'succeeds when :per_page is within :max_value' do
|
108
101
|
get('/', page: 1, per_page: 999)
|
109
|
-
expect(last_response.status).to eq
|
102
|
+
expect(last_response.status).to eq(200)
|
110
103
|
end
|
111
104
|
|
112
105
|
it 'ensures :per_page is within :max_value' do
|
113
106
|
get('/', page: 1, per_page: 1_000)
|
114
|
-
expect(last_response.status).to eq
|
115
|
-
expect(last_response.body).to match
|
107
|
+
expect(last_response.status).to eq(400)
|
108
|
+
expect(last_response.body).to match(/per_page must be less than or equal 999/)
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'ensures :per_page is numeric' do
|
112
|
+
get('/', page: 1, per_page: 'foo')
|
113
|
+
expect(last_response.status).to eq(400)
|
114
|
+
expect(last_response.body).to match(/per_page is invalid/)
|
116
115
|
end
|
117
116
|
|
118
117
|
it 'defaults :offset to customized value' do
|
119
118
|
expect(params['offset'][:default]).to eq(9)
|
120
119
|
end
|
121
|
-
|
122
120
|
end
|
123
121
|
|
124
122
|
describe 'paginated api without :offset' do
|
@@ -126,13 +124,7 @@ describe Grape::Kaminari do
|
|
126
124
|
|
127
125
|
it 'excludes :offset from declared params' do
|
128
126
|
subject.paginate offset: false
|
129
|
-
|
130
|
-
expect(subject.inheritable_setting.route[:declared_params]).not_to include(:offset)
|
131
|
-
else
|
132
|
-
expect(subject.settings[:declared_params]).not_to include(:offset)
|
133
|
-
end
|
127
|
+
expect(subject.inheritable_setting.route[:declared_params]).not_to include(:offset)
|
134
128
|
end
|
135
|
-
|
136
129
|
end
|
137
|
-
|
138
130
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'json'
|
2
3
|
|
3
4
|
class PaginatedAPI < Grape::API
|
4
5
|
include Grape::Kaminari
|
@@ -12,16 +13,22 @@ class PaginatedAPI < Grape::API
|
|
12
13
|
get 'no-offset' do
|
13
14
|
paginate(Kaminari.paginate_array((1..10).to_a))
|
14
15
|
end
|
16
|
+
|
17
|
+
resource :sub do
|
18
|
+
paginate per_page: 2
|
19
|
+
get '/' do
|
20
|
+
paginate(Kaminari.paginate_array((1..10).to_a))
|
21
|
+
end
|
22
|
+
end
|
15
23
|
end
|
16
24
|
|
17
25
|
describe Grape::Kaminari do
|
18
26
|
subject { PaginatedAPI.new }
|
19
|
-
|
27
|
+
let(:app) { subject }
|
20
28
|
let(:json) { JSON.parse(last_response.body) }
|
21
29
|
let(:header) { last_response.header }
|
22
30
|
|
23
31
|
describe 'paginated helper' do
|
24
|
-
|
25
32
|
it 'returns the first page' do
|
26
33
|
get '/', page: 1, per_page: 3
|
27
34
|
expect(json).to eq [1, 2, 3]
|
@@ -50,7 +57,9 @@ describe Grape::Kaminari do
|
|
50
57
|
expect(header['X-Offset']).to eq '1'
|
51
58
|
end
|
52
59
|
|
60
|
+
it 'can be inherited' do
|
61
|
+
get '/sub', page: 1
|
62
|
+
expect(json).to eq [1, 2]
|
63
|
+
end
|
53
64
|
end
|
54
|
-
|
55
|
-
|
56
65
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,19 +1,15 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
1
|
require 'rspec'
|
4
|
-
require 'kaminari'
|
5
|
-
require 'grape'
|
6
2
|
require 'grape-kaminari'
|
7
3
|
require 'rack/test'
|
8
4
|
|
9
5
|
# Requires supporting files with custom matchers and macros, etc,
|
10
6
|
# in ./support/ and its subdirectories.
|
11
|
-
Dir[
|
7
|
+
Dir[File.expand_path('./support/**/*.rb', __dir__)].sort.each { |f| require f }
|
12
8
|
|
13
9
|
I18n.enforce_available_locales = false
|
14
10
|
|
15
11
|
RSpec.configure do |config|
|
16
12
|
config.include Rack::Test::Methods
|
17
|
-
config.
|
13
|
+
config.raise_errors_for_deprecations!
|
18
14
|
config.order = 'random'
|
19
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-kaminari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tymon Tobolski
|
8
|
+
- Black Square Media
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: grape
|
@@ -16,16 +17,22 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
+
version: '1.0'
|
21
|
+
- - "!="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.4.0
|
20
24
|
type: :runtime
|
21
25
|
prerelease: false
|
22
26
|
version_requirements: !ruby/object:Gem::Requirement
|
23
27
|
requirements:
|
24
28
|
- - ">="
|
25
29
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
30
|
+
version: '1.0'
|
31
|
+
- - "!="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.4.0
|
27
34
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: kaminari
|
35
|
+
name: kaminari-grape
|
29
36
|
requirement: !ruby/object:Gem::Requirement
|
30
37
|
requirements:
|
31
38
|
- - ">="
|
@@ -42,16 +49,30 @@ dependencies:
|
|
42
49
|
name: bundler
|
43
50
|
requirement: !ruby/object:Gem::Requirement
|
44
51
|
requirements:
|
45
|
-
- - "
|
52
|
+
- - ">="
|
46
53
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
54
|
+
version: '0'
|
48
55
|
type: :development
|
49
56
|
prerelease: false
|
50
57
|
version_requirements: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- - "
|
59
|
+
- - ">="
|
53
60
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rack-test
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
55
76
|
- !ruby/object:Gem::Dependency
|
56
77
|
name: rake
|
57
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,25 +91,42 @@ dependencies:
|
|
70
91
|
name: rspec
|
71
92
|
requirement: !ruby/object:Gem::Requirement
|
72
93
|
requirements:
|
73
|
-
- - "
|
94
|
+
- - ">="
|
74
95
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
96
|
+
version: '0'
|
76
97
|
type: :development
|
77
98
|
prerelease: false
|
78
99
|
version_requirements: !ruby/object:Gem::Requirement
|
79
100
|
requirements:
|
80
|
-
- - "
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: rubocop
|
106
|
+
requirement: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
110
|
+
version: '0'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
83
118
|
description: kaminari paginator integration for grape API framework
|
84
119
|
email:
|
85
|
-
-
|
120
|
+
- info@blacksquaremedia.com
|
86
121
|
executables: []
|
87
122
|
extensions: []
|
88
123
|
extra_rdoc_files: []
|
89
124
|
files:
|
90
125
|
- ".gitignore"
|
126
|
+
- ".rubocop.yml"
|
127
|
+
- ".travis.yml"
|
91
128
|
- Gemfile
|
129
|
+
- Gemfile.lock
|
92
130
|
- LICENSE.txt
|
93
131
|
- README.md
|
94
132
|
- Rakefile
|
@@ -112,15 +150,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
150
|
requirements:
|
113
151
|
- - ">="
|
114
152
|
- !ruby/object:Gem::Version
|
115
|
-
version: '
|
153
|
+
version: '2.5'
|
116
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
155
|
requirements:
|
118
156
|
- - ">="
|
119
157
|
- !ruby/object:Gem::Version
|
120
158
|
version: '0'
|
121
159
|
requirements: []
|
122
|
-
|
123
|
-
rubygems_version: 2.2.2
|
160
|
+
rubygems_version: 3.1.2
|
124
161
|
signing_key:
|
125
162
|
specification_version: 4
|
126
163
|
summary: kaminari integration for grape
|