ultrasphinx 1.6.7 → 1.7

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.
Files changed (49) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +2 -0
  3. data/DEPLOYMENT_NOTES +29 -0
  4. data/Manifest +7 -2
  5. data/RAKE_TASKS +15 -0
  6. data/README +14 -17
  7. data/TODO +7 -1
  8. data/examples/default.base +16 -2
  9. data/lib/ultrasphinx.rb +2 -2
  10. data/lib/ultrasphinx/associations.rb +25 -0
  11. data/lib/ultrasphinx/configure.rb +26 -16
  12. data/lib/ultrasphinx/fields.rb +7 -4
  13. data/lib/ultrasphinx/is_indexed.rb +37 -25
  14. data/lib/ultrasphinx/search.rb +1 -0
  15. data/lib/ultrasphinx/search/internals.rb +10 -3
  16. data/lib/ultrasphinx/search/parser.rb +14 -11
  17. data/lib/ultrasphinx/ultrasphinx.rb +6 -4
  18. data/test/integration/app/app/models/geo/address.rb +1 -1
  19. data/test/integration/app/app/models/geo/country.rb +4 -0
  20. data/test/integration/app/config/boot.rb +95 -32
  21. data/test/integration/app/config/environment.rb +4 -1
  22. data/test/integration/app/config/environments/development.rb +4 -4
  23. data/test/integration/app/config/ultrasphinx/development.conf.canonical +45 -13
  24. data/test/integration/app/db/migrate/009_create_countries.rb +11 -0
  25. data/test/integration/app/test/fixtures/countries.yml +1 -0
  26. data/test/integration/configure_test.rb +14 -11
  27. data/test/integration/search_test.rb +1 -0
  28. data/test/integration/server_test.rb +2 -2
  29. data/test/setup.rb +0 -3
  30. data/test/teardown.rb +0 -0
  31. data/test/test_helper.rb +1 -6
  32. data/ultrasphinx.gemspec +21 -7
  33. data/vendor/riddle/README +2 -2
  34. data/vendor/riddle/Rakefile +94 -0
  35. data/vendor/riddle/lib/riddle.rb +1 -1
  36. data/vendor/riddle/lib/riddle/client.rb +18 -6
  37. data/vendor/riddle/lib/riddle/client/filter.rb +3 -1
  38. data/vendor/riddle/lib/riddle/client/message.rb +1 -1
  39. data/vendor/riddle/lib/riddle/client/response.rb +1 -1
  40. data/vendor/riddle/spec/fixtures/data/anchor.bin +0 -0
  41. data/vendor/riddle/spec/fixtures/data/filter_floats.bin +0 -0
  42. data/vendor/riddle/spec/fixtures/data/filter_floats_exclude.bin +0 -0
  43. data/vendor/riddle/spec/sphinx_helper.rb +1 -0
  44. data/vendor/riddle/spec/unit/message_spec.rb +3 -3
  45. data/vendor/riddle/spec/unit/response_spec.rb +2 -2
  46. metadata +10 -5
  47. metadata.gz.sig +0 -0
  48. data/test/integration/app/config/ultrasphinx/development.conf +0 -159
  49. data/test/integration/app/db/schema.rb +0 -52
@@ -0,0 +1,11 @@
1
+ class CreateCountries < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "countries", :force => true do |t|
4
+ t.string "name", :default => "", :null => false
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ drop_table "countries"
10
+ end
11
+ end
@@ -0,0 +1 @@
1
+ # Intentionally left blank
@@ -5,18 +5,21 @@ class ConfigureTest < Test::Unit::TestCase
5
5
 
6
6
  CONF = "#{RAILS_ROOT}/config/ultrasphinx/development.conf"
7
7
 
8
- def test_configuration_hasnt_changed
8
+ def test_configuration_hasnt_changed
9
+ unless ENV['DB'] =~ /postgresql/i
10
+ # MySQL only right now... not really a big deal
9
11
 
10
- File.delete CONF if File.exist? CONF
11
- Dir.chdir RAILS_ROOT do
12
- Ultrasphinx::Configure.run
13
- end
14
-
15
- @offset = 4
16
- @current = open(CONF).readlines[@offset..-1]
17
- @canonical = open(CONF + ".canonical").readlines[@offset..-1]
18
- @canonical.each_with_index do |line, index|
19
- assert_equal line, @current[index], "line #{index}:#{line.inspect} is incorrect"
12
+ File.delete CONF if File.exist? CONF
13
+ Dir.chdir RAILS_ROOT do
14
+ Ultrasphinx::Configure.run
15
+ end
16
+
17
+ @offset = 4
18
+ @current = open(CONF).readlines[@offset..-1]
19
+ @canonical = open(CONF + ".canonical").readlines[@offset..-1]
20
+ @canonical.each_with_index do |line, index|
21
+ assert_equal line, @current[index], "line #{index}:#{line.inspect} is incorrect"
22
+ end
20
23
  end
21
24
  end
22
25
 
@@ -205,6 +205,7 @@ class SearchTest < Test::Unit::TestCase
205
205
  end
206
206
 
207
207
  def test_text_facet
208
+ # XXX Still broken on Postgres
208
209
  @s = Ultrasphinx::Search.new(:facets => ['company_name']).run
209
210
  assert_equal 21, @s.facets['company_name'].size
210
211
  end
