gojee-sunspot-rails 2.0.2 → 2.0.3

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.
Files changed (67) hide show
  1. metadata +5 -97
  2. data/.gitignore +0 -7
  3. data/.rspec +0 -1
  4. data/History.txt +0 -74
  5. data/LICENSE +0 -18
  6. data/MIT-LICENSE +0 -20
  7. data/README.rdoc +0 -265
  8. data/Rakefile +0 -17
  9. data/TODO +0 -8
  10. data/dev_tasks/rdoc.rake +0 -24
  11. data/dev_tasks/release.rake +0 -4
  12. data/dev_tasks/spec.rake +0 -107
  13. data/dev_tasks/todo.rake +0 -4
  14. data/gemfiles/rails-2.3.14 +0 -12
  15. data/gemfiles/rails-3.0.11 +0 -12
  16. data/gemfiles/rails-3.1.3 +0 -12
  17. data/gemfiles/rails-3.2.1 +0 -12
  18. data/generators/sunspot/sunspot_generator.rb +0 -9
  19. data/generators/sunspot/templates/sunspot.yml +0 -20
  20. data/install.rb +0 -1
  21. data/lib/generators/sunspot_rails/install/install_generator.rb +0 -13
  22. data/lib/generators/sunspot_rails/install/templates/config/sunspot.yml +0 -19
  23. data/lib/generators/sunspot_rails.rb +0 -9
  24. data/lib/sunspot/rails/adapters.rb +0 -83
  25. data/lib/sunspot/rails/configuration.rb +0 -376
  26. data/lib/sunspot/rails/init.rb +0 -5
  27. data/lib/sunspot/rails/log_subscriber.rb +0 -33
  28. data/lib/sunspot/rails/railtie.rb +0 -36
  29. data/lib/sunspot/rails/railties/controller_runtime.rb +0 -36
  30. data/lib/sunspot/rails/request_lifecycle.rb +0 -36
  31. data/lib/sunspot/rails/searchable.rb +0 -491
  32. data/lib/sunspot/rails/server.rb +0 -114
  33. data/lib/sunspot/rails/solr_instrumentation.rb +0 -19
  34. data/lib/sunspot/rails/solr_logging.rb +0 -62
  35. data/lib/sunspot/rails/spec_helper.rb +0 -26
  36. data/lib/sunspot/rails/stub_session_proxy.rb +0 -142
  37. data/lib/sunspot/rails/tasks.rb +0 -84
  38. data/lib/sunspot/rails.rb +0 -69
  39. data/lib/sunspot_rails.rb +0 -12
  40. data/spec/configuration_spec.rb +0 -209
  41. data/spec/model_lifecycle_spec.rb +0 -63
  42. data/spec/model_spec.rb +0 -601
  43. data/spec/rails_template/app/controllers/application_controller.rb +0 -10
  44. data/spec/rails_template/app/controllers/posts_controller.rb +0 -6
  45. data/spec/rails_template/app/models/author.rb +0 -8
  46. data/spec/rails_template/app/models/blog.rb +0 -12
  47. data/spec/rails_template/app/models/location.rb +0 -2
  48. data/spec/rails_template/app/models/photo_post.rb +0 -2
  49. data/spec/rails_template/app/models/post.rb +0 -11
  50. data/spec/rails_template/app/models/post_with_auto.rb +0 -10
  51. data/spec/rails_template/app/models/post_with_default_scope.rb +0 -11
  52. data/spec/rails_template/config/boot.rb +0 -127
  53. data/spec/rails_template/config/preinitializer.rb +0 -22
  54. data/spec/rails_template/config/routes.rb +0 -9
  55. data/spec/rails_template/config/sunspot.yml +0 -24
  56. data/spec/rails_template/db/schema.rb +0 -27
  57. data/spec/request_lifecycle_spec.rb +0 -61
  58. data/spec/schema.rb +0 -27
  59. data/spec/searchable_spec.rb +0 -12
  60. data/spec/server_spec.rb +0 -33
  61. data/spec/session_spec.rb +0 -57
  62. data/spec/shared_examples/indexed_after_save.rb +0 -8
  63. data/spec/shared_examples/not_indexed_after_save.rb +0 -8
  64. data/spec/spec_helper.rb +0 -48
  65. data/spec/stub_session_proxy_spec.rb +0 -122
  66. data/sunspot_rails.gemspec +0 -43
  67. data/tmp/.gitkeep +0 -0
