thinking-sphinx-099 1.2.12 → 1.2.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/README.textile +4 -17
  2. data/VERSION.yml +2 -1
  3. data/features/alternate_primary_key.feature +27 -0
  4. data/features/attribute_transformation.feature +22 -0
  5. data/features/attribute_updates.feature +33 -0
  6. data/features/datetime_deltas.feature +66 -0
  7. data/features/delayed_delta_indexing.feature +37 -0
  8. data/features/deleting_instances.feature +64 -0
  9. data/features/direct_attributes.feature +11 -0
  10. data/features/excerpts.feature +13 -0
  11. data/features/extensible_delta_indexing.feature +9 -0
  12. data/features/facets.feature +76 -0
  13. data/features/facets_across_model.feature +29 -0
  14. data/features/handling_edits.feature +76 -0
  15. data/features/retry_stale_indexes.feature +24 -0
  16. data/features/searching_across_models.feature +20 -0
  17. data/features/searching_by_model.feature +175 -0
  18. data/features/searching_with_find_arguments.feature +56 -0
  19. data/features/sphinx_detection.feature +25 -0
  20. data/features/sphinx_scopes.feature +35 -0
  21. data/features/step_definitions/alpha_steps.rb +3 -0
  22. data/features/step_definitions/beta_steps.rb +7 -0
  23. data/features/step_definitions/common_steps.rb +174 -0
  24. data/features/step_definitions/datetime_delta_steps.rb +15 -0
  25. data/features/step_definitions/delayed_delta_indexing_steps.rb +7 -0
  26. data/features/step_definitions/extensible_delta_indexing_steps.rb +7 -0
  27. data/features/step_definitions/facet_steps.rb +92 -0
  28. data/features/step_definitions/find_arguments_steps.rb +36 -0
  29. data/features/step_definitions/gamma_steps.rb +15 -0
  30. data/features/step_definitions/scope_steps.rb +11 -0
  31. data/features/step_definitions/search_steps.rb +89 -0
  32. data/features/step_definitions/sphinx_steps.rb +31 -0
  33. data/features/sti_searching.feature +14 -0
  34. data/features/support/database.example.yml +3 -0
  35. data/features/support/database.yml +5 -0
  36. data/features/support/db/active_record.rb +40 -0
  37. data/features/support/db/database.yml +5 -0
  38. data/features/support/db/fixtures/alphas.rb +10 -0
  39. data/features/support/db/fixtures/authors.rb +1 -0
  40. data/features/support/db/fixtures/betas.rb +10 -0
  41. data/features/support/db/fixtures/boxes.rb +9 -0
  42. data/features/support/db/fixtures/categories.rb +1 -0
  43. data/features/support/db/fixtures/cats.rb +3 -0
  44. data/features/support/db/fixtures/comments.rb +24 -0
  45. data/features/support/db/fixtures/delayed_betas.rb +10 -0
  46. data/features/support/db/fixtures/developers.rb +29 -0
  47. data/features/support/db/fixtures/dogs.rb +3 -0
  48. data/features/support/db/fixtures/extensible_betas.rb +10 -0
  49. data/features/support/db/fixtures/gammas.rb +10 -0
  50. data/features/support/db/fixtures/people.rb +1001 -0
  51. data/features/support/db/fixtures/posts.rb +6 -0
  52. data/features/support/db/fixtures/robots.rb +14 -0
  53. data/features/support/db/fixtures/tags.rb +27 -0
  54. data/features/support/db/fixtures/thetas.rb +10 -0
  55. data/features/support/db/migrations/create_alphas.rb +7 -0
  56. data/features/support/db/migrations/create_animals.rb +5 -0
  57. data/features/support/db/migrations/create_authors.rb +3 -0
  58. data/features/support/db/migrations/create_authors_posts.rb +6 -0
  59. data/features/support/db/migrations/create_betas.rb +5 -0
  60. data/features/support/db/migrations/create_boxes.rb +5 -0
  61. data/features/support/db/migrations/create_categories.rb +3 -0
  62. data/features/support/db/migrations/create_comments.rb +10 -0
  63. data/features/support/db/migrations/create_delayed_betas.rb +17 -0
  64. data/features/support/db/migrations/create_developers.rb +9 -0
  65. data/features/support/db/migrations/create_extensible_betas.rb +5 -0
  66. data/features/support/db/migrations/create_gammas.rb +3 -0
  67. data/features/support/db/migrations/create_people.rb +13 -0
  68. data/features/support/db/migrations/create_posts.rb +5 -0
  69. data/features/support/db/migrations/create_robots.rb +4 -0
  70. data/features/support/db/migrations/create_taggings.rb +5 -0
  71. data/features/support/db/migrations/create_tags.rb +4 -0
  72. data/features/support/db/migrations/create_thetas.rb +5 -0
  73. data/features/support/db/mysql.rb +3 -0
  74. data/features/support/db/postgresql.rb +3 -0
  75. data/features/support/env.rb +18 -0
  76. data/features/support/lib/generic_delta_handler.rb +8 -0
  77. data/features/support/models/alpha.rb +10 -0
  78. data/features/support/models/animal.rb +5 -0
  79. data/features/support/models/author.rb +3 -0
  80. data/features/support/models/beta.rb +8 -0
  81. data/features/support/models/box.rb +8 -0
  82. data/features/support/models/cat.rb +3 -0
  83. data/features/support/models/category.rb +4 -0
  84. data/features/support/models/comment.rb +10 -0
  85. data/features/support/models/delayed_beta.rb +7 -0
  86. data/features/support/models/developer.rb +16 -0
  87. data/features/support/models/dog.rb +3 -0
  88. data/features/support/models/extensible_beta.rb +9 -0
  89. data/features/support/models/gamma.rb +5 -0
  90. data/features/support/models/person.rb +23 -0
  91. data/features/support/models/post.rb +20 -0
  92. data/features/support/models/robot.rb +12 -0
  93. data/features/support/models/tag.rb +3 -0
  94. data/features/support/models/tagging.rb +4 -0
  95. data/features/support/models/theta.rb +7 -0
  96. data/features/support/post_database.rb +43 -0
  97. data/lib/cucumber/thinking_sphinx/internal_world.rb +125 -0
  98. data/lib/cucumber/thinking_sphinx/sql_logger.rb +20 -0
  99. data/lib/thinking_sphinx.rb +4 -2
  100. data/lib/thinking_sphinx/active_record.rb +1 -2
  101. data/lib/thinking_sphinx/adapters/mysql_adapter.rb +1 -1
  102. data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +18 -11
  103. data/lib/thinking_sphinx/attribute.rb +3 -4
  104. data/lib/thinking_sphinx/excerpter.rb +1 -1
  105. data/lib/thinking_sphinx/search.rb +1 -0
  106. data/lib/thinking_sphinx/source.rb +1 -1
  107. data/spec/lib/thinking_sphinx/active_record_spec.rb +0 -11
  108. data/spec/lib/thinking_sphinx/attribute_spec.rb +14 -7
  109. data/spec/lib/thinking_sphinx/deltas/job_spec.rb +32 -0
  110. data/spec/lib/thinking_sphinx/excerpter_spec.rb +8 -0
  111. data/spec/lib/thinking_sphinx/search_spec.rb +9 -0
  112. data/tasks/distribution.rb +4 -1
  113. data/tasks/testing.rb +8 -19
  114. metadata +99 -2