@@ -12,7 +12,7 @@ class ServerTest < Test::Unit::TestCase
12
12
  def setup
13
13
  @pid = Process.fork do
14
14
  Dir.chdir RAILS_ROOT do
15
- print "S"
15
+ # print "S"
16
16
  exec("script/server -p #{PORT} &> /dev/null")
17
17
  end
18
18
  end
@@ -23,7 +23,7 @@ class ServerTest < Test::Unit::TestCase
23
23
  # Process.kill(9, @pid) doesn't work because Mongrel has double-forked itself away
24
24
  `ps awx | grep #{PORT} | grep -v grep | awk '{print $1}'`.split("\n").each do |pid|
25
25
  system("kill -9 #{pid}")
26
- print "K"
26
+ # print "K"
27
27
  end
28
28
  sleep(2)
29
29
  @pid = nil
@@ -1,9 +1,6 @@
1
1
 
2
2
  # Setup integration system for the integration suite
3
3
 
4
- puts ["Please make sure that test/integration/app/vendor/rails is symlinked",
5
- "to a Rails trunk checkout in order for the rake tasks to run properly."]
6
-
7
4
  Dir.chdir "#{File.dirname(__FILE__)}/integration/app/" do
8
5
  system("killall searchd")
9
6
  system("rm -rf /tmp/sphinx")
File without changes
@@ -2,6 +2,7 @@
2
2
  require 'rubygems'
3
3
  require 'test/unit'
4
4
  require 'ruby-debug'
5
+ require 'multi_rails_init'
5
6
 
6
7
  HERE = File.dirname(__FILE__)
7
8
  $LOAD_PATH << HERE
@@ -11,9 +12,3 @@ require 'integration/app/config/environment'
11
12
  Dir.chdir "#{HERE}/integration/app" do
12
13
  system("rake us:start")
13
14
  end
14
-
15
- def silently
16
- stderr, $stderr = $stderr, StringIO.new
17
- yield
18
- $stderr = stderr
19
- end
@@ -1,24 +1,24 @@
1
1
 
2
- # Gem::Specification for Ultrasphinx-1.6.7
2
+ # Gem::Specification for Ultrasphinx-1.7
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{ultrasphinx}
7
- s.version = "1.6.7"
7
+ s.version = "1.7"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = [""]
13
- s.date = %q{2007-12-13}
13
+ s.date = %q{2008-01-12}
14
14
  s.description = %q{Ruby on Rails configurator and client to the Sphinx fulltext search engine.}
15
15
  s.email = %q{}
