grape-kaminari 0.4.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5282850782bd08c0a0719eaad85f84b406f1a7419b9755162f939dc7f7aa71bc
4
- data.tar.gz: 1fbe1503fe2149f82413c3e934452c85bfe190657077fbd1607e6a10beb812b2
3
+ metadata.gz: e7bef8d7546d576aca8f4b0f1bdb1e633c4ea4d63b011063228874e226b0826f
4
+ data.tar.gz: 0ca3f5acfad14c2a5bddea2e4605ebeedce883f22f41d93cd900dac8d6113a84
5
5
  SHA512:
6
- metadata.gz: 644acde6f381781e2ef22c484c72fd9c754f7b72382e88fb3047bd71686c9284f65ba4154d887ba66ed45dc164fbb2d1902dfefbcb9310ea42124b5f9146e8cc
7
- data.tar.gz: 12552dd5e9ce60c46726554e51cdffc01d1782b7a026f5298141f6c9b60e29ab0c05ce799eab01ae73acc14f458a08a6127b06d2357948ebc89b60681e5f3b71
6
+ metadata.gz: 2b12a1b1e568af31df333ff20f617d9e0687b0177430fd8a8be40f92b7b44fc6fa7777278f0629302e0f939b7901c66e5df8a3cce19702131c1d800edea491b8
7
+ data.tar.gz: 90ac0dad49e5910652100d3518ac38fab54f8903004a4ceef027fa58d3f1bc25b27988735dfde36ba7af0658b364f858b40c4c7b3bd22e724b0651ddd7129b15
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: ["2.5", "2.6", "2.7", "3.0"]
14
+ ruby-version: ["2.7", "3.0", "3.1", "3.2"]
15
15
  steps:
16
16
  - uses: actions/checkout@v2
17
17
  - uses: ruby/setup-ruby@v1
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ *~
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ inherit_mode:
6
6
  - Exclude
7
7
 
8
8
  AllCops:
9
- TargetRubyVersion: "2.5"
9
+ TargetRubyVersion: "2.7"
10
10
 
11
11
  Naming/FileName:
12
12
  Exclude:
data/Gemfile CHANGED
@@ -2,3 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in grape-kaminari.gemspec
4
4
  gemspec
5
+
6
+ gem 'rack-test'
7
+ gem 'rake'
8
+ gem 'rspec'
9
+ gem 'rubocop-bsm'
data/Gemfile.lock CHANGED
@@ -1,119 +1,113 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-kaminari (0.4.2)
5
- grape (>= 1.6.1, != 1.4.0)
4
+ grape-kaminari (0.4.4)
5
+ grape (>= 1.6.1)
6
6
  kaminari-grape
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.1.3.1)
11
+ activesupport (7.0.4.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
16
  ast (2.4.2)
18
17
  builder (3.2.4)
19
- concurrent-ruby (1.1.8)
20
- diff-lcs (1.4.4)
21
- dry-configurable (0.12.1)
18
+ concurrent-ruby (1.2.0)
19
+ diff-lcs (1.5.0)
20
+ dry-core (1.0.0)
22
21
  concurrent-ruby (~> 1.0)
23
- dry-core (~> 0.5, >= 0.5.0)
24
- dry-container (0.7.2)
22
+ zeitwerk (~> 2.6)
23
+ dry-inflector (1.0.0)
24
+ dry-logic (1.5.0)
25
25
  concurrent-ruby (~> 1.0)
26
- dry-configurable (~> 0.1, >= 0.1.3)
27
- dry-core (0.5.0)
26
+ dry-core (~> 1.0, < 2)
27
+ zeitwerk (~> 2.6)
28
+ dry-types (1.7.0)
28
29
  concurrent-ruby (~> 1.0)
29
- dry-inflector (0.2.0)
30
- dry-logic (1.2.0)
31
- concurrent-ruby (~> 1.0)
32
- dry-core (~> 0.5, >= 0.5)
33
- dry-types (1.5.1)
34
- concurrent-ruby (~> 1.0)
35
- dry-container (~> 0.3)
36
- dry-core (~> 0.5, >= 0.5)
37
- dry-inflector (~> 0.1, >= 0.1.2)
38
- dry-logic (~> 1.0, >= 1.0.2)
39
- grape (1.6.2)
30
+ dry-core (~> 1.0, < 2)
31
+ dry-inflector (~> 1.0, < 2)
32
+ dry-logic (>= 1.4, < 2)
33
+ zeitwerk (~> 2.6)
34
+ grape (1.7.0)
40
35
  activesupport
41
36
  builder
42
37
  dry-types (>= 1.1)
43
38
  mustermann-grape (~> 1.0.0)
44
39
  rack (>= 1.3.0)
45
40
  rack-accept
46
- i18n (1.8.10)
41
+ i18n (1.12.0)
47
42
  concurrent-ruby (~> 1.0)
48
- kaminari-core (1.2.1)
43
+ json (2.6.3)
44
+ kaminari-core (1.2.2)
49
45
  kaminari-grape (1.0.1)
50
46
  grape
51
47
  kaminari-core (~> 1.0)
52
- minitest (5.14.4)
53
- mustermann (1.1.1)
48
+ minitest (5.17.0)
49
+ mustermann (3.0.0)
54
50
  ruby2_keywords (~> 0.0.1)
55
- mustermann-grape (1.0.1)
51
+ mustermann-grape (1.0.2)
56
52
  mustermann (>= 1.0.0)
57
- parallel (1.20.1)
58
- parser (3.0.1.1)
53
+ parallel (1.22.1)
54
+ parser (3.2.0.0)
59
55
  ast (~> 2.4.1)
60
- rack (2.2.3)
56
+ rack (3.0.4.1)
61
57
  rack-accept (0.4.5)
62
58
  rack (>= 0.4)
63
- rack-test (1.1.0)
64
- rack (>= 1.0, < 3)
65
- rainbow (3.0.0)
66
- rake (13.0.3)
67
- regexp_parser (2.1.1)
59
+ rack-test (2.0.2)
60
+ rack (>= 1.3)
61
+ rainbow (3.1.1)
62
+ rake (13.0.6)
63
+ regexp_parser (2.6.2)
68
64
  rexml (3.2.5)
69
- rspec (3.10.0)
70
- rspec-core (~> 3.10.0)
71
- rspec-expectations (~> 3.10.0)
72
- rspec-mocks (~> 3.10.0)
73
- rspec-core (3.10.1)
74
- rspec-support (~> 3.10.0)
75
- rspec-expectations (3.10.1)
65
+ rspec (3.12.0)
66
+ rspec-core (~> 3.12.0)
67
+ rspec-expectations (~> 3.12.0)
68
+ rspec-mocks (~> 3.12.0)
69
+ rspec-core (3.12.0)
70
+ rspec-support (~> 3.12.0)
71
+ rspec-expectations (3.12.2)
76
72
  diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.10.0)
