nazrin 1.0.1 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -8
- data/lib/generators/nazrin/templates/nazrin_config.rb +0 -2
- data/lib/nazrin.rb +0 -3
- data/lib/nazrin/config.rb +0 -1
- data/lib/nazrin/pagination_generator.rb +6 -12
- data/lib/nazrin/version.rb +1 -1
- data/nazrin.gemspec +0 -2
- metadata +5 -35
- data/lib/nazrin/pagination_generator/kaminari_generator.rb +0 -18
- data/lib/nazrin/pagination_generator/nazrin_generator.rb +0 -13
- data/lib/nazrin/pagination_generator/will_paginate_generator.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f2aac2c4bb9f2b8c6da46224038f27ff7aa5195
|
4
|
+
data.tar.gz: d9c9197a6a2ed068801f20a88ca36642fd385189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466c7d325bbbaf7ae37fdb10e8b04c5ca9a45301b0e1e2b4cc3b0b0157823ceb071259863a756896acbb24ea21b76c94523fa2d3c880b7a26c47c56d5fb388e0
|
7
|
+
data.tar.gz: 826d246e6fe16414ee267caea7fa539ec8165696f9965b70b5a3c6fd510c874c02c1e440bf7e467bd475ba6792af2fb0813c13f495811b31583e7fe5410ad028
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Nazrin is a Ruby wrapper for Amazon CloudSearch (aws-sdk), with optional ActiveRecord support for easy integration with your Rails application.
|
8
8
|
|
9
|
-
|
9
|
+
>*Nazrin has the ability of the extent which find what you're looking for...*
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -38,8 +38,6 @@ Nazrin.configure do |config|
|
|
38
38
|
config.region = ''
|
39
39
|
config.access_key_id = ''
|
40
40
|
config.secret_access_key = ''
|
41
|
-
# currently support 'kaminari', 'will_paginate' or 'nazrin'
|
42
|
-
config.pagination = 'kaminari'
|
43
41
|
end
|
44
42
|
```
|
45
43
|
|
@@ -63,11 +61,6 @@ Post.search(where: :foo, includes: :bar).size(1).start(0).query("(and 'content')
|
|
63
61
|
=> [#<Post id: 1, content: "content">]
|
64
62
|
```
|
65
63
|
|
66
|
-
If you want to use other pagination gem, in your Gemfile
|
67
|
-
```ruby
|
68
|
-
gem 'kaminari' # or 'will_paginate'
|
69
|
-
```
|
70
|
-
|
71
64
|
## Development
|
72
65
|
|
73
66
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/nazrin.rb
CHANGED
data/lib/nazrin/config.rb
CHANGED
@@ -1,19 +1,13 @@
|
|
1
1
|
module Nazrin
|
2
2
|
module PaginationGenerator
|
3
|
-
SUPPORTED_PAGINATION_GEMS = %w(nazrin kaminari will_paginate)
|
4
|
-
|
5
3
|
class << self
|
6
4
|
def generate(collection, options = {})
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def retreive_generator_module
|
15
|
-
require "nazrin/pagination_generator/#{Nazrin.config.pagination}_generator"
|
16
|
-
Nazrin::PaginationGenerator.const_get("#{Nazrin.config.pagination.to_s.camelize}Generator")
|
5
|
+
Nazrin::PaginatedArray.new(
|
6
|
+
collection,
|
7
|
+
options[:current_page],
|
8
|
+
options[:per_page],
|
9
|
+
options[:total_count]
|
10
|
+
)
|
17
11
|
end
|
18
12
|
end
|
19
13
|
end
|
data/lib/nazrin/version.rb
CHANGED
data/nazrin.gemspec
CHANGED
@@ -22,8 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.9'
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
24
24
|
spec.add_development_dependency 'rubocop'
|
25
|
-
spec.add_development_dependency 'kaminari'
|
26
|
-
spec.add_development_dependency 'will_paginate'
|
27
25
|
spec.add_development_dependency 'rspec'
|
28
26
|
spec.add_development_dependency 'coveralls'
|
29
27
|
spec.add_development_dependency 'sqlite3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nazrin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomohiro Suwa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -66,34 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: kaminari
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: will_paginate
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: rspec
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,6 +148,7 @@ files:
|
|
176
148
|
- ".rspec"
|
177
149
|
- ".rubocop.yml"
|
178
150
|
- ".travis.yml"
|
151
|
+
- CHANGELOG.md
|
179
152
|
- Gemfile
|
180
153
|
- LICENSE.txt
|
181
154
|
- README.md
|
@@ -189,9 +162,6 @@ files:
|
|
189
162
|
- lib/nazrin/document_client.rb
|
190
163
|
- lib/nazrin/paginated_array.rb
|
191
164
|
- lib/nazrin/pagination_generator.rb
|
192
|
-
- lib/nazrin/pagination_generator/kaminari_generator.rb
|
193
|
-
- lib/nazrin/pagination_generator/nazrin_generator.rb
|
194
|
-
- lib/nazrin/pagination_generator/will_paginate_generator.rb
|
195
165
|
- lib/nazrin/search_client.rb
|
196
166
|
- lib/nazrin/version.rb
|
197
167
|
- nazrin.gemspec
|
@@ -210,9 +180,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
180
|
version: '0'
|
211
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
182
|
requirements:
|
213
|
-
- - "
|
183
|
+
- - ">"
|
214
184
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
185
|
+
version: 1.3.1
|
216
186
|
requirements: []
|
217
187
|
rubyforge_project:
|
218
188
|
rubygems_version: 2.4.5.1
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Nazrin
|
2
|
-
module PaginationGenerator
|
3
|
-
module KaminariGenerator
|
4
|
-
def self.call(collection, options)
|
5
|
-
begin
|
6
|
-
require 'kaminari'
|
7
|
-
rescue LoadError
|
8
|
-
abort "Missing dependency 'kaminari' for pagination"
|
9
|
-
end
|
10
|
-
Kaminari.paginate_array(collection, total_count: options[:total_count])
|
11
|
-
.page(options[:current_page])
|
12
|
-
.per(options[:per_page]).tap do |paginate_array|
|
13
|
-
paginate_array.max_pages_per(options[:last_page])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Nazrin
|
2
|
-
module PaginationGenerator
|
3
|
-
module WillPaginateGenerator
|
4
|
-
def self.call(collection, options)
|
5
|
-
begin
|
6
|
-
require 'will_paginate/collection'
|
7
|
-
rescue LoadError
|
8
|
-
abort "Missing dependency 'will_paginate' for pagination"
|
9
|
-
end
|
10
|
-
|
11
|
-
WillPaginate::Collection.create(options[:current_page], options[:per_page], options[:total_count]) do |pager|
|
12
|
-
pager.replace collection[pager.offset, pager.per_page].to_a
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|