16
- s.files = ["CHANGELOG", "examples/ap.multi", "examples/default.base", "init.rb", "lib/ultrasphinx/autoload.rb", "lib/ultrasphinx/configure.rb", "lib/ultrasphinx/core_extensions.rb", "lib/ultrasphinx/fields.rb", "lib/ultrasphinx/is_indexed.rb", "lib/ultrasphinx/postgresql/concat_ws.sql", "lib/ultrasphinx/postgresql/crc32.sql", "lib/ultrasphinx/postgresql/group_concat.sql", "lib/ultrasphinx/postgresql/hex_to_int.sql", "lib/ultrasphinx/postgresql/language.sql", "lib/ultrasphinx/postgresql/unix_timestamp.sql", "lib/ultrasphinx/search/internals.rb", "lib/ultrasphinx/search/parser.rb", "lib/ultrasphinx/search.rb", "lib/ultrasphinx/spell.rb", "lib/ultrasphinx/ultrasphinx.rb", "lib/ultrasphinx.rb", "LICENSE", "Manifest", "README", "tasks/ultrasphinx.rake", "test/config/ultrasphinx/test.base", "test/integration/app/app/controllers/addresses_controller.rb", "test/integration/app/app/controllers/application.rb", "test/integration/app/app/controllers/sellers_controller.rb", "test/integration/app/app/controllers/states_controller.rb", "test/integration/app/app/controllers/users_controller.rb", "test/integration/app/app/helpers/addresses_helper.rb", "test/integration/app/app/helpers/application_helper.rb", "test/integration/app/app/helpers/sellers_helper.rb", "test/integration/app/app/helpers/states_helper.rb", "test/integration/app/app/helpers/users_helper.rb", "test/integration/app/app/models/geo/address.rb", "test/integration/app/app/models/geo/state.rb", "test/integration/app/app/models/person/user.rb", "test/integration/app/app/models/seller.rb", "test/integration/app/app/views/addresses/edit.html.erb", "test/integration/app/app/views/addresses/index.html.erb", "test/integration/app/app/views/addresses/new.html.erb", "test/integration/app/app/views/addresses/show.html.erb", "test/integration/app/app/views/layouts/addresses.html.erb", "test/integration/app/app/views/layouts/sellers.html.erb", "test/integration/app/app/views/layouts/states.html.erb", "test/integration/app/app/views/layouts/users.html.erb", "test/integration/app/app/views/sellers/edit.html.erb", "test/integration/app/app/views/sellers/index.html.erb", "test/integration/app/app/views/sellers/new.html.erb", "test/integration/app/app/views/sellers/show.html.erb", "test/integration/app/app/views/states/edit.html.erb", "test/integration/app/app/views/states/index.html.erb", "test/integration/app/app/views/states/new.html.erb", "test/integration/app/app/views/states/show.html.erb", "test/integration/app/app/views/users/edit.html.erb", "test/integration/app/app/views/users/index.html.erb", "test/integration/app/app/views/users/new.html.erb", "test/integration/app/app/views/users/show.html.erb", "test/integration/app/config/boot.rb", "test/integration/app/config/database.yml", "test/integration/app/config/environment.rb", "test/integration/app/config/environments/development.rb", "test/integration/app/config/environments/production.rb", "test/integration/app/config/environments/test.rb", "test/integration/app/config/locomotive.yml", "test/integration/app/config/routes.rb", "test/integration/app/config/ultrasphinx/default.base", "test/integration/app/config/ultrasphinx/development.conf", "test/integration/app/config/ultrasphinx/development.conf.canonical", "test/integration/app/db/migrate/001_create_users.rb", "test/integration/app/db/migrate/002_create_sellers.rb", "test/integration/app/db/migrate/003_create_addresses.rb", "test/integration/app/db/migrate/004_create_states.rb", "test/integration/app/db/migrate/005_add_capitalization_to_seller.rb", "test/integration/app/db/migrate/006_add_deleted_to_user.rb", "test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb", "test/integration/app/db/migrate/008_add_mission_statement_to_seller.rb", "test/integration/app/db/schema.rb", "test/integration/app/doc/README_FOR_APP", "test/integration/app/public/404.html", "test/integration/app/public/500.html", "test/integration/app/public/dispatch.cgi", "test/integration/app/public/dispatch.fcgi", "test/integration/app/public/dispatch.rb", "test/integration/app/public/favicon.ico", "test/integration/app/public/images/rails.png", "test/integration/app/public/index.html", "test/integration/app/public/javascripts/application.js", "test/integration/app/public/javascripts/controls.js", "test/integration/app/public/javascripts/dragdrop.js", "test/integration/app/public/javascripts/effects.js", "test/integration/app/public/javascripts/prototype.js", "test/integration/app/public/robots.txt", "test/integration/app/public/stylesheets/scaffold.css", "test/integration/app/Rakefile", "test/integration/app/README", "test/integration/app/script/about", "test/integration/app/script/breakpointer", "test/integration/app/script/console", "test/integration/app/script/destroy", "test/integration/app/script/generate", "test/integration/app/script/performance/benchmarker", "test/integration/app/script/performance/profiler", "test/integration/app/script/plugin", "test/integration/app/script/process/inspector", "test/integration/app/script/process/reaper", "test/integration/app/script/process/spawner", "test/integration/app/script/runner", "test/integration/app/script/server", "test/integration/app/test/fixtures/addresses.yml", "test/integration/app/test/fixtures/sellers.yml", "test/integration/app/test/fixtures/states.yml", "test/integration/app/test/fixtures/users.yml", "test/integration/app/test/functional/addresses_controller_test.rb", "test/integration/app/test/functional/sellers_controller_test.rb", "test/integration/app/test/functional/states_controller_test.rb", "test/integration/app/test/functional/users_controller_test.rb", "test/integration/app/test/test_helper.rb", "test/integration/app/test/unit/address_test.rb", "test/integration/app/test/unit/seller_test.rb", "test/integration/app/test/unit/state_test.rb", "test/integration/app/test/unit/user_test.rb", "test/integration/configure_test.rb", "test/integration/search_test.rb", "test/integration/server_test.rb", "test/integration/spell_test.rb", "test/setup.rb", "test/test_all.rb", "test/test_helper.rb", "test/ts.multi", "test/unit/parser_test.rb", "TODO", "vendor/riddle/lib/riddle/client/filter.rb", "vendor/riddle/lib/riddle/client/message.rb", "vendor/riddle/lib/riddle/client/response.rb", "vendor/riddle/lib/riddle/client.rb", "vendor/riddle/lib/riddle.rb", "vendor/riddle/MIT-LICENCE", "vendor/riddle/Rakefile", "vendor/riddle/README", "vendor/riddle/spec/fixtures/data/anchor.bin", "vendor/riddle/spec/fixtures/data/any.bin", "vendor/riddle/spec/fixtures/data/boolean.bin", "vendor/riddle/spec/fixtures/data/distinct.bin", "vendor/riddle/spec/fixtures/data/filter.bin", "vendor/riddle/spec/fixtures/data/filter_array.bin", "vendor/riddle/spec/fixtures/data/filter_array_exclude.bin", "vendor/riddle/spec/fixtures/data/filter_floats.bin", "vendor/riddle/spec/fixtures/data/filter_floats_exclude.bin", "vendor/riddle/spec/fixtures/data/filter_floats_range.bin", "vendor/riddle/spec/fixtures/data/filter_range.bin", "vendor/riddle/spec/fixtures/data/filter_range_exclude.bin", "vendor/riddle/spec/fixtures/data/group.bin", "vendor/riddle/spec/fixtures/data/index.bin", "vendor/riddle/spec/fixtures/data/phrase.bin", "vendor/riddle/spec/fixtures/data/simple.bin", "vendor/riddle/spec/fixtures/data/sort.bin", "vendor/riddle/spec/fixtures/data/update_simple.bin", "vendor/riddle/spec/fixtures/data/weights.bin", "vendor/riddle/spec/fixtures/sphinx/configuration.erb", "vendor/riddle/spec/fixtures/sql/conf.example.yml", "vendor/riddle/spec/fixtures/sql/data.sql", "vendor/riddle/spec/fixtures/sql/structure.sql", "vendor/riddle/spec/functional/excerpt_spec.rb", "vendor/riddle/spec/functional/search_spec.rb", "vendor/riddle/spec/functional/update_spec.rb", "vendor/riddle/spec/spec_helper.rb", "vendor/riddle/spec/sphinx_helper.rb", "vendor/riddle/spec/unit/client_spec.rb", "vendor/riddle/spec/unit/filter_spec.rb", "vendor/riddle/spec/unit/message_spec.rb", "vendor/riddle/spec/unit/response_spec.rb", "vendor/will_paginate/LICENSE", "ultrasphinx.gemspec"]
16
+ s.files = ["CHANGELOG", "DEPLOYMENT_NOTES", "examples/ap.multi", "examples/default.base", "init.rb", "lib/ultrasphinx/associations.rb", "lib/ultrasphinx/autoload.rb", "lib/ultrasphinx/configure.rb", "lib/ultrasphinx/core_extensions.rb", "lib/ultrasphinx/fields.rb", "lib/ultrasphinx/is_indexed.rb", "lib/ultrasphinx/postgresql/concat_ws.sql", "lib/ultrasphinx/postgresql/crc32.sql", "lib/ultrasphinx/postgresql/group_concat.sql", "lib/ultrasphinx/postgresql/hex_to_int.sql", "lib/ultrasphinx/postgresql/language.sql", "lib/ultrasphinx/postgresql/unix_timestamp.sql", "lib/ultrasphinx/search/internals.rb", "lib/ultrasphinx/search/parser.rb", "lib/ultrasphinx/search.rb", "lib/ultrasphinx/spell.rb", "lib/ultrasphinx/ultrasphinx.rb", "lib/ultrasphinx.rb", "LICENSE", "Manifest", "RAKE_TASKS", "README", "tasks/ultrasphinx.rake", "test/config/ultrasphinx/test.base", "test/integration/app/app/controllers/addresses_controller.rb", "test/integration/app/app/controllers/application.rb", "test/integration/app/app/controllers/sellers_controller.rb", "test/integration/app/app/controllers/states_controller.rb", "test/integration/app/app/controllers/users_controller.rb", "test/integration/app/app/helpers/addresses_helper.rb", "test/integration/app/app/helpers/application_helper.rb", "test/integration/app/app/helpers/sellers_helper.rb", "test/integration/app/app/helpers/states_helper.rb", "test/integration/app/app/helpers/users_helper.rb", "test/integration/app/app/models/geo/address.rb", "test/integration/app/app/models/geo/country.rb", "test/integration/app/app/models/geo/state.rb", "test/integration/app/app/models/person/user.rb", "test/integration/app/app/models/seller.rb", "test/integration/app/app/views/addresses/edit.html.erb", "test/integration/app/app/views/addresses/index.html.erb", "test/integration/app/app/views/addresses/new.html.erb", "test/integration/app/app/views/addresses/show.html.erb", "test/integration/app/app/views/layouts/addresses.html.erb", "test/integration/app/app/views/layouts/sellers.html.erb", "test/integration/app/app/views/layouts/states.html.erb", "test/integration/app/app/views/layouts/users.html.erb", "test/integration/app/app/views/sellers/edit.html.erb", "test/integration/app/app/views/sellers/index.html.erb", "test/integration/app/app/views/sellers/new.html.erb", "test/integration/app/app/views/sellers/show.html.erb", "test/integration/app/app/views/states/edit.html.erb", "test/integration/app/app/views/states/index.html.erb", "test/integration/app/app/views/states/new.html.erb", "test/integration/app/app/views/states/show.html.erb", "test/integration/app/app/views/users/edit.html.erb", "test/integration/app/app/views/users/index.html.erb", "test/integration/app/app/views/users/new.html.erb", "test/integration/app/app/views/users/show.html.erb", "test/integration/app/config/boot.rb", "test/integration/app/config/database.yml", "test/integration/app/config/environment.rb", "test/integration/app/config/environments/development.rb", "test/integration/app/config/environments/production.rb", "test/integration/app/config/environments/test.rb", "test/integration/app/config/locomotive.yml", "test/integration/app/config/routes.rb", "test/integration/app/config/ultrasphinx/default.base", "test/integration/app/config/ultrasphinx/development.conf.canonical", "test/integration/app/db/migrate/001_create_users.rb", "test/integration/app/db/migrate/002_create_sellers.rb", "test/integration/app/db/migrate/003_create_addresses.rb", "test/integration/app/db/migrate/004_create_states.rb", "test/integration/app/db/migrate/005_add_capitalization_to_seller.rb", "test/integration/app/db/migrate/006_add_deleted_to_user.rb", "test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb", "test/integration/app/db/migrate/008_add_mission_statement_to_seller.rb", "test/integration/app/db/migrate/009_create_countries.rb", "test/integration/app/doc/README_FOR_APP", "test/integration/app/public/404.html", "test/integration/app/public/500.html", "test/integration/app/public/dispatch.cgi", "test/integration/app/public/dispatch.fcgi", "test/integration/app/public/dispatch.rb", "test/integration/app/public/favicon.ico", "test/integration/app/public/images/rails.png", "test/integration/app/public/index.html", "test/integration/app/public/javascripts/application.js", "test/integration/app/public/javascripts/controls.js", "test/integration/app/public/javascripts/dragdrop.js", "test/integration/app/public/javascripts/effects.js", "test/integration/app/public/javascripts/prototype.js", "test/integration/app/public/robots.txt", "test/integration/app/public/stylesheets/scaffold.css", "test/integration/app/Rakefile", "test/integration/app/README", "test/integration/app/script/about", "test/integration/app/script/breakpointer", "test/integration/app/script/console", "test/integration/app/script/destroy", "test/integration/app/script/generate", "test/integration/app/script/performance/benchmarker", "test/integration/app/script/performance/profiler", "test/integration/app/script/plugin", "test/integration/app/script/process/inspector", "test/integration/app/script/process/reaper", "test/integration/app/script/process/spawner", "test/integration/app/script/runner", "test/integration/app/script/server", "test/integration/app/test/fixtures/addresses.yml", "test/integration/app/test/fixtures/countries.yml", "test/integration/app/test/fixtures/sellers.yml", "test/integration/app/test/fixtures/states.yml", "test/integration/app/test/fixtures/users.yml", "test/integration/app/test/functional/addresses_controller_test.rb", "test/integration/app/test/functional/sellers_controller_test.rb", "test/integration/app/test/functional/states_controller_test.rb", "test/integration/app/test/functional/users_controller_test.rb", "test/integration/app/test/test_helper.rb", "test/integration/app/test/unit/address_test.rb", "test/integration/app/test/unit/seller_test.rb", "test/integration/app/test/unit/state_test.rb", "test/integration/app/test/unit/user_test.rb", "test/integration/configure_test.rb", "test/integration/search_test.rb", "test/integration/server_test.rb", "test/integration/spell_test.rb", "test/setup.rb", "test/teardown.rb", "test/test_all.rb", "test/test_helper.rb", "test/ts.multi", "test/unit/parser_test.rb", "TODO", "vendor/riddle/lib/riddle/client/filter.rb", "vendor/riddle/lib/riddle/client/message.rb", "vendor/riddle/lib/riddle/client/response.rb", "vendor/riddle/lib/riddle/client.rb", "vendor/riddle/lib/riddle.rb", "vendor/riddle/MIT-LICENCE", "vendor/riddle/Rakefile", "vendor/riddle/README", "vendor/riddle/spec/fixtures/data/anchor.bin", "vendor/riddle/spec/fixtures/data/any.bin", "vendor/riddle/spec/fixtures/data/boolean.bin", "vendor/riddle/spec/fixtures/data/distinct.bin", "vendor/riddle/spec/fixtures/data/filter.bin", "vendor/riddle/spec/fixtures/data/filter_array.bin", "vendor/riddle/spec/fixtures/data/filter_array_exclude.bin", "vendor/riddle/spec/fixtures/data/filter_floats.bin", "vendor/riddle/spec/fixtures/data/filter_floats_exclude.bin", "vendor/riddle/spec/fixtures/data/filter_floats_range.bin", "vendor/riddle/spec/fixtures/data/filter_range.bin", "vendor/riddle/spec/fixtures/data/filter_range_exclude.bin", "vendor/riddle/spec/fixtures/data/group.bin", "vendor/riddle/spec/fixtures/data/index.bin", "vendor/riddle/spec/fixtures/data/phrase.bin", "vendor/riddle/spec/fixtures/data/simple.bin", "vendor/riddle/spec/fixtures/data/sort.bin", "vendor/riddle/spec/fixtures/data/update_simple.bin", "vendor/riddle/spec/fixtures/data/weights.bin", "vendor/riddle/spec/fixtures/sphinx/configuration.erb", "vendor/riddle/spec/fixtures/sql/conf.example.yml", "vendor/riddle/spec/fixtures/sql/data.sql", "vendor/riddle/spec/fixtures/sql/structure.sql", "vendor/riddle/spec/functional/excerpt_spec.rb", "vendor/riddle/spec/functional/search_spec.rb", "vendor/riddle/spec/functional/update_spec.rb", "vendor/riddle/spec/spec_helper.rb", "vendor/riddle/spec/sphinx_helper.rb", "vendor/riddle/spec/unit/client_spec.rb", "vendor/riddle/spec/unit/filter_spec.rb", "vendor/riddle/spec/unit/message_spec.rb", "vendor/riddle/spec/unit/response_spec.rb", "vendor/will_paginate/LICENSE", "ultrasphinx.gemspec"]
17
17
  s.has_rdoc = true
