indexes 0.0.1 → 4.0.0.0
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/README.md +78 -58
- data/lib/generators/{indexes → index}/index_generator.rb +1 -1
- data/lib/generators/{indexes → index}/templates/index.rb +1 -1
- data/lib/generators/indexes/{install_generator.rb → install/install_generator.rb} +1 -1
- data/lib/generators/indexes/{templates → install/templates}/initializer.rb +0 -0
- data/lib/indexes.rb +12 -29
- data/lib/indexes/collection.rb +42 -51
- data/lib/indexes/configuration.rb +1 -1
- data/lib/indexes/definitions.rb +25 -0
- data/lib/indexes/dsl/{serializer.rb → serialization.rb} +3 -3
- data/lib/indexes/index.rb +3 -3
- data/lib/indexes/proxy.rb +2 -2
- data/lib/indexes/railtie.rb +3 -3
- data/lib/indexes/version.rb +1 -1
- data/test/dummy/app/indexes/products_index.rb +2 -2
- data/test/dummy/app/indexes/shops_index.rb +2 -2
- data/test/dummy/config/initializers/indexes.rb +1 -1
- data/test/dummy/log/test.log +2087 -0
- data/test/{generators_test.rb → generator_test.rb} +5 -5
- data/test/{indexes_test.rb → index_test.rb} +2 -2
- data/test/search_test.rb +3 -3
- data/test/{tasks_test.rb → task_test.rb} +1 -1
- metadata +14 -13
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'rails/generators'
|
3
|
-
require 'generators/indexes/install_generator'
|
4
|
-
require 'generators/
|
3
|
+
require 'generators/indexes/install/install_generator'
|
4
|
+
require 'generators/index/index_generator'
|
5
5
|
|
6
|
-
class
|
7
|
-
destination
|
6
|
+
class GeneratorTest < Rails::Generators::TestCase
|
7
|
+
destination Rails.root.join('tmp')
|
8
8
|
|
9
9
|
teardown do
|
10
|
-
FileUtils.rm_rf
|
10
|
+
FileUtils.rm_rf destination_root
|
11
11
|
end
|
12
12
|
|
13
13
|
test 'install' do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class IndexTest < ActiveSupport::TestCase
|
4
4
|
|
5
5
|
setup do
|
6
6
|
Indexes.build
|
@@ -15,7 +15,7 @@ class IndexesTest < ActiveSupport::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
test 'find' do
|
18
|
-
assert Indexes.find(:products)
|
18
|
+
assert Indexes.definitions.find(:products)
|
19
19
|
end
|
20
20
|
|
21
21
|
test 'exist' do
|
data/test/search_test.rb
CHANGED
@@ -47,8 +47,8 @@ class SearchTest < ActiveSupport::TestCase
|
|
47
47
|
Shop.create id: 4
|
48
48
|
sleep 2
|
49
49
|
|
50
|
-
assert_equal [4, 3], Shop.search(
|
51
|
-
assert_equal [2, 1], Shop.search(
|
50
|
+
assert_equal [4, 3], Shop.search.with(4).page(1, length: 2).map(&:id)
|
51
|
+
assert_equal [2, 1], Shop.search.without(3).map(&:id)
|
52
52
|
end
|
53
53
|
|
54
54
|
test 'includes' do
|
@@ -57,7 +57,7 @@ class SearchTest < ActiveSupport::TestCase
|
|
57
57
|
product.run_callbacks :commit
|
58
58
|
sleep 2
|
59
59
|
|
60
|
-
product = Product.search(
|
60
|
+
product = Product.search.includes(:shop).first
|
61
61
|
Shop.expects(:connection).never
|
62
62
|
assert_equal shop, product.shop
|
63
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indexes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 4.0.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmontossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -82,18 +82,19 @@ files:
|
|
82
82
|
- MIT-LICENSE
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
|
-
- lib/generators/
|
86
|
-
- lib/generators/
|
87
|
-
- lib/generators/indexes/
|
88
|
-
- lib/generators/indexes/templates/initializer.rb
|
85
|
+
- lib/generators/index/index_generator.rb
|
86
|
+
- lib/generators/index/templates/index.rb
|
87
|
+
- lib/generators/indexes/install/install_generator.rb
|
88
|
+
- lib/generators/indexes/install/templates/initializer.rb
|
89
89
|
- lib/indexes.rb
|
90
90
|
- lib/indexes/collection.rb
|
91
91
|
- lib/indexes/concern.rb
|
92
92
|
- lib/indexes/configuration.rb
|
93
|
+
- lib/indexes/definitions.rb
|
93
94
|
- lib/indexes/dsl/api.rb
|
94
95
|
- lib/indexes/dsl/mappings.rb
|
95
96
|
- lib/indexes/dsl/search.rb
|
96
|
-
- lib/indexes/dsl/
|
97
|
+
- lib/indexes/dsl/serialization.rb
|
97
98
|
- lib/indexes/index.rb
|
98
99
|
- lib/indexes/pagination.rb
|
99
100
|
- lib/indexes/proxy.rb
|
@@ -145,11 +146,11 @@ files:
|
|
145
146
|
- test/dummy/public/422.html
|
146
147
|
- test/dummy/public/500.html
|
147
148
|
- test/dummy/public/favicon.ico
|
148
|
-
- test/
|
149
|
-
- test/
|
149
|
+
- test/generator_test.rb
|
150
|
+
- test/index_test.rb
|
150
151
|
- test/record_test.rb
|
151
152
|
- test/search_test.rb
|
152
|
-
- test/
|
153
|
+
- test/task_test.rb
|
153
154
|
- test/test_helper.rb
|
154
155
|
homepage: https://github.com/mmontossi/indexes
|
155
156
|
licenses:
|
@@ -222,9 +223,9 @@ test_files:
|
|
222
223
|
- test/dummy/public/500.html
|
223
224
|
- test/dummy/public/favicon.ico
|
224
225
|
- test/dummy/Rakefile
|
225
|
-
- test/
|
226
|
-
- test/
|
226
|
+
- test/generator_test.rb
|
227
|
+
- test/index_test.rb
|
227
228
|
- test/record_test.rb
|
228
229
|
- test/search_test.rb
|
229
|
-
- test/
|
230
|
+
- test/task_test.rb
|
230
231
|
- test/test_helper.rb
|