nazrin 1.0.1 → 2.0.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d560f4c38f13496421fa20bb64e450dbee131d2e
4
- data.tar.gz: b498261e0352df15be55ee57ec6cb5199e2b18bb
3
+ metadata.gz: 9f2aac2c4bb9f2b8c6da46224038f27ff7aa5195
4
+ data.tar.gz: d9c9197a6a2ed068801f20a88ca36642fd385189
5
5
  SHA512:
6
- metadata.gz: 37214c620df676ccd4d0ef3889f66155ecd422d4843a78cbe98a3115eb2cd233da629c22737d777de19bf9a71d2b869609a3d0b9b2060e26afd64247b6be3e3f
7
- data.tar.gz: 026985a90a6bae6ed4f913ebe6f9a00e29694e0b915e53158c1a76e266b499c2f4fe136fc6c36a475bc0b87b0d96c3580dee4713c10401554decfa4f53c92a5c
6
+ metadata.gz: 466c7d325bbbaf7ae37fdb10e8b04c5ca9a45301b0e1e2b4cc3b0b0157823ceb071259863a756896acbb24ea21b76c94523fa2d3c880b7a26c47c56d5fb388e0
7
+ data.tar.gz: 826d246e6fe16414ee267caea7fa539ec8165696f9965b70b5a3c6fd510c874c02c1e440bf7e467bd475ba6792af2fb0813c13f495811b31583e7fe5410ad028
@@ -0,0 +1,5 @@
1
+ ## 2.0.0
2
+
3
+ * Extracted Kaminari support to nazrin-kaminari gem
4
+
5
+ * Extracted will_paginate support to nazrin-will_paginate gem
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
- *Nazrin has the ability of the extent which find what you're looking for...*
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.
@@ -5,6 +5,4 @@ Nazrin.configure do |config|
5
5
  config.region = ''
6
6
  config.access_key_id = ''
7
7
  config.secret_access_key = ''
8
- # currently support 'kaminari', 'will_paginate' or 'nazrin'
9
- config.pagination = 'kaminari'
10
8
  end
@@ -1,6 +1,3 @@
1
- module Nazrin
2
- end
3
-
4
1
  require 'nazrin/active_record/searchable'
5
2
  require 'nazrin/active_record/data_accessor'
6
3
  require 'nazrin/config'
@@ -17,6 +17,5 @@ module Nazrin
17
17
  config_accessor :region
18
18
  config_accessor :access_key_id
19
19
  config_accessor :secret_access_key
20
- config_accessor :pagination
21
20
  end
22
21
  end
@@ -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
- abort "#{Nazrin.config.pagination} is not supported gem of pagination" unless SUPPORTED_PAGINATION_GEMS.include?(Nazrin.config.pagination.to_s)
8
-
9
- retreive_generator_module.call(collection, options)
10
- end
11
-
12
- private
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
@@ -1,3 +1,3 @@
1
1
  module Nazrin
2
- VERSION = '1.0.1'
2
+ VERSION = '2.0.0.rc1'
3
3
  end
@@ -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: 1.0.1
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: 2016-06-16 00:00:00.000000000 Z
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: '0'
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,13 +0,0 @@
1
- module Nazrin
2
- module PaginationGenerator
3
- module NazrinGenerator
4
- def self.call(collection, options)
5
- Nazrin::PaginatedArray.new(
6
- collection,
7
- options[:current_page],
8
- options[:per_page],
9
- options[:total_count])
10
- end
11
- end
12
- end
13
- 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