18
18
  s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/}
19
19
  s.require_paths = ["lib"]
20
20
  s.rubyforge_project = %q{fauna}
21
- s.rubygems_version = %q{0.9.5}
21
+ s.rubygems_version = %q{1.0.1}
22
22
  s.summary = %q{Ruby on Rails configurator and client to the Sphinx fulltext search engine.}
23
23
  s.test_files = ["test/test_all.rb"]
24
24
 
@@ -36,8 +36,22 @@ end
36
36
  # p.summary = "Ruby on Rails configurator and client to the Sphinx fulltext search engine."
37
37
  # p.url = "http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/"
38
38
  # p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
39
- # p.rdoc_pattern = /is_indexed.rb|search.rb|spell.rb|ultrasphinx.rb|^README|TODO|CHANGELOG|^LICENSE/
39
+ # p.rdoc_pattern = /is_indexed.rb|search.rb|spell.rb|ultrasphinx.rb|^README|TODO|DEPLOY|RAKE_TASKS|CHANGELOG|^LICENSE/
40
40
  # p.dependencies = "chronic"
41
41
  # p.test_pattern = ["test/integration/*.rb", "test/unit/*.rb"]
42
- # p.rcov_options << '--include-file test\/integration\/app\/vendor\/plugins\/ultrasphinx\/lib\/.*\.rb'
42
+ # p.rcov_options << '--include-file test\/integration\/app\/vendor\/plugins\/ultrasphinx\/lib\/.*\.rb --include-file '
43
43
  # end
