sunspot_with_kaminari 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sunspot_with_kaminari/version.rb +1 -1
- data/lib/sunspot_with_kaminari.rb +9 -11
- data/sunspot_with_kaminari.gemspec +2 -2
- metadata +46 -44
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
# end
|
3
|
-
|
4
|
-
module Sunspot
|
1
|
+
module SunspotWithKaminari
|
5
2
|
module Search
|
6
|
-
|
7
|
-
|
3
|
+
module AbstractSearchInstanceMethods
|
8
4
|
# ==== Returns
|
9
5
|
#
|
10
6
|
# Integer:: Current page number
|
@@ -12,15 +8,15 @@ module Sunspot
|
|
12
8
|
def current_page
|
13
9
|
@query.page
|
14
10
|
end
|
15
|
-
|
11
|
+
|
16
12
|
# ==== Returns
|
17
13
|
#
|
18
14
|
# Integer:: Total number of pages for matching documents
|
19
15
|
#
|
20
|
-
def
|
16
|
+
def total_pages
|
21
17
|
(total.to_f / @query.per_page).ceil
|
22
18
|
end
|
23
|
-
|
19
|
+
|
24
20
|
# ==== Returns
|
25
21
|
#
|
26
22
|
# Integer:: Number of records displayed per page
|
@@ -28,14 +24,16 @@ module Sunspot
|
|
28
24
|
def limit_value
|
29
25
|
@query.per_page
|
30
26
|
end
|
31
|
-
|
27
|
+
|
32
28
|
def empty?
|
33
29
|
total == 0
|
34
30
|
end
|
35
|
-
|
31
|
+
|
36
32
|
def any?
|
37
33
|
total > 0
|
38
34
|
end
|
39
35
|
end
|
40
36
|
end
|
41
37
|
end
|
38
|
+
|
39
|
+
Sunspot::Search::AbstractSearch.send(:include, SunspotWithKaminari::Search::AbstractSearchInstanceMethods)
|
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = %q{Extends sunspot to be compatible with kaminari for pagination}
|
14
14
|
|
15
15
|
s.rubyforge_project = "sunspot_with_kaminari"
|
16
|
-
|
16
|
+
|
17
17
|
s.add_dependency 'sunspot_rails'
|
18
|
-
s.add_dependency 'kaminari'
|
18
|
+
s.add_dependency 'kaminari', '>= 0.14.0'
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,49 +1,55 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_with_kaminari
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Richard Millan
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-10-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: sunspot_rails
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: kaminari
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: kaminari
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
30
33
|
none: false
|
31
|
-
requirements:
|
32
|
-
- -
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.14.0
|
35
38
|
type: :runtime
|
36
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.14.0
|
37
46
|
description: Extends sunspot to be compatible with kaminari for pagination
|
38
|
-
email:
|
47
|
+
email:
|
39
48
|
- richardiux@gmail.com
|
40
49
|
executables: []
|
41
|
-
|
42
50
|
extensions: []
|
43
|
-
|
44
51
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
52
|
+
files:
|
47
53
|
- .gitignore
|
48
54
|
- Gemfile
|
49
55
|
- README.md
|
@@ -53,30 +59,26 @@ files:
|
|
53
59
|
- sunspot_with_kaminari.gemspec
|
54
60
|
homepage: https://github.com/richardiux/sunspot_with_kaminari
|
55
61
|
licenses: []
|
56
|
-
|
57
62
|
post_install_message:
|
58
63
|
rdoc_options: []
|
59
|
-
|
60
|
-
require_paths:
|
64
|
+
require_paths:
|
61
65
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
67
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version:
|
68
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
73
|
none: false
|
70
|
-
requirements:
|
71
|
-
- -
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version:
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
74
78
|
requirements: []
|
75
|
-
|
76
79
|
rubyforge_project: sunspot_with_kaminari
|
77
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.8.23
|
78
81
|
signing_key:
|
79
82
|
specification_version: 3
|
80
83
|
summary: Pagination with kaminari for sunspot
|
81
84
|
test_files: []
|
82
|
-
|