dm-sphinx-adapter 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/History.txt +5 -0
  2. data/Manifest.txt +12 -19
  3. data/README.txt +20 -41
  4. data/Rakefile +2 -3
  5. data/dm-sphinx-adapter.gemspec +6 -9
  6. data/lib/dm-sphinx-adapter.rb +14 -11
  7. data/lib/dm-sphinx-adapter/adapter.rb +36 -62
  8. data/lib/dm-sphinx-adapter/attribute.rb +48 -3
  9. data/lib/riddle.rb +28 -0
  10. data/lib/riddle/client.rb +619 -0
  11. data/lib/riddle/client/filter.rb +53 -0
  12. data/lib/riddle/client/message.rb +65 -0
  13. data/lib/riddle/client/response.rb +84 -0
  14. data/test/files/model.rb +23 -0
  15. data/test/files/mysql5.sphinx.conf +97 -0
  16. data/test/files/mysql5.sql +26 -0
  17. data/test/helper.rb +51 -0
  18. data/test/test_adapter.rb +74 -28
  19. data/test/test_attribute.rb +36 -0
  20. data/test/test_index.rb +30 -0
  21. data/test/test_query.rb +47 -32
  22. data/test/test_resource.rb +17 -0
  23. metadata +18 -41
  24. data/lib/dm-sphinx-adapter/client.rb +0 -109
  25. data/lib/dm-sphinx-adapter/config.rb +0 -122
  26. data/lib/dm-sphinx-adapter/config_parser.rb +0 -71
  27. data/test/files/dm_sphinx_adapter_test.sql +0 -21
  28. data/test/files/resource_explicit.rb +0 -25
  29. data/test/files/resource_resource.rb +0 -19
  30. data/test/files/resource_searchable.rb +0 -16
  31. data/test/files/resource_storage_name.rb +0 -11
  32. data/test/files/resource_vanilla.rb +0 -7
  33. data/test/files/sphinx.conf +0 -78
  34. data/test/test_adapter_explicit.rb +0 -48
  35. data/test/test_adapter_resource.rb +0 -25
  36. data/test/test_adapter_searchable.rb +0 -23
  37. data/test/test_adapter_vanilla.rb +0 -46
  38. data/test/test_client.rb +0 -31
  39. data/test/test_config.rb +0 -75
  40. data/test/test_config_parser.rb +0 -29
  41. data/test/test_type_attribute.rb +0 -8
  42. data/test/test_type_index.rb +0 -8
@@ -1,29 +0,0 @@
1
- require 'test/unit'
2
- require 'dm-sphinx-adapter'
3
-
4
- class TestConfigParser < Test::Unit::TestCase
5
- def setup
6
- base = Pathname(__FILE__).dirname.expand_path
7
- @config = base / 'files' / 'sphinx.conf'
8
- @log = base / 'var' / 'sphinx.log'
9
- end
10
-
11
- def test_parse
12
- assert_nothing_raised{ parse }
13
- assert_raise(Errno::ENOENT){ parse('blah') }
14
- assert_raise(RuntimeError){ parse(@log) }
15
- end
16
-
17
- def test_searchd
18
- assert_kind_of Hash, searchd = parse
19
- assert_equal 'localhost', searchd['address']
20
- assert_equal '3312', searchd['port']
21
- assert_equal 'test/var/sphinx.pid', searchd['pid_file']
22
- assert_equal 'test/var/sphinx.log', searchd['log']
23
- end
24
-
25
- protected
26
- def parse(config = @config)
27
- DataMapper::Adapters::Sphinx::ConfigParser.parse(config)
28
- end
29
- end # TestConfigParser
@@ -1,8 +0,0 @@
1
- require 'dm-sphinx-adapter'
2
-
3
- class TestTypeAttribute < Test::Unit::TestCase
4
- def test_initialize
5
- # TODO:
6
- assert true
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require 'dm-sphinx-adapter'
2
-
3
- class TestTypeIndex < Test::Unit::TestCase
4
- def test_initialize
5
- # TODO:
6
- assert true
7
- end
8
- end