@@ -40,6 +40,14 @@ describe ThinkingSphinx::Excerpter do
40
40
  @excerpter.big_name
41
41
  end
42
42
 
43
+ it "should escape the text in the excerpt" do
44
+ @search.should_receive(:excerpt_for) do |string, model|
45
+ string.should == 'test "escaping" <characters>'
46
+ end
47
+
48
+ @excerpter.string_to_escape
49
+ end
50
+
43
51
  it "should still raise an exception if no column or method exists" do
44
52
  lambda {
45
53
  @excerpter.foo
@@ -919,6 +919,15 @@ describe ThinkingSphinx::Search do
919
919
  count.should == 5
920
920
  end
921
921
  end
922
+
923
+ it "should be aliased to each_with_group_and_count" do
924
+ search = ThinkingSphinx::Search.new
925
+ search.each_with_group_and_count do |obj, group, count|
926
+ obj.should == @alpha
927
+ group.should == 101
928
+ count.should == 5
929
+ end
930
+ end
922
931
  end
923
932
 
924
933
  describe '.each_with_weighting' do
@@ -25,7 +25,10 @@ Jeweler::Tasks.new do |gem|
25
25
  "vendor/**/*",
26
26
  "VERSION.yml"
27
27
  ]
28
- gem.test_files = FileList["spec/**/*_spec.rb"]
28
+ gem.test_files = FileList[
29
+ "features/**/*",
30
+ "spec/**/*_spec.rb"
31
+ ]
29
32
 
