ts-delayed-delta 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: e3c39830b3c7c1b99120c3b5e194166de5aa3170
4
- data.tar.gz: e46cb87b4ea21830a05e97f69555ae66a168e6b2
5
- SHA512:
6
- metadata.gz: 12980e2228f8c7b78e1157f288126cf28100b2c092381f5a79bb01c7c3ae12d7582fef3bd9d77de46885a9d3675f7d85e756250f3949139d762fe4f63883eccf
7
- data.tar.gz: 7674ba0bc569432a17be263d46b3ae88486f1d779a44e12a7a08e67f4528465f11d1bf41045e288371291ec7b6a36b9b9e36d7f38d66ef775406e34e792fa8ed
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 490d0d61f6fc9fa371213d65861da39f5ed4483e
4
+ data.tar.gz: dd8d005064422491c4114792acdc9f276d89a07d
5
+ SHA512:
6
+ metadata.gz: f4676c88ab08ead306b808e62c6bb14ccff97bb8198a8355d1e90fa36089b2213b7c38fce40ec31638f2545961ebe2555d48c9349c6fd7242395649a1e0769bd
7
+ data.tar.gz: 5297c1672a78300db8e1ad2b04fcc3c1b9a6c322c12d08d3619f7988942980e9b4c79b3f913821bb3ddeb2d41d1d817200bfc9a21bd19a39e9f16218cbb7543d
@@ -8,8 +8,9 @@ before_install:
8
8
  before_script:
9
9
  - "mysql -e 'create database thinking_sphinx;' > /dev/null"
10
10
  - "psql -c 'create database thinking_sphinx;' -U postgres > /dev/null"
11
- - "bundle exec rake appraisal:install"
12
11
  env:
13
12
  - SPHINX_BIN=/usr/local/sphinx-2.0.9/bin/ SPHINX_VERSION=2.0.9 DATABASE=mysql2
14
13
  - SPHINX_BIN=/usr/local/sphinx-2.0.9/bin/ SPHINX_VERSION=2.0.9 DATABASE=postgresql
15
- script: "bundle exec rake appraisal spec"
14
+ gemfile:
15
+ - gemfiles/binary.gemfile
16
+ - gemfiles/sphinxql.gemfile
@@ -2,11 +2,11 @@ h1. Delayed Deltas for Thinking Sphinx
2
2
 
3
3
  h2. Installation
4
4
 
5
- This version requires Thinking Sphinx 3.x (currently the edge branch) and Delayed Job 3.x.
5
+ This version works with Thinking Sphinx v1.5.0, v2.1.0 and v3.x.
6
6
 
7
7
  In your @Gemfile@, it'll likely look something like this:
8
8
 
9
- <pre><code>gem 'ts-delayed-delta', '~> 2.0.1'</code></pre>
9
+ <pre><code>gem 'ts-delayed-delta', '~> 2.0.2'</code></pre>
10
10
 
11
11
  Or, if you're referring directly to the git repository:
12
12
 
@@ -25,6 +25,14 @@ In your index definitions, make sure you set the @:delta@ setting to @ThinkingSp
25
25
  # ...
26
26
  end</code></pre>
27
27
 
28
+ For those still on pre-v3 versions of Thinking Sphinx, the delta option goes within the define_index block:
29
+
30
+ <pre><code>define_index do
31
+ # ...
32
+
33
+ set_property :delta => ThinkingSphinx::Deltas::DelayedDelta
34
+ end</code></pre>
35
+
28
36
  If you've never used delta indices before, you'll want to add the boolean column named delta to each model that is using the approach. It probably doesn't hurt to add an index to that column as well.
29
37
 
30
38
  <pre><code>add_column :books, :delta, :boolean, :default => true, :null => false
@@ -34,10 +42,6 @@ And that's pretty much it. Make sure Delayed Job is running, and it'll take care
34
42
 
35
43
  Please keep in mind that you need to run the Delayed Job workers on the same machine as Sphinx, as direct access to Sphinx files (and the Sphinx command-line tools) is essential.
36
44
 
37
- h2. Limitations
38
-
39
- This version of the gem is built for Ruby 1.9 and Rails 3.1 or newer, just like Thinking Sphinx 3.
40
-
41
45
  h2. Contributing
42
46
 