44
+ #
45
+ # desc "Run all the tests for every database adapter"
46
+ # task "test_all" do
47
+ # ['mysql', 'postgresql'].each do |adapter|
48
+ # ENV['DB'] = adapter
49
+ # ENV['PRODUCTION'] = nil
50
+ # STDERR.puts "#{'='*80}\nDevelopment mode for #{adapter}\n#{'='*80}"
51
+ # system("rake test:multi_rails:all")
52
+ #
53
+ # ENV['PRODUCTION'] = '1'
54
+ # STDERR.puts "#{'='*80}\nProduction mode for #{adapter}\n#{'='*80}"
55
+ # system("rake test:multi_rails:all")
56
+ # end
57
+ # end
@@ -8,13 +8,13 @@ opting for a more Ruby-like structure.
8
8
  While it doesn't (yet) exist as a gem, you can obtain the sourcecode via subversion. If you
9
9
  are after a specific release, use the tag as follows:
10
10
 
11
- svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-r871 riddle
11
+ svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/tags/0.9.8-r985 riddle
12
12
 
13
13
  Or for the most current, just use trunk:
14
14
 
15
15
  svn co http://rails-oceania.googlecode.com/svn/patallan/riddle/trunk riddle
16
16
 
17
- Please note that at the time of writing, only 0.9.8r871 is supported.
17
+ Please note that at the time of writing, only 0.9.8r871, 0.9.8r909 and 0.9.8r985 are supported.
18
18
 
