flying-sphinx 0.1.4 → 0.2.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.
- data/VERSION +1 -1
- data/lib/flying_sphinx.rb +5 -1
- data/lib/flying_sphinx/rails.rb +8 -0
- data/lib/flying_sphinx/railtie.rb +7 -0
- metadata +6 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/flying_sphinx.rb
CHANGED
@@ -11,4 +11,8 @@ require 'flying_sphinx/configuration'
|
|
11
11
|
require 'flying_sphinx/index_request'
|
12
12
|
require 'flying_sphinx/tunnel'
|
13
13
|
|
14
|
-
|
14
|
+
if defined?(Rails) && defined?(Rails::Railtie)
|
15
|
+
require 'flying_sphinx/railtie'
|
16
|
+
elsif defined?(Rails)
|
17
|
+
require 'flying_sphinx/rails'
|
18
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'action_controller/dispatcher'
|
2
|
+
|
3
|
+
ActionController::Dispatcher.to_prepare :flying_sphinx do
|
4
|
+
config = FlyingSphinx::Configuration.new
|
5
|
+
|
6
|
+
ThinkingSphinx::Configuration.instance.address = config.host
|
7
|
+
ThinkingSphinx::Configuration.instance.port = config.port
|
8
|
+
end
|
@@ -2,4 +2,11 @@ class FlyingSphinx::Railtie < Rails::Railtie
|
|
2
2
|
rake_tasks do
|
3
3
|
load File.expand_path('../tasks.rb', __FILE__)
|
4
4
|
end
|
5
|
+
|
6
|
+
initializer "flying_sphinx.set_sphinx_host_and_port" do |app|
|
7
|
+
config = FlyingSphinx::Configuration.new
|
8
|
+
|
9
|
+
ThinkingSphinx::Configuration.instance.address = config.host
|
10
|
+
ThinkingSphinx::Configuration.instance.port = config.port
|
11
|
+
end
|
5
12
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flying-sphinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pat Allan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-21 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/flying_sphinx/api.rb
|
179
179
|
- lib/flying_sphinx/configuration.rb
|
180
180
|
- lib/flying_sphinx/index_request.rb
|
181
|
+
- lib/flying_sphinx/rails.rb
|
181
182
|
- lib/flying_sphinx/railtie.rb
|
182
183
|
- lib/flying_sphinx/tasks.rb
|
183
184
|
- lib/flying_sphinx/tunnel.rb
|