30
33
  gem.add_dependency 'activerecord', '>= 1.15.6'
31
34
 
@@ -10,17 +10,17 @@ end
10
10
 
11
11
  desc "Run all feature-set configurations"
12
12
  task :features do |t|
13
- puts "rake features:mysql"
14
- system "rake features:mysql"
15
- puts "rake features:postgresql"
16
- system "rake features:postgresql"
13
+ databases = ENV['DATABASES'] || 'mysql,postgresql'
14
+ databases.split(',').each do |database|
15
+ puts "rake features:#{database}"
16
+ system "rake features:#{database}"
17
+ end
17
18
  end
18
19
 
19
20
  namespace :features do
20
21
  def add_task(name, description)
21
22
  Cucumber::Rake::Task.new(name, description) do |t|
22
- t.cucumber_opts = "--format pretty"
23
- t.profile = name
23
+ t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
24
24
  end
25
25
  end
26
26
 
@@ -62,22 +62,11 @@ end
62
62
 
63
63
  desc "Build cucumber.yml file"
64
64
  task :cucumber_defaults do
65
- default_requires = %w(
66
- --require features/support/env.rb
67
- --require features/support/db/mysql.rb
68
- --require features/support/db/active_record.rb
69
- --require features/support/post_database.rb
70
- ).join(" ")
71
-
72
- step_definitions = FileList["features/step_definitions/**.rb"].collect { |path|
65
+ steps = FileList["features/step_definitions/**.rb"].collect { |path|
73
66
  "--require #{path}"
74
67
  }.join(" ")
75
68
 
76
- features = FileList["features/*.feature"].join(" ")
77
-
78
69
  File.open('cucumber.yml', 'w') { |f|
79
- f.write "default: \"#{default_requires} #{step_definitions}\"\n\n"
80
- f.write "mysql: \"#{default_requires} #{step_definitions} #{features}\"\n\n"
81
- f.write "postgresql: \"#{default_requires.gsub(/mysql/, 'postgresql')} #{step_definitions} #{features}\""
70
+ f.write "default: \"--require features/support/env.rb #{steps}\"\n"
82
71
  }
83
72
  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.2.12
4
+ version: 1.2.13
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-10-05 00:00:00 +02:00
12
+ date: 2009-11-01 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -34,6 +34,8 @@ files:
34
34
  - LICENCE
35
35
  - README.textile
36
36
  - VERSION.yml
37
+ - lib/cucumber/thinking_sphinx/internal_world.rb
38
+ - lib/cucumber/thinking_sphinx/sql_logger.rb
37
39
  - lib/thinking_sphinx.rb
38
40
  - lib/thinking_sphinx/active_record.rb
39
41
  - lib/thinking_sphinx/active_record/attribute_updates.rb
@@ -149,6 +151,100 @@ signing_key:
149
151
  specification_version: 3
150
152
  summary: ActiveRecord/Rails Sphinx library
151
153
  test_files:
154
+ - features/alternate_primary_key.feature
155
+ - features/attribute_transformation.feature
156
+ - features/attribute_updates.feature
157
+ - features/datetime_deltas.feature
158
+ - features/delayed_delta_indexing.feature
159
+ - features/deleting_instances.feature
160
+ - features/direct_attributes.feature
161
+ - features/excerpts.feature
162
+ - features/extensible_delta_indexing.feature
163
+ - features/facets.feature
164
+ - features/facets_across_model.feature
165
+ - features/handling_edits.feature
166
+ - features/retry_stale_indexes.feature
167
+ - features/searching_across_models.feature
168
+ - features/searching_by_model.feature
169
+ - features/searching_with_find_arguments.feature
170
+ - features/sphinx_detection.feature
171
+ - features/sphinx_scopes.feature
172
+ - features/step_definitions/alpha_steps.rb
173
+ - features/step_definitions/beta_steps.rb
174
+ - features/step_definitions/common_steps.rb
175
+ - features/step_definitions/datetime_delta_steps.rb
176
+ - features/step_definitions/delayed_delta_indexing_steps.rb
177
+ - features/step_definitions/extensible_delta_indexing_steps.rb
178
+ - features/step_definitions/facet_steps.rb
179
+ - features/step_definitions/find_arguments_steps.rb
180
+ - features/step_definitions/gamma_steps.rb
181
+ - features/step_definitions/scope_steps.rb
182
+ - features/step_definitions/search_steps.rb
183
+ - features/step_definitions/sphinx_steps.rb
184
+ - features/sti_searching.feature
185
+ - features/support/database.example.yml
186
+ - features/support/database.yml
187
+ - features/support/db/active_record.rb
188
+ - features/support/db/database.yml
189
+ - features/support/db/fixtures/alphas.rb
190
+ - features/support/db/fixtures/authors.rb
191
+ - features/support/db/fixtures/betas.rb
192
+ - features/support/db/fixtures/boxes.rb
193
+ - features/support/db/fixtures/categories.rb
194
+ - features/support/db/fixtures/cats.rb
195
+ - features/support/db/fixtures/comments.rb
196
+ - features/support/db/fixtures/delayed_betas.rb
197
+ - features/support/db/fixtures/developers.rb
198
+ - features/support/db/fixtures/dogs.rb
199
+ - features/support/db/fixtures/extensible_betas.rb
200
+ - features/support/db/fixtures/gammas.rb
201
+ - features/support/db/fixtures/people.rb
202
+ - features/support/db/fixtures/posts.rb
203
+ - features/support/db/fixtures/robots.rb
204
+ - features/support/db/fixtures/tags.rb
205
+ - features/support/db/fixtures/thetas.rb
206
+ - features/support/db/migrations/create_alphas.rb
207
+ - features/support/db/migrations/create_animals.rb
208
+ - features/support/db/migrations/create_authors.rb
209
+ - features/support/db/migrations/create_authors_posts.rb
210
+ - features/support/db/migrations/create_betas.rb
211
+ - features/support/db/migrations/create_boxes.rb
212
+ - features/support/db/migrations/create_categories.rb
213
+ - features/support/db/migrations/create_comments.rb
214
+ - features/support/db/migrations/create_delayed_betas.rb
215
+ - features/support/db/migrations/create_developers.rb
216
+ - features/support/db/migrations/create_extensible_betas.rb
217
+ - features/support/db/migrations/create_gammas.rb
218
+ - features/support/db/migrations/create_people.rb
219
+ - features/support/db/migrations/create_posts.rb
220
+ - features/support/db/migrations/create_robots.rb
221
+ - features/support/db/migrations/create_taggings.rb
222
+ - features/support/db/migrations/create_tags.rb
223
+ - features/support/db/migrations/create_thetas.rb
224
+ - features/support/db/mysql.rb
225
+ - features/support/db/postgresql.rb
226
+ - features/support/env.rb
227
+ - features/support/lib/generic_delta_handler.rb
228
+ - features/support/models/alpha.rb
229
+ - features/support/models/animal.rb
230
+ - features/support/models/author.rb
231
+ - features/support/models/beta.rb
232
+ - features/support/models/box.rb
233
+ - features/support/models/cat.rb
234
+ - features/support/models/category.rb
235
+ - features/support/models/comment.rb
236
+ - features/support/models/delayed_beta.rb
237
+ - features/support/models/developer.rb
238
+ - features/support/models/dog.rb
239
+ - features/support/models/extensible_beta.rb
240
+ - features/support/models/gamma.rb
241
+ - features/support/models/person.rb
242
+ - features/support/models/post.rb
243
+ - features/support/models/robot.rb
244
+ - features/support/models/tag.rb
245
+ - features/support/models/tagging.rb
246
+ - features/support/models/theta.rb
247
+ - features/support/post_database.rb
152
248
  - spec/lib/thinking_sphinx/active_record/delta_spec.rb
153
249
  - spec/lib/thinking_sphinx/active_record/has_many_association_spec.rb
154
250
  - spec/lib/thinking_sphinx/active_record/scopes_spec.rb
@@ -158,6 +254,7 @@ test_files:
158
254
  - spec/lib/thinking_sphinx/configuration_spec.rb
159
255
  - spec/lib/thinking_sphinx/core/array_spec.rb
160
256
  - spec/lib/thinking_sphinx/core/string_spec.rb
257
+ - spec/lib/thinking_sphinx/deltas/job_spec.rb
161
258
  - spec/lib/thinking_sphinx/excerpter_spec.rb
162
259
  - spec/lib/thinking_sphinx/facet_search_spec.rb
163
260
  - spec/lib/thinking_sphinx/facet_spec.rb