78
- rspec-mocks (3.10.2)
73
+ rspec-support (~> 3.12.0)
74
+ rspec-mocks (3.12.3)
79
75
  diff-lcs (>= 1.2.0, < 2.0)
80
- rspec-support (~> 3.10.0)
81
- rspec-support (3.10.2)
82
- rubocop (1.13.0)
76
+ rspec-support (~> 3.12.0)
77
+ rspec-support (3.12.0)
78
+ rubocop (1.44.1)
79
+ json (~> 2.3)
83
80
  parallel (~> 1.10)
84
- parser (>= 3.0.0.0)
81
+ parser (>= 3.2.0.0)
85
82
  rainbow (>= 2.2.2, < 4.0)
86
83
  regexp_parser (>= 1.8, < 3.0)
87
- rexml
88
- rubocop-ast (>= 1.2.0, < 2.0)
84
+ rexml (>= 3.2.5, < 4.0)
85
+ rubocop-ast (>= 1.24.1, < 2.0)
89
86
  ruby-progressbar (~> 1.7)
90
- unicode-display_width (>= 1.4.0, < 3.0)
91
- rubocop-ast (1.5.0)
92
- parser (>= 3.0.1.1)
93
- rubocop-bsm (0.5.9)
87
+ unicode-display_width (>= 2.4.0, < 3.0)
88
+ rubocop-ast (1.24.1)
89
+ parser (>= 3.1.1.0)
90
+ rubocop-bsm (0.6.1)
94
91
  rubocop (~> 1.0)
95
92
  rubocop-performance
96
- rubocop-rails
97
93
  rubocop-rake
98
94
  rubocop-rspec
99
- rubocop-performance (1.11.1)
95
+ rubocop-capybara (2.17.0)
96
+ rubocop (~> 1.41)
97
+ rubocop-performance (1.15.2)
100
98
  rubocop (>= 1.7.0, < 2.0)
101
99
  rubocop-ast (>= 0.4.0)
102
- rubocop-rails (2.9.1)
103
- activesupport (>= 4.2.0)
104
- rack (>= 1.1)
105
- rubocop (>= 0.90.0, < 2.0)
106
- rubocop-rake (0.5.1)
107
- rubocop
108
- rubocop-rspec (2.3.0)
100
+ rubocop-rake (0.6.0)
109
101
  rubocop (~> 1.0)
