indices 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +245 -0
- data/Rakefile +19 -0
- data/lib/generators/indices/index_generator.rb +15 -0
- data/lib/generators/indices/install_generator.rb +15 -0
- data/lib/generators/indices/templates/index.rb +12 -0
- data/lib/generators/indices/templates/initializer.rb +10 -0
- data/lib/indices.rb +102 -0
- data/lib/indices/collection.rb +195 -0
- data/lib/indices/concern.rb +23 -0
- data/lib/indices/configuration.rb +39 -0
- data/lib/indices/dsl/api.rb +85 -0
- data/lib/indices/dsl/mappings.rb +14 -0
- data/lib/indices/dsl/search.rb +25 -0
- data/lib/indices/dsl/serializer.rb +17 -0
- data/lib/indices/index.rb +149 -0
- data/lib/indices/pagination.rb +33 -0
- data/lib/indices/proxy.rb +17 -0
- data/lib/indices/railtie.rb +15 -0
- data/lib/indices/version.rb +5 -0
- data/lib/tasks/indices.rake +11 -0
- data/test/dsl_test.rb +92 -0
- data/test/dummy/Rakefile +5 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/indices/products_index.rb +51 -0
- data/test/dummy/app/indices/shops_index.rb +28 -0
- data/test/dummy/app/models/product.rb +5 -0
- data/test/dummy/app/models/shop.rb +5 -0
- data/test/dummy/app/views/layouts/application.html.erb +12 -0
- data/test/dummy/bin/bundle +4 -0
- data/test/dummy/bin/rails +5 -0
- data/test/dummy/bin/rake +5 -0
- data/test/dummy/bin/setup +30 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +25 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +7 -0
- data/test/dummy/config/database.yml.travis +3 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/indices.rb +67 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/migrate/20161104164148_create_products.rb +12 -0
- data/test/dummy/db/migrate/20161104182219_create_shops.rb +7 -0
- data/test/dummy/db/schema.rb +36 -0
- data/test/dummy/log/development.log +156 -0
- data/test/dummy/log/test.log +10249 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/generators_test.rb +25 -0
- data/test/indices_test.rb +46 -0
- data/test/record_test.rb +25 -0
- data/test/search_test.rb +164 -0
- data/test/tasks_test.rb +25 -0
- data/test/test_helper.rb +14 -0
- metadata +230 -0
data/test/tasks_test.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TasksTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
setup do
|
6
|
+
Dummy::Application.load_tasks
|
7
|
+
end
|
8
|
+
|
9
|
+
teardown do
|
10
|
+
Indices.destroy
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'build' do
|
14
|
+
assert_nothing_raised do
|
15
|
+
Rake::Task['indices:build'].invoke
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
test 'rebuild' do
|
20
|
+
assert_nothing_raised do
|
21
|
+
Rake::Task['indices:rebuild'].invoke
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
|
5
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path('../../test/dummy/db/migrate', __FILE__)]
|
6
|
+
require 'rails/test_help'
|
7
|
+
require 'mocha/mini_test'
|
8
|
+
|
9
|
+
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
10
|
+
# to be shown.
|
11
|
+
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
12
|
+
|
13
|
+
# Load support files
|
14
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
ADDED
@@ -0,0 +1,230 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: indices
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- mmontossi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.3.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 4.2.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 4.3.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: elasticsearch
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 2.0.0
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.0.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: pg
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.18'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.18'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: mocha
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.1'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.1'
|
75
|
+
description: Model search indices with elasticsearch in rails.
|
76
|
+
email:
|
77
|
+
- mmontossi@gmail.com
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- MIT-LICENSE
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- lib/generators/indices/index_generator.rb
|
86
|
+
- lib/generators/indices/install_generator.rb
|
87
|
+
- lib/generators/indices/templates/index.rb
|
88
|
+
- lib/generators/indices/templates/initializer.rb
|
89
|
+
- lib/indices.rb
|
90
|
+
- lib/indices/collection.rb
|
91
|
+
- lib/indices/concern.rb
|
92
|
+
- lib/indices/configuration.rb
|
93
|
+
- lib/indices/dsl/api.rb
|
94
|
+
- lib/indices/dsl/mappings.rb
|
95
|
+
- lib/indices/dsl/search.rb
|
96
|
+
- lib/indices/dsl/serializer.rb
|
97
|
+
- lib/indices/index.rb
|
98
|
+
- lib/indices/pagination.rb
|
99
|
+
- lib/indices/proxy.rb
|
100
|
+
- lib/indices/railtie.rb
|
101
|
+
- lib/indices/version.rb
|
102
|
+
- lib/tasks/indices.rake
|
103
|
+
- test/dsl_test.rb
|
104
|
+
- test/dummy/Rakefile
|
105
|
+
- test/dummy/app/assets/javascripts/application.js
|
106
|
+
- test/dummy/app/assets/stylesheets/application.css
|
107
|
+
- test/dummy/app/controllers/application_controller.rb
|
108
|
+
- test/dummy/app/helpers/application_helper.rb
|
109
|
+
- test/dummy/app/indices/products_index.rb
|
110
|
+
- test/dummy/app/indices/shops_index.rb
|
111
|
+
- test/dummy/app/models/product.rb
|
112
|
+
- test/dummy/app/models/shop.rb
|
113
|
+
- test/dummy/app/views/layouts/application.html.erb
|
114
|
+
- test/dummy/bin/bundle
|
115
|
+
- test/dummy/bin/rails
|
116
|
+
- test/dummy/bin/rake
|
117
|
+
- test/dummy/bin/setup
|
118
|
+
- test/dummy/config.ru
|
119
|
+
- test/dummy/config/application.rb
|
120
|
+
- test/dummy/config/boot.rb
|
121
|
+
- test/dummy/config/database.yml
|
122
|
+
- test/dummy/config/database.yml.travis
|
123
|
+
- test/dummy/config/environment.rb
|
124
|
+
- test/dummy/config/environments/development.rb
|
125
|
+
- test/dummy/config/environments/production.rb
|
126
|
+
- test/dummy/config/environments/test.rb
|
127
|
+
- test/dummy/config/initializers/assets.rb
|
128
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
129
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
130
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
131
|
+
- test/dummy/config/initializers/indices.rb
|
132
|
+
- test/dummy/config/initializers/inflections.rb
|
133
|
+
- test/dummy/config/initializers/mime_types.rb
|
134
|
+
- test/dummy/config/initializers/session_store.rb
|
135
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
136
|
+
- test/dummy/config/locales/en.yml
|
137
|
+
- test/dummy/config/routes.rb
|
138
|
+
- test/dummy/config/secrets.yml
|
139
|
+
- test/dummy/db/migrate/20161104164148_create_products.rb
|
140
|
+
- test/dummy/db/migrate/20161104182219_create_shops.rb
|
141
|
+
- test/dummy/db/schema.rb
|
142
|
+
- test/dummy/log/development.log
|
143
|
+
- test/dummy/log/test.log
|
144
|
+
- test/dummy/public/404.html
|
145
|
+
- test/dummy/public/422.html
|
146
|
+
- test/dummy/public/500.html
|
147
|
+
- test/dummy/public/favicon.ico
|
148
|
+
- test/generators_test.rb
|
149
|
+
- test/indices_test.rb
|
150
|
+
- test/record_test.rb
|
151
|
+
- test/search_test.rb
|
152
|
+
- test/tasks_test.rb
|
153
|
+
- test/test_helper.rb
|
154
|
+
homepage: https://github.com/mmontossi/indices
|
155
|
+
licenses:
|
156
|
+
- MIT
|
157
|
+
metadata: {}
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options: []
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 2.0.0
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
requirements:
|
173
|
+
- Elasticsearch
|
174
|
+
rubyforge_project:
|
175
|
+
rubygems_version: 2.5.1
|
176
|
+
signing_key:
|
177
|
+
specification_version: 4
|
178
|
+
summary: Indices for rails.
|
179
|
+
test_files:
|
180
|
+
- test/dsl_test.rb
|
181
|
+
- test/dummy/app/assets/javascripts/application.js
|
182
|
+
- test/dummy/app/assets/stylesheets/application.css
|
183
|
+
- test/dummy/app/controllers/application_controller.rb
|
184
|
+
- test/dummy/app/helpers/application_helper.rb
|
185
|
+
- test/dummy/app/indices/products_index.rb
|
186
|
+
- test/dummy/app/indices/shops_index.rb
|
187
|
+
- test/dummy/app/models/product.rb
|
188
|
+
- test/dummy/app/models/shop.rb
|
189
|
+
- test/dummy/app/views/layouts/application.html.erb
|
190
|
+
- test/dummy/bin/bundle
|
191
|
+
- test/dummy/bin/rails
|
192
|
+
- test/dummy/bin/rake
|
193
|
+
- test/dummy/bin/setup
|
194
|
+
- test/dummy/config/application.rb
|
195
|
+
- test/dummy/config/boot.rb
|
196
|
+
- test/dummy/config/database.yml
|
197
|
+
- test/dummy/config/database.yml.travis
|
198
|
+
- test/dummy/config/environment.rb
|
199
|
+
- test/dummy/config/environments/development.rb
|
200
|
+
- test/dummy/config/environments/production.rb
|
201
|
+
- test/dummy/config/environments/test.rb
|
202
|
+
- test/dummy/config/initializers/assets.rb
|
203
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
204
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
205
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
206
|
+
- test/dummy/config/initializers/indices.rb
|
207
|
+
- test/dummy/config/initializers/inflections.rb
|
208
|
+
- test/dummy/config/initializers/mime_types.rb
|
209
|
+
- test/dummy/config/initializers/session_store.rb
|
210
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
211
|
+
- test/dummy/config/locales/en.yml
|
212
|
+
- test/dummy/config/routes.rb
|
213
|
+
- test/dummy/config/secrets.yml
|
214
|
+
- test/dummy/config.ru
|
215
|
+
- test/dummy/db/migrate/20161104164148_create_products.rb
|
216
|
+
- test/dummy/db/migrate/20161104182219_create_shops.rb
|
217
|
+
- test/dummy/db/schema.rb
|
218
|
+
- test/dummy/log/development.log
|
219
|
+
- test/dummy/log/test.log
|
220
|
+
- test/dummy/public/404.html
|
221
|
+
- test/dummy/public/422.html
|
222
|
+
- test/dummy/public/500.html
|
223
|
+
- test/dummy/public/favicon.ico
|
224
|
+
- test/dummy/Rakefile
|
225
|
+
- test/generators_test.rb
|
226
|
+
- test/indices_test.rb
|
227
|
+
- test/record_test.rb
|
228
|
+
- test/search_test.rb
|
229
|
+
- test/tasks_test.rb
|
230
|
+
- test/test_helper.rb
|