data/dev_tasks/todo.rake DELETED
@@ -1,4 +0,0 @@
1
- desc 'Show all TODO and related tags'
2
- task :todo do
3
- FileList['lib/**/*.rb'].egrep(/#.*(TODO|FIXME|XXX)/)
4
- end
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'rails', '2.3.14'
4
- gem 'sqlite3-ruby', '~> 1.3.1'
5
-
6
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
7
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
8
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
9
-
10
- group :test do
11
- gem 'rspec-rails', '~> 1.3.4'
12
- end
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'rails', '3.0.11'
4
- gem 'sqlite3-ruby', '~> 1.3.1'
5
-
6
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
7
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
8
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
9
-
10
- group :test do
11
- gem 'rspec-rails', '~> 2.8.1'
12
- end
data/gemfiles/rails-3.1.3 DELETED
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'rails', '3.1.3'
4
- gem 'sqlite3-ruby', '~> 1.3.1'
5
-
6
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
7
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
8
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
9
-
10
- group :test do
11
- gem 'rspec-rails', '~> 2.8.1'
12
- end
data/gemfiles/rails-3.2.1 DELETED
@@ -1,12 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'rails', '3.2.1'
4
- gem 'sqlite3-ruby', '~> 1.3.1'
5
-
6
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
7
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
8
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
9
-
10
- group :test do
11
- gem 'rspec-rails', '~> 2.8.1'
12
- end
@@ -1,9 +0,0 @@
1
- class SunspotGenerator < Rails::Generator::Base
2
-
3
- def manifest
4
- record do |m|
5
- m.template 'sunspot.yml', 'config/sunspot.yml'
6
- end
7
- end
8
-
9
- end
@@ -1,20 +0,0 @@
1
- production:
2
- solr:
3
- hostname: localhost
4
- port: 8983
5
- log_level: WARNING
6
- # read_timeout: 2
7
- # open_timeout: 0.5
8
-
9
- development:
10
- solr:
11
- hostname: localhost
12
- port: 8982
13
- log_level: INFO
14
-
15
- test:
16
- solr:
17
- hostname: localhost
18
- port: 8981
19
- log_level: WARNING
20
-
data/install.rb DELETED
@@ -1 +0,0 @@
1
- # Install hook code here
@@ -1,13 +0,0 @@
1
- module SunspotRails
2
- module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- def self.source_root
5
- @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
6
- end
7
- def copy_config_file
8
- template 'config/sunspot.yml'
9
- end
10
- end
11
- end
12
- end
13
-
@@ -1,19 +0,0 @@
1
- production:
2
- solr:
3
- hostname: localhost
4
- port: 8983
5
- log_level: WARNING
6
- # read_timeout: 2
7
- # open_timeout: 0.5
8
-
9
- development:
10
- solr:
11
- hostname: localhost
12
- port: 8982
13
- log_level: INFO
14
-
15
- test:
16
- solr:
17
- hostname: localhost
18
- port: 8981
19
- log_level: WARNING
@@ -1,9 +0,0 @@
1
- module SunspotRails
2
- module Generators
3
- class Base < Rails::Generators::NamedBase
4
- def self.source_root
5
- @_sunspot_rails_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'sunspot_rails', generator_name, 'templates'))
6
- end
7
- end
8
- end
9
- end
@@ -1,83 +0,0 @@
1
- module Sunspot #:nodoc:
2
- module Rails #:nodoc:
3
- #
4
- # This module provides Sunspot Adapter implementations for ActiveRecord
5
- # models.
6
- #
7
- module Adapters
8
- class ActiveRecordInstanceAdapter < Sunspot::Adapters::InstanceAdapter
9
- #
10
- # Return the primary key for the adapted instance
11
- #
12
- # ==== Returns
13
- #
14
- # Integer:: Database ID of model
15
- #
16
- def id
17
- @instance.id
18
- end
19
- end
20
-
21
- class ActiveRecordDataAccessor < Sunspot::Adapters::DataAccessor
22
- # options for the find
23
- attr_accessor :include, :select
24
-
25
- #
26
- # Set the fields to select from the database. This will be passed
27
- # to ActiveRecord.
28
- #
29
- # ==== Parameters
30
- #
31
- # value<Mixed>:: String of comma-separated columns or array of columns
32
- #
33
- def select=(value)
34
- value = value.join(', ') if value.respond_to?(:join)
35
- @select = value
36
- end
37
-
38
- #
39
- # Get one ActiveRecord instance out of the database by ID
40
- #
41
- # ==== Parameters
42
- #
43
- # id<String>:: Database ID of model to retreive
44
- #
45
- # ==== Returns
46
- #
47
- # ActiveRecord::Base:: ActiveRecord model
48
- #
49
- def load(id)
50
- @clazz.first(options_for_find.merge(
51
- :conditions => { @clazz.primary_key => id}
52
- ))
53
- end
54
-
55
- #
56
- # Get a collection of ActiveRecord instances out of the database by ID
57
- #
58
- # ==== Parameters
59
- #
60
- # ids<Array>:: Database IDs of models to retrieve
61
- #
62
- # ==== Returns
63
- #
64
- # Array:: Collection of ActiveRecord models
65
- #
66
- def load_all(ids)
67
- @clazz.all(options_for_find.merge(
68
- :conditions => { @clazz.primary_key => ids.map { |id| id }}
69
- ))
70
- end
71
-
72
- private
73
-
74
- def options_for_find
75
- options = {}
76
- options[:include] = @include unless @include.blank?
77
- options[:select] = @select unless @select.blank?
78
- options
79
- end
80
- end
81
- end
82
- end
83
- end
@@ -1,376 +0,0 @@
1
- require 'erb'
2
-
3
- module Sunspot #:nodoc:
4
- module Rails #:nodoc:
5
- #
6
- # Sunspot::Rails is configured via the config/sunspot.yml file, which
7
- # contains properties keyed by environment name. A sample sunspot.yml file
8
- # would look like:
9
- #
10
- # development:
11
- # solr:
12
- # hostname: localhost
13
- # port: 8982
14
- # min_memory: 512M
15
- # max_memory: 1G
16
- # solr_jar: /some/path/solr15/start.jar
17
- # bind_address: 0.0.0.0
18
- # disabled: false
19
- # test:
20
- # solr:
21
- # hostname: localhost
22
- # port: 8983
23
- # log_level: OFF
24
- # open_timeout: 0.5
25
- # read_timeout: 2
26
- # production:
27
- # solr:
28
- # hostname: localhost
29
- # port: 8983
30
- # path: /solr/myindex
31
- # log_level: WARNING
32
- # solr_home: /some/path
33
- # open_timeout: 0.5
34
- # read_timeout: 2
35
- # master_solr:
36
- # hostname: localhost
37
- # port: 8982
38
- # path: /solr
39
- # auto_commit_after_request: true
40
- #
41
- # Sunspot::Rails uses the configuration to set up the Solr connection, as
42
- # well as for starting Solr with the appropriate port using the
43
- # <code>rake sunspot:solr:start</code> task.
44
- #
45
- # If the <code>master_solr</code> configuration is present, Sunspot will use
46
- # the Solr instance specified here for all write operations, and the Solr
47
- # configured under <code>solr</code> for all read operations.
48
- #
49
- class Configuration
50
- attr_writer :user_configuration
51
- #
52
- # The host name at which to connect to Solr. Default 'localhost'.
53
- #
54
- # ==== Returns
55
- #
56
- # String:: host name
57
- #
58
- def hostname
59
- unless defined?(@hostname)
60
- @hostname = solr_url.host if solr_url
61
- @hostname ||= user_configuration_from_key('solr', 'hostname')
62
- @hostname ||= default_hostname
63
- end
64
- @hostname
65
- end
66
-
67
- #
68
- # The port at which to connect to Solr.
69
- # Defaults to 8981 in test, 8982 in development and 8983 in production.
70
- #
71
- # ==== Returns
72
- #
73
- # Integer:: port
74
- #
75
- def port
76
- unless defined?(@port)
77
- @port = solr_url.port if solr_url
78
- @port ||= user_configuration_from_key('solr', 'port')
79
- @port ||= default_port
80
- @port = @port.to_i
81
- end
82
- @port
83
- end
84
-
85
- #
86
- # The url path to the Solr servlet (useful if you are running multicore).
87
- # Default '/solr'.
88
- #
89
- # ==== Returns
90
- #
91
- # String:: path
92
- #
93
- def path
94
- unless defined?(@path)
95
- @path = solr_url.path if solr_url
96
- @path ||= user_configuration_from_key('solr', 'path')
97
- @path ||= default_path
98
- end
99
- @path
100
- end
101
-
102
- #
103
- # The host name at which to connect to the master Solr instance. Defaults
104
- # to the 'hostname' configuration option.
105
- #
106
- # ==== Returns
107
- #
108
- # String:: host name
109
- #
110
- def master_hostname
111
- @master_hostname ||= (user_configuration_from_key('master_solr', 'hostname') || hostname)
112
- end
113
-
114
- #
115
- # The port at which to connect to the master Solr instance. Defaults to
116
- # the 'port' configuration option.
117
- #
118
- # ==== Returns
119
- #
120
- # Integer:: port
121
- #
122
- def master_port
123
- @master_port ||= (user_configuration_from_key('master_solr', 'port') || port).to_i
124
- end
125
-
126
- #
127
- # The path to the master Solr servlet (useful if you are running multicore).
128
- # Defaults to the value of the 'path' configuration option.
129
- #
130
- # ==== Returns
131
- #
132
- # String:: path
133
- #
134
- def master_path
135
- @master_path ||= (user_configuration_from_key('master_solr', 'path') || path)
136
- end
137
-
138
- #
139
- # True if there is a master Solr instance configured, otherwise false.
140
- #
141
- # ==== Returns
142
- #
143
- # Boolean:: bool
144
- #
145
- def has_master?
146
- @has_master = !!user_configuration_from_key('master_solr')
147
- end
148
-
149
- #
150
- # The default log_level that should be passed to solr. You can
151
- # change the individual log_levels in the solr admin interface.
152
- # Default 'INFO'.
153
- #
154
- # ==== Returns
155
- #
156
- # String:: log_level
157
- #
158
- def log_level
159
- @log_level ||= (user_configuration_from_key('solr', 'log_level') || 'INFO')
160
- end
161
-
162
- #
163
- # Should the solr index receive a commit after each http-request.
164
- # Default true
165
- #
166
- # ==== Returns
167
- #
168
- # Boolean: auto_commit_after_request?
169
- #
170
- def auto_commit_after_request?
171
- @auto_commit_after_request ||=
172
- user_configuration_from_key('auto_commit_after_request') != false
173
- end
174
-
175
- #
176
- # As for #auto_commit_after_request? but only for deletes
177
- # Default false
178
- #
179
- # ==== Returns
180
- #
181
- # Boolean: auto_commit_after_delete_request?
182
- #
183
- def auto_commit_after_delete_request?
184
- @auto_commit_after_delete_request ||=
185
- (user_configuration_from_key('auto_commit_after_delete_request') || false)
186
- end
187
-
188
-
189
- #
190
- # The log directory for solr logfiles
191
- #
192
- # ==== Returns
193
- #
194
- # String:: log_dir
195
- #
196
- def log_file
197
- @log_file ||= (user_configuration_from_key('solr', 'log_file') || default_log_file_location )
198
- end
199
-
200
- def data_path
201
- @data_path ||= user_configuration_from_key('solr', 'data_path') || File.join(::Rails.root, 'solr', 'data', ::Rails.env)
202
- end
203
-
204
- def pid_dir
205
- @pid_dir ||= user_configuration_from_key('solr', 'pid_dir') || File.join(::Rails.root, 'solr', 'pids', ::Rails.env)
206
- end
207
-
208
-
209
- #
210
- # The solr home directory. Sunspot::Rails expects this directory
211
- # to contain a config, data and pids directory. See
212
- # Sunspot::Rails::Server.bootstrap for more information.
213
- #
214
- # ==== Returns
215
- #
216
- # String:: solr_home
217
- #
218
- def solr_home
219
- @solr_home ||=
220
- if user_configuration_from_key('solr', 'solr_home')
221
- user_configuration_from_key('solr', 'solr_home')
222
- else
223
- File.join(::Rails.root, 'solr')
224
- end
225
- end
226
-
227
- #
228
- # Solr start jar
229
- #
230
- def solr_jar
231
- @solr_jar ||= user_configuration_from_key('solr', 'solr_jar')
232
- end
233
-
234
- #
235
- # Minimum java heap size for Solr instance
236
- #
237
- def min_memory
238
- @min_memory ||= user_configuration_from_key('solr', 'min_memory')
239
- end
240
-
241
- #
242
- # Maximum java heap size for Solr instance
243
- #
244
- def max_memory
245
- @max_memory ||= user_configuration_from_key('solr', 'max_memory')
246
- end
247
-
248
- #
249
- # Interface on which to run Solr
250
- #
251
- def bind_address
252
- @bind_address ||= user_configuration_from_key('solr', 'bind_address')
253
- end
254
-
255
- def multicore
256
- @multicore ||= !!user_configuration_from_key('solr', 'multicore')
257
- end
258
-
259
- def read_timeout
260
- @read_timeout ||= user_configuration_from_key('solr', 'read_timeout')
261
- end
262
-
263
- def open_timeout
264
- @open_timeout ||= user_configuration_from_key('solr', 'open_timeout')
265
- end
266
-
267
- #
268
- # Whether or not to disable Solr.
269
- # Defaults to false.
270
- #
271
- def disabled?
272
- @disabled ||= (user_configuration_from_key('disabled') || false)
273
- end
274
-
275
- private
276
-
277
- #
278
- # Logging in rails_root/log as solr_<environment>.log as a
279
- # default.
280
- #
281
- # ===== Returns
282
- #
283
- # String:: default_log_file_location
284
- #
285
- def default_log_file_location
286
- File.join(::Rails.root, 'log', "solr_" + ::Rails.env + ".log")
287
- end
288
-
289
- #
290
- # return a specific key from the user configuration in config/sunspot.yml
291
- #
292
- # ==== Returns
293
- #
294
- # Mixed:: requested_key or nil
295
- #
296
- def user_configuration_from_key( *keys )
297
- keys.inject(user_configuration) do |hash, key|
298
- hash[key] if hash
299
- end
300
- end
301
-
302
- #
303
- # Memoized hash of configuration options for the current Rails environment
304
- # as specified in config/sunspot.yml
305
- #
306
- # ==== Returns
307
- #
308
- # Hash:: configuration options for current environment
309
- #
310
- def user_configuration
311
- @user_configuration ||=
312
- begin
313
- path = File.join(::Rails.root, 'config', 'sunspot.yml')
314
- if File.exist?(path)
315
- File.open(path) do |file|
316
- processed = ERB.new(file.read).result
317
- YAML.load(processed)[::Rails.env]
318
- end
319
- else
320
- {}
321
- end
322
- end
323
- end
324
-
325
- protected
326
-
327
- #
328
- # When a specific hostname, port and path aren't provided in the
329
- # sunspot.yml file, look for a key named 'url', then check the
330
- # environment, then fall back to a sensible localhost default.
331
- #
332
-
333
- def solr_url
334
- if ENV['SOLR_URL'] || ENV['WEBSOLR_URL']
335
- URI.parse(ENV['SOLR_URL'] || ENV['WEBSOLR_URL'])
336
- end
337
- end
338
-
339
- def default_hostname
340
- 'localhost'
341
- end
342
-
343
- def default_port
344
- { 'test' => 8981,
345
- 'development' => 8982,
346
- 'production' => 8983
347
- }[::Rails.env] || 8983
348
- end
349
-
350
- def default_path
351
- '/solr'
352
- end
353
-
354
- end
355
-
356
- class ExtendedConfiguration < Sunspot::Rails::Configuration
357
- def initialize( configuration_hash )
358
- @supplied_configuration = configuration_hash
359
- end
360
- protected
361
- def solr_url
362
- unless @cached_solr_url
363
- @cached_solr_url = super
364
- @cached_solr_url.path = @supplied_configuration["path"] if @cached_solr_url # fold in the path constructed from the multicore session
365
- end
366
- @cached_solr_url
367
- end
368
-
369
- private
370
- def user_configuration
371
- @user_configuration ||= @supplied_configuration || super
372
- end
373
-
374
- end
375
- end
376
- end
@@ -1,5 +0,0 @@
1
- Sunspot.session = Sunspot::Rails.build_session
2
- Sunspot::Adapters::InstanceAdapter.register(Sunspot::Rails::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
3
- Sunspot::Adapters::DataAccessor.register(Sunspot::Rails::Adapters::ActiveRecordDataAccessor, ActiveRecord::Base)
4
- ActiveRecord::Base.module_eval { include(Sunspot::Rails::Searchable) }
5
- ActionController::Base.module_eval { include(Sunspot::Rails::RequestLifecycle) }
@@ -1,33 +0,0 @@
1
- module Sunspot
2
- module Rails
3
- class LogSubscriber < ActiveSupport::LogSubscriber
4
- def self.runtime=(value)
5
- Thread.current["sorl_runtime"] = value
6
- end
7
-
8
- def self.runtime
9
- Thread.current["sorl_runtime"] ||= 0
10
- end
11
-
12
- def self.reset_runtime
13
- rt, self.runtime = runtime, 0
14
- rt
15
- end
16
-
17
- def request(event)
18
- self.class.runtime += event.duration
19
- return unless logger.debug?
20
-
21
- name = '%s (%.1fms)' % ["SOLR Request", event.duration]
22
-
23
- # produces: path=/select parameters={fq: ["type:Tag"], q: rossi, fl: * score, qf: tag_name_text, defType: dismax, start: 0, rows: 20}
24
- parameters = event.payload[:parameters].map { |k, v| "#{k}: #{color(v, BOLD, true)}" }.join(', ')
25
- request = "path=#{event.payload[:path]} parameters={#{parameters}}"
26
-
27
- debug " #{color(name, GREEN, true)} [ #{request} ]"
28
- end
29
- end
30
- end
31
- end
32
-
33
- Sunspot::Rails::LogSubscriber.attach_to :rsolr
@@ -1,36 +0,0 @@
1
- module Sunspot
2
- module Rails
3
- class Railtie < ::Rails::Railtie
4
- initializer 'sunspot_rails.init' do
5
- Sunspot.session = Sunspot::Rails.build_session
6
- ActiveSupport.on_load(:active_record) do
7
- Sunspot::Adapters::InstanceAdapter.register(Sunspot::Rails::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
8
- Sunspot::Adapters::DataAccessor.register(Sunspot::Rails::Adapters::ActiveRecordDataAccessor, ActiveRecord::Base)
9
- include(Sunspot::Rails::Searchable)
10
- end
11
- ActiveSupport.on_load(:action_controller) do
12
- include(Sunspot::Rails::RequestLifecycle)
13
- end
14
- require 'sunspot/rails/log_subscriber'
15
- RSolr::Connection.module_eval{ include Sunspot::Rails::SolrInstrumentation }
16
- end
17
-
18
- # Expose database runtime to controller for logging.
19
- initializer "sunspot_rails.log_runtime" do |app|
20
- require "sunspot/rails/railties/controller_runtime"
21
- ActiveSupport.on_load(:action_controller) do
22
- include Sunspot::Rails::Railties::ControllerRuntime
23
- end
24
- end
25
-
26
- rake_tasks do
27
- load 'sunspot/rails/tasks.rb'
28
- end
29
-
30
- generators do
31
- load "generators/sunspot_rails.rb"
32
- end
33
-
34
- end
35
- end
36
- end