19
19
  To get started, just instantiate a Client object:
20
20
 
@@ -1,12 +1,106 @@
1
1
  require 'rake'
2
2
  require 'rake/rdoctask'
3
3
  require 'spec/rake/spectask'
4
+ require 'rdoc/rdoc'
5
+ require 'rdoc/generators/html_generator'
6
+ require 'rdoc/generators/template/html/html'
7
+
8
+ module Generators
9
+ class HtmlFile < ContextUser
10
+ alias_method :core_attribute_values, :file_attribute_values
11
+
12
+ def file_attribute_values
13
+ core_attribute_values
14
+
15
+ @values["analytics"] = @options.analytics if @options.analytics
16
+ end
17
+ end
18
+
19
+ class HtmlClass < ContextUser
20
+ alias_method :core_attribute_values, :class_attribute_values
21
+
22
+ def class_attribute_values
23
+ core_attribute_values
24
+
25
+ @values["analytics"] = @options.analytics if @options.analytics
26
+ end
27
+ end
28
+ end
29
+
30
+ class Options
31
+ attr_accessor :analytics
32
+
33
+ module OptionList
34
+ OPTION_LIST << [
35
+ "--analytics", "-y", "code", "Google Analytics Code"
36
+ ]
37
+ end
38
+
39
+ alias_method :core_parse, :parse
40
+
41
+ def parse(argv, generators)
42
+ core_parse(argv, generators)
43
+
44
+ old_args = ARGV.dup
45
+ ARGV.replace(argv)
46
+
47
+ go = GetoptLong.new(*OptionList.options)
48
+ go.quiet = true
49
+
50
+ go.each do |opt, arg|
51
+ case opt
52
+ when "--analytics"
53
+ @analytics = arg.strip
54
+ end
55
+ end
56
+
57
+ ARGV.replace(old_args)
58
+ end
59
+
60
+ end
61
+
62
+ module RDoc
63
+ module Page
64
+ remove_const :FOOTER
65
+ const_set :FOOTER, %{
66
+ <div id="validator-badges">
67
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
68
+ </div>
69
+ <script type="text/javascript">
70
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
71
+ document.write("\\<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>\\<\\/script>" );
72
+ </script>
73
+ <script type="text/javascript">
74
+ var pageTracker = _gat._getTracker("%analytics%");
75
+ pageTracker._initData();
76
+ pageTracker._trackPageview();
77
+ </script>
78
+
79
+ </body>
80
+ </html>
81
+ }
82
+
83
+ remove_const :BODY
84
+ const_set :BODY, HEADER + %{
85
+
86
+ !INCLUDE! <!-- banner header -->
87
+
88
+ <div id="bodyContent">
89
+
90
+ } + METHOD_LIST + %{
91
+
92
+ </div>
93
+
94
+ } + FOOTER
95
+ end
96
+ end
4
97
 
5
98
  desc 'Generate documentation'
6
99
  Rake::RDocTask.new(:rdoc) do |rdoc|
7
100
  rdoc.rdoc_dir = 'rdoc'
8
101
  rdoc.title = 'Riddle - Ruby Sphinx Client'
9
102
  rdoc.options << '--line-numbers' << '--inline-source'
103
+ rdoc.options << '-y US-2475317-6'
10
104
  rdoc.rdoc_files.include('README')
11
105
  rdoc.rdoc_files.include('lib/**/*.rb')
12
106
  end
