dm-sphinx-adapter 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +12 -19
- data/README.txt +20 -41
- data/Rakefile +2 -3
- data/dm-sphinx-adapter.gemspec +6 -9
- data/lib/dm-sphinx-adapter.rb +14 -11
- data/lib/dm-sphinx-adapter/adapter.rb +36 -62
- data/lib/dm-sphinx-adapter/attribute.rb +48 -3
- data/lib/riddle.rb +28 -0
- data/lib/riddle/client.rb +619 -0
- data/lib/riddle/client/filter.rb +53 -0
- data/lib/riddle/client/message.rb +65 -0
- data/lib/riddle/client/response.rb +84 -0
- data/test/files/model.rb +23 -0
- data/test/files/mysql5.sphinx.conf +97 -0
- data/test/files/mysql5.sql +26 -0
- data/test/helper.rb +51 -0
- data/test/test_adapter.rb +74 -28
- data/test/test_attribute.rb +36 -0
- data/test/test_index.rb +30 -0
- data/test/test_query.rb +47 -32
- data/test/test_resource.rb +17 -0
- metadata +18 -41
- data/lib/dm-sphinx-adapter/client.rb +0 -109
- data/lib/dm-sphinx-adapter/config.rb +0 -122
- data/lib/dm-sphinx-adapter/config_parser.rb +0 -71
- data/test/files/dm_sphinx_adapter_test.sql +0 -21
- data/test/files/resource_explicit.rb +0 -25
- data/test/files/resource_resource.rb +0 -19
- data/test/files/resource_searchable.rb +0 -16
- data/test/files/resource_storage_name.rb +0 -11
- data/test/files/resource_vanilla.rb +0 -7
- data/test/files/sphinx.conf +0 -78
- data/test/test_adapter_explicit.rb +0 -48
- data/test/test_adapter_resource.rb +0 -25
- data/test/test_adapter_searchable.rb +0 -23
- data/test/test_adapter_vanilla.rb +0 -46
- data/test/test_client.rb +0 -31
- data/test/test_config.rb +0 -75
- data/test/test_config_parser.rb +0 -29
- data/test/test_type_attribute.rb +0 -8
- data/test/test_type_index.rb +0 -8
data/test/test_config_parser.rb
DELETED
@@ -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
|
data/test/test_type_attribute.rb
DELETED