43
47
  Contributions are very much welcome - but keep in mind the following:
@@ -14,11 +14,6 @@ require 'thinking_sphinx'
14
14
  class ThinkingSphinx::Deltas::DelayedDelta <
15
15
  ThinkingSphinx::Deltas::DefaultDelta
16
16
 
17
- CONFIGURATIONS_MAP = {
18
- :priority => :delayed_job_priority,
19
- :queue => :delayed_job_queue
20
- }
21
-
22
17
  def self.cancel_jobs
23
18
  Delayed::Job.delete_all([
24
19
  "handler LIKE (?) AND locked_at IS NULL AND locked_by IS NULL AND failed_at IS NULL", "--- !ruby/object:ThinkingSphinx::Deltas::%"
@@ -43,22 +38,23 @@ class ThinkingSphinx::Deltas::DelayedDelta <
43
38
  if Gem.loaded_specs['delayed_job'].version.to_s.match(/^2\.0\./)
44
39
  # Fallback for compatibility with old release 2.0.x of DJ
45
40
  # Only priority option is supported for these versions
46
- set_job_options(:delayed_job_priority)
41
+ ThinkingSphinx::Configuration.instance.delayed_job_priority || 0
47
42
  else
48
- CONFIGURATIONS_MAP.inject({}) do |job_mapper, configuration_entity|
49
- job_mapper.merge(configuration_entity[0] => set_job_options(configuration_entity[1]))
50
- end
43
+ {
44
+ :priority => job_option(:delayed_job_priority, 0),
45
+ :queue => job_option(:delayed_job_queue)
46
+ }
51
47
  end
52
48
  end
53
49
 
54
- def self.set_job_options(setting)
50
+ def self.job_option(setting, default = nil)
55
51
  configuration = ThinkingSphinx::Configuration.instance
56
52
  if configuration.respond_to? setting
57
53
  configuration.send(setting)
58
54
  elsif configuration.respond_to? :settings
59
- configuration.settings[setting.to_s]
55
+ configuration.settings[setting.to_s] || default
60
56
  else
61
- nil
57
+ default
62
58
  end
63
59
  end
64
60
 
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'ts-delayed-delta'
6
- s.version = '2.0.1'
6
+ s.version = '2.0.2'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Pat Allan']
9
9
  s.email = ['pat@freelancing-gods.com']
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  }
21
21
  s.require_paths = ['lib']
22
22
 
23
- s.add_runtime_dependency 'thinking-sphinx'
23
+ s.add_runtime_dependency 'thinking-sphinx', '>= 1.5.0'
24
24
  s.add_runtime_dependency 'delayed_job'
25
25
 
26
26
  s.add_development_dependency 'appraisal', '~> 0.5.2'
metadata CHANGED
@@ -1,125 +1,162 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ts-delayed-delta
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.2
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2014-04-10 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- requirement: &id001 !ruby/object:Gem::Requirement
16
- requirements:
17
- - &id002
18
- - ">="
19
- - !ruby/object:Gem::Version
20
- version: "0"
21
- version_requirements: *id001
22
- type: :runtime
23
- prerelease: false
11
+ date: 2014-04-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
24
14
  name: thinking-sphinx
25
- - !ruby/object:Gem::Dependency
26
- requirement: &id003 !ruby/object:Gem::Requirement
27
- requirements:
28
- - *id002
29
- version_requirements: *id003
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.5.0
30
20
  type: :runtime
31
21
  prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.5.0
27
+ - !ruby/object:Gem::Dependency
32
28
  name: delayed_job
33
- - !ruby/object:Gem::Dependency
34
- requirement: &id004 !ruby/object:Gem::Requirement
35
- requirements:
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
36
45
  - - ~>
37
- - !ruby/object:Gem::Version
46
+ - !ruby/object:Gem::Version
38
47
  version: 0.5.2
39
- version_requirements: *id004
40
48
  type: :development
41
49
  prerelease: false
42
- name: appraisal
43
- - !ruby/object:Gem::Dependency
44
- requirement: &id005 !ruby/object:Gem::Requirement
45
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.5.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: combustion
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
46
59
  - - ~>
47
- - !ruby/object:Gem::Version
60
+ - !ruby/object:Gem::Version
48
61
  version: 0.4.0
49
- version_requirements: *id005
50
62
  type: :development
51
63
  prerelease: false
52
- name: combustion
53
- - !ruby/object:Gem::Dependency
54
- requirement: &id006 !ruby/object:Gem::Requirement
55
- requirements:
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
56
66
  - - ~>
57
- - !ruby/object:Gem::Version
67
+ - !ruby/object:Gem::Version
68
+ version: 0.4.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: database_cleaner
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
58
75
  version: 0.7.1
59
- version_requirements: *id006
60
76
  type: :development
61
77
  prerelease: false
62
- name: database_cleaner
63
- - !ruby/object:Gem::Dependency
64
- requirement: &id007 !ruby/object:Gem::Requirement
65
- requirements:
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
66
80
  - - ~>
67
- - !ruby/object:Gem::Version
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: delayed_job_active_record
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
68
89
  version: 0.4.4
69
- version_requirements: *id007
70
90
  type: :development
71
91
  prerelease: false
72
- name: delayed_job_active_record
73
- - !ruby/object:Gem::Dependency
74
- requirement: &id008 !ruby/object:Gem::Requirement
75
- requirements:
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
76
94
  - - ~>
77
- - !ruby/object:Gem::Version
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.4
97
+ - !ruby/object:Gem::Dependency
98
+ name: mysql2
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
78
103
  version: 0.3.12b4
79
- version_requirements: *id008
80
104
  type: :development
81
105
  prerelease: false
82
- name: mysql2
83
- - !ruby/object:Gem::Dependency
84
- requirement: &id009 !ruby/object:Gem::Requirement
85
- requirements:
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
86
108
  - - ~>
87
- - !ruby/object:Gem::Version
109
+ - !ruby/object:Gem::Version
110
+ version: 0.3.12b4
111
+ - !ruby/object:Gem::Dependency
112
+ name: pg
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
88
117
  version: 0.11.0
89
- version_requirements: *id009
90
118
  type: :development
91
119
  prerelease: false
92
- name: pg
93
- - !ruby/object:Gem::Dependency
94
- requirement: &id010 !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 0.11.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
98
131
  version: 0.9.2
99
- version_requirements: *id010
100
132
  type: :development
101
133
  prerelease: false
102
- name: rake
103
- - !ruby/object:Gem::Dependency
104
- requirement: &id011 !ruby/object:Gem::Requirement
105
- requirements:
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: 0.9.2
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
106
143
  - - ~>
107
- - !ruby/object:Gem::Version
144
+ - !ruby/object:Gem::Version
108
145
  version: 2.11.0
109
- version_requirements: *id011
110
146
  type: :development
111
147
  prerelease: false
112
- name: rspec
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: 2.11.0
113
153
  description: Manage delta indexes via Delayed Job for Thinking Sphinx
114
- email:
154
+ email:
115
155
  - pat@freelancing-gods.com
116
156
  executables: []
117
-
118
157
  extensions: []
119
-
120
158
  extra_rdoc_files: []
121
-
122
- files:
159
+ files:
123
160
  - .gitignore
124
161
  - .travis.yml
125
162
  - Appraisals
@@ -149,28 +186,28 @@ files:
149
186
  - ts-delayed-delta.gemspec
150
187
  homepage: http://github.com/pat/ts-delayed-delta
151
188
  licenses: []
152
-
153
189
  metadata: {}
154
-
155
190
  post_install_message:
156
191
  rdoc_options: []
157
-
158
- require_paths:
192
+ require_paths:
159
193
  - lib
160
- required_ruby_version: !ruby/object:Gem::Requirement
161
- requirements:
162
- - *id002
163
- required_rubygems_version: !ruby/object:Gem::Requirement
164
- requirements:
165
- - *id002
194
+ required_ruby_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - '>='
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
166
204
  requirements: []
167
-
168
205
  rubyforge_project: ts-delayed-delta
169
- rubygems_version: 2.1.0
206
+ rubygems_version: 2.0.14
170
207
  signing_key:
171
208
  specification_version: 4
172
209
  summary: Thinking Sphinx - Delayed Deltas
173
- test_files:
210
+ test_files:
174
211
  - spec/acceptance/delayed_job_deltas_spec.rb
175
212
  - spec/acceptance/spec_helper.rb
176
213
  - spec/acceptance/support/database_cleaner.rb