thinking-sphinx-099 1.3.1 → 1.3.2

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.
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 1
4
4
  :build:
5
5
  :minor: 3
@@ -1,41 +1,8 @@
1
- module Cucumber
2
- module ThinkingSphinx
3
- class ExternalWorld
4
- def initialize(suppress_delta_output = true)
5
- set_flags suppress_delta_output
6
- create_indexes_folder
7
- prepare_and_start_daemon
8
- configure_cleanup
9
- end
10
-
11
- private
12
-
13
- def config
14
- @config ||= ::ThinkingSphinx::Configuration.instance
15
- end
16
-
17
- def set_flags(suppress_delta_output)
18
- ::ThinkingSphinx.deltas_enabled = true
19
- ::ThinkingSphinx.updates_enabled = true
20
- ::ThinkingSphinx.suppress_delta_output = suppress_delta_output
21
- end
22
-
23
- def create_indexes_folder
24
- FileUtils.mkdir_p config.searchd_file_path
25
- end
26
-
27
- def prepare_and_start_daemon
28
- config.build
29
- config.controller.index
30
- config.controller.start
31
- end
32
-
33
- def configure_cleanup
34
- Kernel.at_exit do
35
- config.controller.stop
36
- sleep(0.5) # Ensure Sphinx has shut down completely
37
- end
38
- end
39
- end
1
+ require 'thinking_sphinx/test'
2
+
3
+ class Cucumber::ThinkingSphinx::ExternalWorld
4
+ def initialize(suppress_delta_output = true)
5
+ ::ThinkingSphinx::Test.init
6
+ ::ThinkingSphinx::Test.start_with_autostop
40
7
  end
41
8
  end
@@ -0,0 +1,52 @@
1
+ class ThinkingSphinx::Test
2
+ def self.init(suppress_delta_output = true)
3
+ set_flags suppress_delta_output
4
+ create_indexes_folder
5
+ end
6
+
7
+ def self.start
8
+ config.build
9
+ config.controller.index
10
+ config.controller.start
11
+ end
12
+
13
+ def self.start_with_autostop
14
+ autostop
15
+ start
16
+ end
17
+
18
+ def self.stop
19
+ config.controller.stop
20
+ sleep(0.5) # Ensure Sphinx has shut down completely
21
+ end
22
+
23
+ def self.autostop
24
+ Kernel.at_exit do
25
+ ThinkingSphinx::Test.stop
26
+ end
27
+ end
28
+
29
+ def self.run(&block)
30
+ start
31
+ yield
32
+ stop
33
+ end
34
+
35
+ def self.config
36
+ @config ||= ::ThinkingSphinx::Configuration.instance
37
+ end
38
+
39
+ def self.index(*indexes)
40
+ config.controller.index *indexes
41
+ end
42
+
43
+ def self.set_flags(suppress_delta_output)
44
+ ::ThinkingSphinx.deltas_enabled = true
45
+ ::ThinkingSphinx.updates_enabled = true
46
+ ::ThinkingSphinx.suppress_delta_output = suppress_delta_output
47
+ end
48
+
49
+ def self.create_indexes_folder
50
+ FileUtils.mkdir_p config.searchd_file_path
51
+ end
52
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinking-sphinx-099
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-04 00:00:00 +11:00
12
+ date: 2009-11-05 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -70,6 +70,7 @@ files:
70
70
  - lib/thinking_sphinx/source/internal_properties.rb
71
71
  - lib/thinking_sphinx/source/sql.rb
72
72
  - lib/thinking_sphinx/tasks.rb
73
+ - lib/thinking_sphinx/test.rb
73
74
  - rails/init.rb
74
75
  - tasks/distribution.rb
75
76
  - tasks/rails.rake