110
- rubocop-ast (>= 1.1.0)
102
+ rubocop-rspec (2.18.1)
103
+ rubocop (~> 1.33)
104
+ rubocop-capybara (~> 2.17)
111
105
  ruby-progressbar (1.11.0)
112
- ruby2_keywords (0.0.4)
113
- tzinfo (2.0.4)
106
+ ruby2_keywords (0.0.5)
107
+ tzinfo (2.0.6)
114
108
  concurrent-ruby (~> 1.0)
115
- unicode-display_width (2.0.0)
116
- zeitwerk (2.4.2)
109
+ unicode-display_width (2.4.2)
110
+ zeitwerk (2.6.6)
117
111
 
118
112
  PLATFORMS
119
113
  ruby
@@ -127,4 +121,4 @@ DEPENDENCIES
127
121
  rubocop-bsm
128
122
 
129
123
  BUNDLED WITH
130
- 2.1.4
124
+ 2.3.9
@@ -13,16 +13,12 @@ Gem::Specification.new do |spec|
13
13
  spec.license = 'MIT'
14
14
 
15
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
16
  spec.require_paths = ['lib']
18
- spec.required_ruby_version = '>= 2.5'
17
+ spec.required_ruby_version = '>= 2.7'
19
18
 
20
- spec.add_runtime_dependency 'grape', '>= 1.6.1', '!= 1.4.0'
19
+ spec.add_runtime_dependency 'grape', '>= 1.6.1'
21
20
  spec.add_runtime_dependency 'kaminari-grape'
22
21
 
23
22
  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-bsm'
23
+ spec.metadata['rubygems_mfa_required'] = 'true'
28
24
  end
@@ -1,5 +1,5 @@
1
1
  module Grape
2
2
  module Kaminari
3
- VERSION = '0.4.2'.freeze
3
+ VERSION = '0.4.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-kaminari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tymon Tobolski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-04 00:00:00.000000000 Z
12
+ date: 2023-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grape
@@ -18,9 +18,6 @@ dependencies:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.6.1
21
- - - "!="
22
- - !ruby/object:Gem::Version
23
- version: 1.4.0
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,9 +25,6 @@ dependencies:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 1.6.1
31
- - - "!="
32
- - !ruby/object:Gem::Version
33
- version: 1.4.0
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: kaminari-grape
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -59,62 +53,6 @@ dependencies:
59
53
  - - ">="
60
54
  - !ruby/object:Gem::Version
61
55
  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'
76
- - !ruby/object:Gem::Dependency
77
- name: rake
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- - !ruby/object:Gem::Dependency
91
- name: rspec
92
- requirement: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- type: :development
98
- prerelease: false
99
- version_requirements: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- - !ruby/object:Gem::Dependency
105
- name: rubocop-bsm
106
- requirement: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::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'
118
56
  description: kaminari paginator integration for grape API framework
119
57
  email:
120
58
  - info@blacksquaremedia.com
@@ -136,12 +74,11 @@ files:
136
74
  - lib/grape/kaminari.rb
137
75
  - lib/grape/kaminari/max_value_validator.rb
138
76
  - lib/grape/kaminari/version.rb
139
- - spec/grape/kaminari_spec.rb
140
- - spec/spec_helper.rb
141
77
  homepage: ''
142
78
  licenses:
143
79
  - MIT
144
- metadata: {}
80
+ metadata:
81
+ rubygems_mfa_required: 'true'
145
82
  post_install_message:
146
83
  rdoc_options: []
147
84
  require_paths:
@@ -150,17 +87,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
87
  requirements:
151
88
  - - ">="
152
89
  - !ruby/object:Gem::Version
153
- version: '2.5'
90
+ version: '2.7'
154
91
  required_rubygems_version: !ruby/object:Gem::Requirement
155
92
  requirements:
156
93
  - - ">="
157
94
  - !ruby/object:Gem::Version
158
95
  version: '0'
159
96
  requirements: []
160
- rubygems_version: 3.2.15
97
+ rubygems_version: 3.3.3
161
98
  signing_key:
162
99
  specification_version: 4
163
100
  summary: kaminari integration for grape