@@ -11,7 +11,7 @@ module Riddle #:nodoc:
11
11
  Major = 0
12
12
  Minor = 9
13
13
  Tiny = 8
14
- Rev = 871
14
+ Rev = 985
15
15
 
16
16
  String = [Major, Minor, Tiny].join('.') + "r#{Rev}"
17
17
  end
@@ -45,11 +45,13 @@ module Riddle
45
45
  }
46
46
 
47
47
  MatchModes = {
48
- :all => 0, # SPH_MATCH_ALL
49
- :any => 1, # SPH_MATCH_ANY
50
- :phrase => 2, # SPH_MATCH_PHRASE
51
- :boolean => 3, # SPH_MATCH_BOOLEAN
52
- :extended => 4 # SPH_MATCH_EXTENDED
48
+ :all => 0, # SPH_MATCH_ALL
49
+ :any => 1, # SPH_MATCH_ANY
50
+ :phrase => 2, # SPH_MATCH_PHRASE
51
+ :boolean => 3, # SPH_MATCH_BOOLEAN
52
+ :extended => 4, # SPH_MATCH_EXTENDED
53
+ :fullsacn => 5, # SPH_MATCH_FULLSCAN
54
+ :extended2 => 6 # SPH_MATCH_EXTENDED2
53
55
  }
54
56
 
