ts-datetime-delta 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,9 @@ require 'cucumber/thinking_sphinx/internal_world'
11
11
  world = Cucumber::ThinkingSphinx::InternalWorld.new
12
12
  world.configure_database
13
13
 
14
- require 'thinking_sphinx'
14
+ SphinxVersion = ENV['VERSION'] || '0.9.8'
15
+
16
+ require "thinking_sphinx/#{SphinxVersion}"
15
17
  require 'thinking_sphinx/deltas/datetime_delta'
16
18
 
17
19
  world.setup
@@ -62,8 +62,11 @@ class ThinkingSphinx::Deltas::DatetimeDelta < ThinkingSphinx::Deltas::DefaultDel
62
62
  config = ThinkingSphinx::Configuration.instance
63
63
  rotate = ThinkingSphinx.sphinx_running? ? " --rotate" : ""
64
64
 
65
- output = `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} #{delta_index_name model}`
66
- output += `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} --merge #{core_index_name model} #{delta_index_name model} --merge-dst-range sphinx_deleted 0 0`
65
+ output = `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} #{model.delta_index_names.join(' ')}`
66
+
67
+ model.sphinx_indexes.select(&:delta?).each do |index|
68
+ output += `#{config.bin_path}#{config.indexer_binary_name} --config #{config.config_file}#{rotate} --merge #{index.core_name} #{index.delta_name} --merge-dst-range sphinx_deleted 0 0`
69
+ end
67
70
  puts output unless ThinkingSphinx.suppress_delta_output?
68
71
 
69
72
  true
@@ -4,8 +4,10 @@ require 'rubygems'
4
4
  require 'spec'
5
5
  require 'spec/autorun'
6
6
 
7
- require 'thinking_sphinx'
8
- require 'thinking_sphinx/deltas/delayed_delta'
7
+ SphinxVersion = ENV['VERSION'] || '0.9.8'
8
+
9
+ require "thinking_sphinx/#{SphinxVersion}"
10
+ require 'thinking_sphinx/deltas/datetime_delta'
9
11
 
10
12
  Spec::Runner.configure do |config|
11
13
  #
@@ -33,9 +33,17 @@ describe ThinkingSphinx::Deltas::DatetimeDelta do
33
33
 
34
34
  describe '#delayed_index' do
35
35
  before :each do
36
- @model = stub('foo')
37
- @model.stub!(:name => 'foo')
38
- @model.stub!(:source_of_sphinx_index => @model)
36
+ @index = stub('index',
37
+ :delta? => true,
38
+ :core_name => 'foo_core',
39
+ :delta_name => 'foo_delta'
40
+ )
41
+ @model = stub('foo',
42
+ :name => 'foo',
43
+ :source_of_sphinx_index => @model,
44
+ :delta_index_names => ['foo_delta'],
45
+ :sphinx_indexes => [@index]
46
+ )
39
47
 
40
48
  ThinkingSphinx.suppress_delta_output = false
41
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts-datetime-delta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-03 00:00:00 +11:00
12
+ date: 2009-11-26 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thinking-sphinx
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.6
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: rspec
17
27
  type: :development