164
- test_files:
165
- - spec/grape/kaminari_spec.rb
166
- - spec/spec_helper.rb
101
+ test_files: []
@@ -1,130 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Grape::Kaminari do
4
- subject do
5
- Class.new(Grape::API) do
6
- include Grape::Kaminari
7
- end
8
- end
9
-
10
- def declared_params
11
- subject.namespace_stackable(:declared_params).flatten
12
- end
13
-
14
- it 'adds to declared parameters' do
15
- subject.params { use :pagination }
16
- expect(declared_params).to eq(%i[page per_page offset])
17
- end
18
-
19
- it 'may exclude :offset' do
20
- subject.params { use :pagination, offset: false }
21
- expect(declared_params).to eq(%i[page per_page])
22
- end
23
-
24
- it 'supports legacy declarations' do
25
- subject.paginate
26
- expect(declared_params).to eq(%i[page per_page offset])
27
- end
28
-
29
- it 'does not stumble across repeated declarations' do
30
- subject.paginate offset: false
31
- subject.params do
32
- optional :extra
33
- end
34
- expect(declared_params).to eq(%i[page per_page extra])
35
- end
36
-
37
- describe 'descriptions, validation, and defaults' do
38
- let(:params) { subject.routes.first.params }
39
-
40
- before do
41
- subject.params { use :pagination }
42
- subject.get('/') { 'OK' }
43
- end
44
-
45
- it 'does not require :page' do
46
- expect(params['page'][:required]).to eq(false)
47
- end
48
-
49
- it 'does not require :per_page' do
50
- expect(params['per_page'][:required]).to eq(false)
51
- end
52
-
53
- it 'does not require :offset' do
54
- expect(params['offset'][:required]).to eq(false)
55
- end
56
-
57
- it 'describes :page' do
58
- expect(params['page'][:desc]).to eq('Page offset to fetch.')
59
- end
60
-
61
- it 'describes :per_page' do
62
- expect(params['per_page'][:desc]).to eq('Number of results to return per page.')
63
- end
64
-
65
- it 'describes :offset' do
66
- expect(params['offset'][:desc]).to eq('Pad a number of results.')
67
- end
68
-
69
- it 'validates :page as Integer' do
70
- expect(params['page'][:type]).to eq('Integer')
71
- end
72
-
73
- it 'validates :per_page as Integer' do
74
- expect(params['per_page'][:type]).to eq('Integer')
75
- end
76
-
77
- it 'validates :offset as Integer' do
78
- expect(params['offset'][:type]).to eq('Integer')
79
- end
80
-
81
- it 'defaults :page to 1' do
82
- expect(params['page'][:default]).to eq(1)
83
- end
84
-
85
- it 'defaults :per_page to Kaminari.config.default_per_page' do
86
- expect(params['per_page'][:default]).to eq(::Kaminari.config.default_per_page)
87
- end
88
-
89
- it 'defaults :offset to 0' do
90
- expect(params['offset'][:default]).to eq(0)
91
- end
92
- end
93
-
94
- describe 'custom paginated api' do
95
- let(:app) { subject }
96
- let(:params) { subject.routes.first.params }
97
-
98
- before do
99
- subject.params do
100
- use :pagination, per_page: 99, max_per_page: 999, offset: 9
101
- end
102
- subject.get('/') { 'OK' }
103
- end
104
-
105
- it 'defaults :per_page to customized value' do
106
- expect(params['per_page'][:default]).to eq(99)
107
- end
108
-
109
- it 'succeeds when :per_page is within :max_value' do
110
- get('/', page: 1, per_page: 999)
111
- expect(last_response.status).to eq(200)
112
- end
113
-
114
- it 'ensures :per_page is within :max_value' do
115
- get('/', page: 1, per_page: 1_000)
116
- expect(last_response.status).to eq(400)
117
- expect(last_response.body).to match(/per_page must be less than or equal 999/)
118
- end
119
-
120
- it 'ensures :per_page is numeric' do
121
- get('/', page: 1, per_page: 'foo')
122
- expect(last_response.status).to eq(400)
123
- expect(last_response.body).to match(/per_page is invalid/)
124
- end
125
-
126
- it 'defaults :offset to customized value' do
127
- expect(params['offset'][:default]).to eq(9)
128
- end
129
- end
130
- end
data/spec/spec_helper.rb DELETED
@@ -1,15 +0,0 @@
1
- require 'rspec'
2
- require 'grape-kaminari'
3
- require 'rack/test'
4
-
5
- # Requires supporting files with custom matchers and macros, etc,
6
- # in ./support/ and its subdirectories.
7
- Dir[File.expand_path('./support/**/*.rb', __dir__)].sort.each {|f| require f }
8
-
9
- I18n.enforce_available_locales = false
10
-
11
- RSpec.configure do |config|
12
- config.include Rack::Test::Methods
13
- config.raise_errors_for_deprecations!
14
- config.order = 'random'
15
- end