55
57
  SortModes = {
@@ -272,6 +274,8 @@ module Riddle
272
274
  # * :chunk_separator (defaults to ' &#8230; ' - which is an HTML ellipsis)
273
275
  # * :limit (defaults to 256)
274
276
  # * :around (defaults to 5)
277
+ # * :exact_phrase (defaults to false)
278
+ # * :single_passage (defaults to false)
275
279
  #
276
280
  # The defaults differ from the official PHP client, as I've opted for
277
281
  # semantic HTML markup.
@@ -282,6 +286,8 @@ module Riddle
282
286
  options[:chunk_separator] ||= ' &#8230; ' # ellipsis
283
287
  options[:limit] ||= 256
284
288
  options[:around] ||= 5
289
+ options[:exact_phrase] ||= false
290
+ options[:single_passage] ||= false
285
291
 
286
292
  response = Response.new request(:excerpt, excerpts_message(options))
287
293
 
@@ -443,7 +449,13 @@ module Riddle
443
449
  def excerpts_message(options)
444
450
  message = Message.new
445
451
 
446
- message.append [0, 1].pack('N2') # mode = 0, flags = 1
452
+ flags = 1
453
+ flags |= 2 if options[:exact_phrase]
454
+ flags |= 4 if options[:single_passage]
455
+ flags |= 8 if options[:use_boundaries]
456
+ flags |= 16 if options[:weight_order]
457
+
458
+ message.append [0, flags].pack('N2') # 0 = mode
447
459
  message.append_string options[:index]
448
460
  message.append_string options[:words]
449
461
 
@@ -31,7 +31,9 @@ module Riddle
31
31
  when Array
32
32
  message.append_int FilterTypes[:values]
33
33
  message.append_int self.values.length
34
- message.append_ints *self.values
34
+ # using to_f is a hack from the php client - to workaround 32bit
35
+ # signed ints on x32 platforms
36
+ message.append_ints *self.values.collect { |val| val.to_f }
35
37
  end
36
38
  message.append_int self.exclude? ? 1 : 0
37
39
 
@@ -26,7 +26,7 @@ module Riddle
26
26
 
27
27
  # Append a float
28
28
  def append_float(float)
29
- @message << [float].pack('f')
29
+ @message << [float].pack('f').unpack('L*').pack("N")
30
30
  end
31
31
 
32
32
  # Append multiple integers
@@ -30,7 +30,7 @@ module Riddle
30
30
 
31
31
  # Return the next float value from the stream
32
32
  def next_float
33
- float = @str[@marker, 4].unpack('f*').first
33
+ float = @str[@marker, 4].unpack('N*').pack('L').unpack('f*').first
34
34
  @marker += 4
35
35
 
36
36
  return float
@@ -1,5 +1,6 @@
1
1
  require 'mysql'
2
2
  require 'erb'
3
+ require 'yaml'
3
4
 
4
5
  class SphinxHelper
5
6
  attr_accessor :host, :username, :password
@@ -28,7 +28,7 @@ describe Riddle::Client::Message do
28
28
  it "should append floats correctly - packed with f" do
29
29
  message = Riddle::Client::Message.new
30
30
  message.append_float 1.4
31
- message.to_s.should == [1.4].pack('f')
31
+ message.to_s.should == [1.4].pack('f').unpack('L*').pack('N')
32
32
  end
33
33
 
34
34
  it "should append a collection of integers correctly" do
@@ -40,7 +40,7 @@ describe Riddle::Client::Message do
40
40
  it "should append a collection of floats correctly" do
41
41
  message = Riddle::Client::Message.new
42
42
  message.append_floats 1.0, 1.1, 1.2, 1.3
43
- message.to_s.should == [1.0, 1.1, 1.2, 1.3].pack('ffff')
43
+ message.to_s.should == [1.0, 1.1, 1.2, 1.3].pack('ffff').unpack('L*L*L*L*').pack('NNNN')
44
44
  end
45
45
 
46
46
  it "should append an array of strings correctly" do
@@ -58,6 +58,6 @@ describe Riddle::Client::Message do
58
58
  message.append_array ["one", "two"]
59
59
  message.append_floats 1.5, 1.7
60
60
  message.to_s.should == [4, 4].pack('NN') + "test" + [2, 3].pack('NN') +
61
- "one" + [3].pack('N') + "two" + [1.5, 1.7].pack('ff')
61
+ "one" + [3].pack('N') + "two" + [1.5, 1.7].pack('ff').unpack('L*L*').pack('NN')
62
62
  end
63
63
  end
@@ -14,7 +14,7 @@ describe Riddle::Client::Response do
14
14
 
15
15
  # Comparing floats with decimal places doesn't seem to be exact
16
16
  it "should interpret a float correctly" do
17
- Riddle::Client::Response.new([1.0].pack('f')).next_float.should == 1.0
17
+ Riddle::Client::Response.new([1.0].pack('f').unpack('L*').pack('N')).next_float.should == 1.0
18
18
  end
19
19
 
20
20
  it "should interpret an array of strings correctly" do
@@ -53,7 +53,7 @@ describe Riddle::Client::Response do
53
53
 
54
54
  it "should handle a combination of strings, ints, floats and string arrays correctly" do
55
55
  data = [1, 2, 2].pack('NNN') + 'aa' + [2].pack('N') + 'bb' + [4].pack('N') +
56
- "word" + [7, 3, 2, 2, 2].pack('fNNNN')
56
+ "word" + [7].pack('f').unpack('L*').pack('N') + [3, 2, 2, 2].pack('NNNN')
57
57
  response = Riddle::Client::Response.new(data)
58
58
  response.next_int.should == 1
59
59
  response.next_array.should == ['aa', 'bb']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultrasphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7
4
+ version: "1.7"
5
5
  platform: ruby
6
6
  authors:
7
7
  - ""
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2007-12-13 00:00:00 -05:00
33
+ date: 2008-01-12 00:00:00 -05:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -52,9 +52,11 @@ extra_rdoc_files: []
52
52
 
53
53
  files:
54
54
  - CHANGELOG
55
+ - DEPLOYMENT_NOTES
55
56
  - examples/ap.multi
56
57
  - examples/default.base
57
58
  - init.rb
59
+ - lib/ultrasphinx/associations.rb
58
60
  - lib/ultrasphinx/autoload.rb
59
61
  - lib/ultrasphinx/configure.rb
60
62
  - lib/ultrasphinx/core_extensions.rb
@@ -74,6 +76,7 @@ files:
74
76
  - lib/ultrasphinx.rb
75
77
  - LICENSE
76
78
  - Manifest
79
+ - RAKE_TASKS
77
80
  - README
78
81
  - tasks/ultrasphinx.rake
79
82
  - test/config/ultrasphinx/test.base
@@ -88,6 +91,7 @@ files:
88
91
  - test/integration/app/app/helpers/states_helper.rb
89
92
  - test/integration/app/app/helpers/users_helper.rb
90
93
  - test/integration/app/app/models/geo/address.rb
94
+ - test/integration/app/app/models/geo/country.rb
91
95
  - test/integration/app/app/models/geo/state.rb
92
96
  - test/integration/app/app/models/person/user.rb
93
97
  - test/integration/app/app/models/seller.rb
@@ -120,7 +124,6 @@ files:
120
124
  - test/integration/app/config/locomotive.yml
121
125
  - test/integration/app/config/routes.rb
122
126
  - test/integration/app/config/ultrasphinx/default.base
123
- - test/integration/app/config/ultrasphinx/development.conf
124
127
  - test/integration/app/config/ultrasphinx/development.conf.canonical
125
128
  - test/integration/app/db/migrate/001_create_users.rb
126
129
  - test/integration/app/db/migrate/002_create_sellers.rb
@@ -130,7 +133,7 @@ files:
130
133
  - test/integration/app/db/migrate/006_add_deleted_to_user.rb
131
134
  - test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb
132
135
  - test/integration/app/db/migrate/008_add_mission_statement_to_seller.rb
133
- - test/integration/app/db/schema.rb
136
+ - test/integration/app/db/migrate/009_create_countries.rb
134
137
  - test/integration/app/doc/README_FOR_APP
135
138
  - test/integration/app/public/404.html
136
139
  - test/integration/app/public/500.html
@@ -163,6 +166,7 @@ files:
163
166
  - test/integration/app/script/runner
164
167
  - test/integration/app/script/server
165
168
  - test/integration/app/test/fixtures/addresses.yml
169
+ - test/integration/app/test/fixtures/countries.yml
166
170
  - test/integration/app/test/fixtures/sellers.yml
167
171
  - test/integration/app/test/fixtures/states.yml
168
172
  - test/integration/app/test/fixtures/users.yml
@@ -180,6 +184,7 @@ files:
180
184
  - test/integration/server_test.rb
181
185
  - test/integration/spell_test.rb
182
186
  - test/setup.rb
187
+ - test/teardown.rb
183
188
  - test/test_all.rb
184
189
  - test/test_helper.rb
185
190
  - test/ts.multi
@@ -249,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
254
  requirements: []
250
255
 
251
256
  rubyforge_project: fauna
252
- rubygems_version: 0.9.5
257
+ rubygems_version: 1.0.1
253
258
  signing_key:
254
259
  specification_version: 2
255
260
  summary: Ruby on Rails configurator and client to the Sphinx fulltext search engine.