thinking-sphinx-099 1.3.0 → 1.3.1

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.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 0
2
+ :patch: 1
3
3
  :major: 1
4
4
  :build:
5
5
  :minor: 3
@@ -0,0 +1,41 @@
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
40
+ end
41
+ end
@@ -18,7 +18,7 @@ module Riddle #:nodoc:
18
18
  Rev = 1785
19
19
  # Release number to mark my own fixes, beyond feature parity with
20
20
  # Sphinx itself.
21
- Release = 6
21
+ Release = 7
22
22
 
23
23
  String = [Major, Minor, Tiny].join('.')
24
24
  GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
@@ -5,8 +5,10 @@ module Riddle
5
5
  @path = path
6
6
  end
7
7
 
8
- def index
9
- cmd = "indexer --config #{@path} --all"
8
+ def index(*indexes)
9
+ indexes << '--all' if indexes.empty?
10
+
11
+ cmd = "indexer --config #{@path} #{indexes.join(' ')}"
10
12
  cmd << " --rotate" if running?
11
13
  `#{cmd}`
12
14
  end
@@ -50,4 +52,4 @@ module Riddle
50
52
  false
51
53
  end
52
54
  end
53
- end
55
+ 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.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -34,6 +34,7 @@ files:
34
34
  - LICENCE
35
35
  - README.textile
36
36
  - VERSION.yml
37
+ - lib/cucumber/thinking_sphinx/external_world.rb
37
38
  - lib/cucumber/thinking_sphinx/internal_world.rb
38
39
  - lib/cucumber/thinking_sphinx/sql_logger.rb
39
40
  - lib/thinking_sphinx.rb