kaminari-core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +2 -2
- data/kaminari-core.gemspec +2 -1
- data/lib/kaminari/core/version.rb +1 -1
- data/lib/kaminari/models/configuration_methods.rb +1 -1
- data/lib/kaminari/models/page_scope_methods.rb +3 -5
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71383288887542c1c6fa3f97848d7c8808c832e6
|
4
|
+
data.tar.gz: 39eaef3145689f64c2d2811365f581d133891c7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd05edc2e7fe87e05f73837e6c299a9a944423a34e37972a790c448c490d3b3fdf749950174cbc7cbbbd832286015a5638df67c5c426fa5239903eff9e5540e1
|
7
|
+
data.tar.gz: 376afd5167b074d3a73afa27b38b4a3d86b7eb1071ebf392e64508484a9708ad7103ed06f1870e6fef4d770c1a3ac2bbeed6538facf366acc675165ec5066c30
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
See https://github.com/kaminari/kaminari/tree/master/CHANGELOG.md for changes.
|
data/README.md
CHANGED
@@ -18,12 +18,12 @@ And bundle.
|
|
18
18
|
|
19
19
|
This gem is basically an internal gem that will be automatically bundled from kaminari gem or kaminari adapter gems.
|
20
20
|
|
21
|
-
See [Kaminari README](https://github.com/
|
21
|
+
See [Kaminari README](https://github.com/kaminari/kaminari/blob/master/README.md) for the documentation.
|
22
22
|
|
23
23
|
|
24
24
|
## Contributing
|
25
25
|
|
26
|
-
Pull requests are welcome on GitHub at https://github.com/
|
26
|
+
Pull requests are welcome on GitHub at https://github.com/kaminari/kaminari.
|
27
27
|
|
28
28
|
|
29
29
|
## License
|
data/kaminari-core.gemspec
CHANGED
@@ -12,8 +12,9 @@ Gem::Specification.new do |spec|
|
|
12
12
|
|
13
13
|
spec.summary = "Kaminari's core pagination library"
|
14
14
|
spec.description = 'kaminari-core includes pagination logic independent from ORMs and view libraries'
|
15
|
-
spec.homepage = 'https://github.com/
|
15
|
+
spec.homepage = 'https://github.com/kaminari/kaminari'
|
16
16
|
spec.license = "MIT"
|
17
|
+
spec.required_ruby_version = '>= 2.0.0'
|
17
18
|
|
18
19
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
20
|
spec.require_paths = ["lib"]
|
@@ -49,7 +49,7 @@ module Kaminari
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def max_pages_per(val)
|
52
|
-
ActiveSupport::Deprecation.warn 'max_pages_per is deprecated. Use max_pages instead.'
|
52
|
+
ActiveSupport::Deprecation.warn 'max_pages_per is deprecated. Use max_pages instead.'
|
53
53
|
max_pages val
|
54
54
|
end
|
55
55
|
end
|
@@ -5,14 +5,12 @@ module Kaminari
|
|
5
5
|
# Model.page(3).per(10)
|
6
6
|
def per(num, max_per_page: nil)
|
7
7
|
max_per_page ||= ((defined?(@_max_per_page) && @_max_per_page) || self.max_per_page)
|
8
|
-
@_per = num
|
9
|
-
if num.
|
10
|
-
limit(max_per_page).offset(offset_value / limit_value * max_per_page)
|
11
|
-
elsif (n = num.to_i) < 0 || !(/^\d/ =~ num.to_s)
|
8
|
+
@_per = (num || default_per_page).to_i
|
9
|
+
if (n = num.to_i) < 0 || !(/^\d/ =~ num.to_s)
|
12
10
|
self
|
13
11
|
elsif n.zero?
|
14
12
|
limit(n)
|
15
|
-
elsif max_per_page && max_per_page < n
|
13
|
+
elsif max_per_page && (max_per_page < n)
|
16
14
|
limit(max_per_page).offset(offset_value / limit_value * max_per_page)
|
17
15
|
else
|
18
16
|
limit(n).offset(offset_value / limit_value * n)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -46,6 +46,7 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
+
- CHANGELOG.md
|
49
50
|
- MIT-LICENSE
|
50
51
|
- README.md
|
51
52
|
- app/views/kaminari/_first_page.html.erb
|
@@ -86,7 +87,7 @@ files:
|
|
86
87
|
- lib/kaminari/models/configuration_methods.rb
|
87
88
|
- lib/kaminari/models/page_scope_methods.rb
|
88
89
|
- lib/kaminari/railtie.rb
|
89
|
-
homepage: https://github.com/
|
90
|
+
homepage: https://github.com/kaminari/kaminari
|
90
91
|
licenses:
|
91
92
|
- MIT
|
92
93
|
metadata: {}
|
@@ -98,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
99
|
requirements:
|
99
100
|
- - ">="
|
100
101
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
102
|
+
version: 2.0.0
|
102
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
104
|
requirements:
|
104
105
|
- - ">="
|