shanna-dm-sphinx-adapter 0.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{README.txt → README.rdoc} +13 -0
- data/VERSION.yml +4 -0
- data/lib/dm-sphinx-adapter.rb +1 -1
- data/lib/dm-sphinx-adapter/adapter.rb +2 -2
- data/lib/dm-sphinx-adapter/resource.rb +22 -5
- data/lib/dm-sphinx-adapter/xmlpipe2.rb +94 -0
- data/test/files/source.xml +18 -18
- data/test/files/test_xmlpipe2.xml +1 -0
- data/test/test_query.rb +2 -2
- data/test/test_xmlpipe2.rb +39 -0
- metadata +47 -39
- data/History.txt +0 -42
- data/LICENCE.txt +0 -20
- data/Manifest.txt +0 -26
- data/Rakefile +0 -22
- data/dm-sphinx-adapter.gemspec +0 -38
data/{README.txt → README.rdoc}
RENAMED
@@ -10,11 +10,24 @@ A DataMapper Sphinx adapter.
|
|
10
10
|
|
11
11
|
== Dependencies
|
12
12
|
|
13
|
+
Ruby::
|
13
14
|
* dm-core ~> 0.9.7
|
14
15
|
* dm-is-searchable ~> 0.9.7 (optional)
|
15
16
|
|
16
17
|
I'd recommend using the dm-more plugin dm-is-searchable instead of fetching the document id's yourself.
|
17
18
|
|
19
|
+
Sphinx::
|
20
|
+
* 0.9.8-r871
|
21
|
+
* 0.9.8-r909
|
22
|
+
* 0.9.8-r985
|
23
|
+
* 0.9.8-r1065
|
24
|
+
* 0.9.8-r1112
|
25
|
+
* 0.9.8-rc1 (gem version: 0.9.8.1198)
|
26
|
+
* 0.9.8-rc2 (gem version: 0.9.8.1231)
|
27
|
+
* 0.9.8 (gem version: 0.9.8.1371)
|
28
|
+
|
29
|
+
Internally the Riddle client library is used.
|
30
|
+
|
18
31
|
== Install
|
19
32
|
|
20
33
|
* Via git: git clone git://github.com/shanna/dm-sphinx-adapter.git
|
data/VERSION.yml
ADDED
data/lib/dm-sphinx-adapter.rb
CHANGED
@@ -99,9 +99,9 @@ module DataMapper
|
|
99
99
|
# ==== Returns
|
100
100
|
# Array<DataMapper::Adapters::Sphinx::Index>:: Index objects from the model.
|
101
101
|
def indexes(query)
|
102
|
-
indexes = query.model.sphinx_indexes(
|
102
|
+
indexes = query.model.sphinx_indexes(name) if query.model.respond_to?(:sphinx_indexes)
|
103
103
|
if indexes.nil? or indexes.empty?
|
104
|
-
indexes = [Index.new(query.model, query.model.storage_name(
|
104
|
+
indexes = [Index.new(query.model, query.model.storage_name(name))]
|
105
105
|
end
|
106
106
|
indexes
|
107
107
|
end
|
@@ -21,11 +21,20 @@ module DataMapper
|
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
module Resource
|
24
|
+
|
25
|
+
def self.append_inclusions(*inclusions)
|
26
|
+
extra_inclusions.concat inclusions
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.extra_inclusions
|
31
|
+
@extra_inclusions ||= []
|
32
|
+
end
|
33
|
+
|
24
34
|
def self.included(model) #:nodoc:
|
25
|
-
model.
|
26
|
-
|
27
|
-
|
28
|
-
end
|
35
|
+
model.send(:include, DataMapper::Resource)
|
36
|
+
model.extend ClassMethods if defined?(ClassMethods)
|
37
|
+
extra_inclusions.each{|inclusion| model.send(:include, inclusion)}
|
29
38
|
end
|
30
39
|
|
31
40
|
module ClassMethods
|
@@ -89,7 +98,15 @@ module DataMapper
|
|
89
98
|
# ==== Returns
|
90
99
|
# Array<DataMapper::Adapters::Sphinx::Attribute>
|
91
100
|
def sphinx_attributes(repository_name = default_repository_name)
|
92
|
-
properties(repository_name).
|
101
|
+
properties(repository_name).find_all{|p| p.kind_of? Sphinx::Attribute}
|
102
|
+
end
|
103
|
+
|
104
|
+
# List of properties (aka sphinx fields).
|
105
|
+
#
|
106
|
+
# This list will be the inverse of properties not declared as attributes.
|
107
|
+
# ==== Returns
|
108
|
+
def sphinx_fields(repository_name = default_repository_name)
|
109
|
+
properties(repository_name).reject{|p| p.kind_of? Sphinx::Attribute}
|
93
110
|
end
|
94
111
|
|
95
112
|
end # ClassMethods
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'builder'
|
2
|
+
|
3
|
+
module DataMapper
|
4
|
+
module Adapters
|
5
|
+
module Sphinx
|
6
|
+
|
7
|
+
# Sphinx xmlpipe2.
|
8
|
+
#
|
9
|
+
# Full text search data from any DM adapter without having to implement new Sphinx data sources drivers.
|
10
|
+
#
|
11
|
+
# ==== See
|
12
|
+
# * http://www.sphinxsearch.com/docs/current.html#xmlpipe2
|
13
|
+
#
|
14
|
+
#--
|
15
|
+
# TODO:
|
16
|
+
# * Synopsis.
|
17
|
+
module XmlPipe2
|
18
|
+
def self.included(model)
|
19
|
+
model.extend ClassMethods if defined?(ClassMethods)
|
20
|
+
end
|
21
|
+
|
22
|
+
module ClassMethods
|
23
|
+
|
24
|
+
# Write a Sphinx xmlpipe2 XML stream to $stdout.
|
25
|
+
#
|
26
|
+
# ==== Parameters
|
27
|
+
# source<String>:: The name of the repository to stream from.
|
28
|
+
# destination<String>:: The name of the repository to stream to (contains your sphinx definition).
|
29
|
+
# query<Hash>:: The conditions with which to find the records to stream.
|
30
|
+
#--
|
31
|
+
# TODO:
|
32
|
+
# * in_memory_adapter doesn't call the super constructor so there is no field_naming_convention set in
|
33
|
+
# DataMapper 0.9.10. Submit a patch or live with rescue and field.name clause?
|
34
|
+
# * Keys that aren't called .id?
|
35
|
+
# * Composite keys?
|
36
|
+
# * Method for schema and documents.
|
37
|
+
# * Less poking round in the internals of the :default adapter if I can?
|
38
|
+
# * Destination should always be a dm-sphinx-adapter adapter.
|
39
|
+
# * Optional schema since it overrides any schema you might define in the sphinx configuration.
|
40
|
+
# * Schema default values from DM property default values.
|
41
|
+
def xmlpipe2(source, destination = :default, query = {})
|
42
|
+
builder = Builder::XmlMarkup.new(:target => $stdout)
|
43
|
+
builder.instruct!
|
44
|
+
builder.sphinx(:docset, :'xmlns:sphinx' => 'sphinx') do
|
45
|
+
|
46
|
+
builder.sphinx(:schema) do
|
47
|
+
sphinx_fields(destination).each do |field|
|
48
|
+
builder.sphinx(:field, :name => (field.field(destination) rescue field.name))
|
49
|
+
end
|
50
|
+
sphinx_attributes(destination).each do |attr|
|
51
|
+
builder.sphinx(:attr, {
|
52
|
+
:name => (attr.field(destination) rescue attr.name),
|
53
|
+
:type => xmlpipe2_type(attr.primitive)
|
54
|
+
})
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
all(query.merge(:repository => repository(source))).map do |resource|
|
59
|
+
builder.sphinx(:document, :id => resource.id) do |document|
|
60
|
+
properties(destination).each do |property|
|
61
|
+
# TODO: Pretty sure this isn't the correct way to get and typecast.
|
62
|
+
builder.tag!((property.field(destination) rescue property.name)) do |field|
|
63
|
+
field.cdata!(property.typecast(property.get(resource)))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
def xmlpipe2_type(primitive) #:nodoc:
|
73
|
+
{
|
74
|
+
Integer => 'int',
|
75
|
+
Float => 'float',
|
76
|
+
BigDecimal => 'float',
|
77
|
+
DateTime => 'timestamp',
|
78
|
+
Date => 'timestamp',
|
79
|
+
Time => 'timestamp',
|
80
|
+
TrueClass => 'bool',
|
81
|
+
String => 'str2ordinal',
|
82
|
+
DataMapper::Types::Text => 'str2ordinal'
|
83
|
+
}[primitive]
|
84
|
+
end
|
85
|
+
|
86
|
+
end # ClassMethods
|
87
|
+
end # XmlPipe2
|
88
|
+
|
89
|
+
# Include XmlPipe2 in all DM::A::SphinxResource models when you require this file.
|
90
|
+
Resource.append_inclusions XmlPipe2
|
91
|
+
end # Sphinx
|
92
|
+
end # Adapters
|
93
|
+
end # DataMapper
|
94
|
+
|
data/test/files/source.xml
CHANGED
@@ -10,30 +10,30 @@
|
|
10
10
|
</sphinx:schema>
|
11
11
|
|
12
12
|
<sphinx:document id="1">
|
13
|
-
<t_string
|
14
|
-
<t_text
|
15
|
-
<t_decimal
|
16
|
-
<t_float
|
17
|
-
<t_integer
|
18
|
-
<t_datetime
|
13
|
+
<t_string><![CDATA[one]]></t_string>
|
14
|
+
<t_text><![CDATA[text one!]]></t_text>
|
15
|
+
<t_decimal><![CDATA[10.5]]></t_decimal>
|
16
|
+
<t_float><![CDATA[100.5]]></t_float>
|
17
|
+
<t_integer><![CDATA[1000]]></t_integer>
|
18
|
+
<t_datetime><![CDATA[1235183682]]></t_datetime>
|
19
19
|
</sphinx:document>
|
20
20
|
|
21
21
|
<sphinx:document id="2">
|
22
|
-
<t_string
|
23
|
-
<t_text
|
24
|
-
<t_decimal
|
25
|
-
<t_float
|
26
|
-
<t_integer
|
27
|
-
<t_datetime
|
22
|
+
<t_string><![CDATA[two]]></t_string>
|
23
|
+
<t_text><![CDATA[text two!]]></t_text>
|
24
|
+
<t_decimal><![CDATA[20.5]]></t_decimal>
|
25
|
+
<t_float><![CDATA[200.5]]></t_float>
|
26
|
+
<t_integer><![CDATA[2000]]></t_integer>
|
27
|
+
<t_datetime><![CDATA[1235183682]]></t_datetime>
|
28
28
|
</sphinx:document>
|
29
29
|
|
30
30
|
<sphinx:document id="3">
|
31
|
-
<t_string
|
32
|
-
<t_text
|
33
|
-
<t_decimal
|
34
|
-
<t_float
|
35
|
-
<t_integer
|
36
|
-
<t_datetime
|
31
|
+
<t_string><![CDATA[three]]></t_string>
|
32
|
+
<t_text><![CDATA[text three!]]></t_text>
|
33
|
+
<t_decimal><![CDATA[30.5]]></t_decimal>
|
34
|
+
<t_float><![CDATA[300.5]]></t_float>
|
35
|
+
<t_integer><![CDATA[3000]]></t_integer>
|
36
|
+
<t_datetime><![CDATA[1235183682]]></t_datetime>
|
37
37
|
</sphinx:document>
|
38
38
|
</sphinx:docset>
|
39
39
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><sphinx:docset xmlns:sphinx="sphinx"><sphinx:schema><sphinx:field name="id"/><sphinx:field name="t_string"/><sphinx:attr type="str2ordinal" name="t_text"/><sphinx:attr type="float" name="t_decimal"/><sphinx:attr type="float" name="t_float"/><sphinx:attr type="int" name="t_integer"/><sphinx:attr type="timestamp" name="t_datetime"/></sphinx:schema><sphinx:document id="1"><id><![CDATA[1]]></id><t_string><![CDATA[one]]></t_string><t_text><![CDATA[text one!]]></t_text><t_decimal><![CDATA[0.01]]></t_decimal><t_float><![CDATA[0.0001]]></t_float><t_integer><![CDATA[1]]></t_integer><t_datetime><![CDATA[1235914716]]></t_datetime></sphinx:document></sphinx:docset>
|
data/test/test_query.rb
CHANGED
@@ -38,9 +38,9 @@ class TestQuery < Test::Unit::TestCase
|
|
38
38
|
|
39
39
|
should 'treat multiple .eql operators as AND search' do
|
40
40
|
# When is DM going to switch conditions to an array? :(
|
41
|
-
assert
|
41
|
+
assert(/(?:@t_string "b" )?@t_string "a"(?: @t_string "b")?/.match(
|
42
42
|
query_string(:t_string.eql => 'a', :t_string.eql => 'b')
|
43
|
-
)
|
43
|
+
))
|
44
44
|
end
|
45
45
|
|
46
46
|
should 'leave raw conditions as they are' do
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
+
require 'dm-sphinx-adapter/xmlpipe2'
|
3
|
+
|
4
|
+
class TestResource < Test::Unit::TestCase
|
5
|
+
context 'DM::A::Sphinx::Resource module' do
|
6
|
+
setup do
|
7
|
+
load File.join(File.dirname(__FILE__), 'files', 'model.rb')
|
8
|
+
end
|
9
|
+
|
10
|
+
should 'respond to #xmlpipe2' do
|
11
|
+
assert_respond_to Item, :xmlpipe2
|
12
|
+
end
|
13
|
+
|
14
|
+
context '#xmlpipe2' do
|
15
|
+
should 'stream to stdout' do
|
16
|
+
$stdout = StringIO.new
|
17
|
+
Item.create(
|
18
|
+
:id => 1,
|
19
|
+
:t_string => 'one',
|
20
|
+
:t_text => "text one!",
|
21
|
+
:t_decimal => BigDecimal.new('0.01'),
|
22
|
+
:t_float => 0.0001,
|
23
|
+
:t_integer => 1,
|
24
|
+
:t_datetime => Time.at(1235914716)
|
25
|
+
)
|
26
|
+
Item.xmlpipe2(:default, :search)
|
27
|
+
xml = $stdout.rewind && $stdout.read
|
28
|
+
$stdout = STDOUT
|
29
|
+
|
30
|
+
# TODO: Nokogiri or something and test some xpaths instead of a big eq match.
|
31
|
+
assert_equal(
|
32
|
+
File.open(File.join(File.dirname(__FILE__), 'files', 'test_xmlpipe2.xml')).read.chomp,
|
33
|
+
xml
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shanna-dm-sphinx-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Hanna
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,63 +20,75 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.9
|
23
|
+
version: "0.9"
|
24
24
|
version:
|
25
|
-
|
26
|
-
|
27
|
-
type: :development
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.8.3
|
34
|
-
version:
|
35
|
-
description: A DataMapper Sphinx adapter.
|
36
|
-
email:
|
37
|
-
- shane.hanna@gmail.com
|
25
|
+
description:
|
26
|
+
email: shane.hanna@gmail.com
|
38
27
|
executables: []
|
39
28
|
|
40
29
|
extensions: []
|
41
30
|
|
42
31
|
extra_rdoc_files:
|
43
|
-
-
|
44
|
-
- LICENCE.txt
|
45
|
-
- Manifest.txt
|
46
|
-
- README.txt
|
32
|
+
- README.rdoc
|
47
33
|
files:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
- README.txt
|
52
|
-
- Rakefile
|
53
|
-
- dm-sphinx-adapter.gemspec
|
54
|
-
- lib/dm-sphinx-adapter.rb
|
34
|
+
- README.rdoc
|
35
|
+
- VERSION.yml
|
36
|
+
- lib/dm-sphinx-adapter
|
55
37
|
- lib/dm-sphinx-adapter/adapter.rb
|
56
38
|
- lib/dm-sphinx-adapter/attribute.rb
|
57
39
|
- lib/dm-sphinx-adapter/index.rb
|
58
40
|
- lib/dm-sphinx-adapter/query.rb
|
59
41
|
- lib/dm-sphinx-adapter/resource.rb
|
60
|
-
- lib/
|
61
|
-
- lib/
|
42
|
+
- lib/dm-sphinx-adapter/xmlpipe2.rb
|
43
|
+
- lib/dm-sphinx-adapter.rb
|
44
|
+
- lib/riddle
|
45
|
+
- lib/riddle/client
|
62
46
|
- lib/riddle/client/filter.rb
|
63
47
|
- lib/riddle/client/message.rb
|
64
48
|
- lib/riddle/client/response.rb
|
49
|
+
- lib/riddle/client.rb
|
50
|
+
- lib/riddle.rb
|
51
|
+
- test/files
|
65
52
|
- test/files/model.rb
|
66
53
|
- test/files/source.xml
|
67
54
|
- test/files/sphinx.conf
|
55
|
+
- test/files/test_xmlpipe2.xml
|
56
|
+
- test/files/tmp
|
57
|
+
- test/files/tmp/items.spa
|
58
|
+
- test/files/tmp/items.spd
|
59
|
+
- test/files/tmp/items.sph
|
60
|
+
- test/files/tmp/items.spi
|
61
|
+
- test/files/tmp/items.spl
|
62
|
+
- test/files/tmp/items.spm
|
63
|
+
- test/files/tmp/items.spp
|
64
|
+
- test/files/tmp/items_delta.spa
|
65
|
+
- test/files/tmp/items_delta.spd
|
66
|
+
- test/files/tmp/items_delta.sph
|
67
|
+
- test/files/tmp/items_delta.spi
|
68
|
+
- test/files/tmp/items_delta.spm
|
69
|
+
- test/files/tmp/items_delta.spp
|
70
|
+
- test/files/tmp/items_main.spa
|
71
|
+
- test/files/tmp/items_main.spd
|
72
|
+
- test/files/tmp/items_main.sph
|
73
|
+
- test/files/tmp/items_main.spi
|
74
|
+
- test/files/tmp/items_main.spm
|
75
|
+
- test/files/tmp/items_main.spp
|
76
|
+
- test/files/tmp/sphinx.log
|
77
|
+
- test/files/tmp/sphinx.pid
|
78
|
+
- test/files/tmp/sphinx.query.log
|
68
79
|
- test/helper.rb
|
69
80
|
- test/test_adapter.rb
|
70
81
|
- test/test_attribute.rb
|
71
82
|
- test/test_index.rb
|
72
83
|
- test/test_query.rb
|
73
84
|
- test/test_resource.rb
|
85
|
+
- test/test_xmlpipe2.rb
|
74
86
|
has_rdoc: true
|
75
|
-
homepage: http://dm-sphinx
|
87
|
+
homepage: http://github.com/shanna/dm-sphinx-adapter
|
76
88
|
post_install_message:
|
77
89
|
rdoc_options:
|
78
|
-
- --
|
79
|
-
-
|
90
|
+
- --inline-source
|
91
|
+
- --charset=UTF-8
|
80
92
|
require_paths:
|
81
93
|
- lib
|
82
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -93,14 +105,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
105
|
version:
|
94
106
|
requirements: []
|
95
107
|
|
96
|
-
rubyforge_project:
|
108
|
+
rubyforge_project:
|
97
109
|
rubygems_version: 1.2.0
|
98
110
|
signing_key:
|
99
111
|
specification_version: 2
|
100
112
|
summary: A DataMapper Sphinx adapter.
|
101
|
-
test_files:
|
102
|
-
|
103
|
-
- test/test_attribute.rb
|
104
|
-
- test/test_index.rb
|
105
|
-
- test/test_query.rb
|
106
|
-
- test/test_resource.rb
|
113
|
+
test_files: []
|
114
|
+
|
data/History.txt
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
=== 0.7 / 2009-02-21
|
2
|
-
|
3
|
-
* Explicit repository names everywhere I can. DM ~> 0.9.10 and dm-sphinx-adapter 0.6.2 couldn't guess the default repository name.
|
4
|
-
|
5
|
-
=== 0.6.2 / 2008-12-16
|
6
|
-
|
7
|
-
* Fixed shallow .dup of riddle client errors. You need to upgrade if you are running 0.6.1.
|
8
|
-
|
9
|
-
=== 0.6.1 / 2008-12-16
|
10
|
-
|
11
|
-
* The adapter returns the entire Riddle::Client#query response so document :weight and :attributes are usable.
|
12
|
-
* Fixed broken naming convention bug. The AbstractAdapter constructor was not being called.
|
13
|
-
|
14
|
-
=== 0.6 / 2008-12-13
|
15
|
-
|
16
|
-
* Removed managed client and all related libs.
|
17
|
-
* Switched to Shoulda for tests in an effort to clean them up a bit.
|
18
|
-
|
19
|
-
=== 0.5 / 2008-12-01
|
20
|
-
|
21
|
-
* Moved sphinx extended query string generator into a class of its own.
|
22
|
-
* Improved generated extended query syntax and added tests.
|
23
|
-
* Support for sphinx "" phrase search operator (dm conditions as array).
|
24
|
-
* Support for sphinx | OR operator (dm conditions using {:field.in => %w{}}).
|
25
|
-
|
26
|
-
=== 0.4 / 2008-11-21
|
27
|
-
|
28
|
-
* Fixed broken dm-is-searchable support.
|
29
|
-
* Bumped version because the read_one/read_many result structure had to change to support dm-is-searchable.
|
30
|
-
|
31
|
-
=== 0.3 / 2008-11-18
|
32
|
-
|
33
|
-
* Removed calls to indexer on create/update. See README.txt
|
34
|
-
* Made the client object available from the adapter.
|
35
|
-
|
36
|
-
=== 0.2 / 2008-11-09
|
37
|
-
|
38
|
-
* Addributes.
|
39
|
-
* Self managed searchd daemon if you want it.
|
40
|
-
|
41
|
-
=== 0.1 / 2008-10-24
|
42
|
-
|
data/LICENCE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2008 Shane Hanna
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
History.txt
|
2
|
-
LICENCE.txt
|
3
|
-
Manifest.txt
|
4
|
-
README.txt
|
5
|
-
Rakefile
|
6
|
-
dm-sphinx-adapter.gemspec
|
7
|
-
lib/dm-sphinx-adapter.rb
|
8
|
-
lib/dm-sphinx-adapter/adapter.rb
|
9
|
-
lib/dm-sphinx-adapter/attribute.rb
|
10
|
-
lib/dm-sphinx-adapter/index.rb
|
11
|
-
lib/dm-sphinx-adapter/query.rb
|
12
|
-
lib/dm-sphinx-adapter/resource.rb
|
13
|
-
lib/riddle.rb
|
14
|
-
lib/riddle/client.rb
|
15
|
-
lib/riddle/client/filter.rb
|
16
|
-
lib/riddle/client/message.rb
|
17
|
-
lib/riddle/client/response.rb
|
18
|
-
test/files/model.rb
|
19
|
-
test/files/source.xml
|
20
|
-
test/files/sphinx.conf
|
21
|
-
test/helper.rb
|
22
|
-
test/test_adapter.rb
|
23
|
-
test/test_attribute.rb
|
24
|
-
test/test_index.rb
|
25
|
-
test/test_query.rb
|
26
|
-
test/test_resource.rb
|
data/Rakefile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'hoe'
|
5
|
-
|
6
|
-
Hoe.new('dm-sphinx-adapter', '0.7') do |p|
|
7
|
-
p.developer('Shane Hanna', 'shane.hanna@gmail.com')
|
8
|
-
p.extra_deps = [
|
9
|
-
['dm-core', '~> 0.9.10']
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
# http://blog.behindlogic.com/2008/10/auto-generate-your-manifest-and-gemspec.html
|
14
|
-
desc 'Rebuild manifest and gemspec.'
|
15
|
-
task :cultivate do
|
16
|
-
Dir.chdir(File.dirname(__FILE__)) do #TODO: Is this required?
|
17
|
-
system %q{git ls-files | grep -v "\.gitignore" > Manifest.txt}
|
18
|
-
system %q{rake debug_gem | grep -v "(in " > `basename \`pwd\``.gemspec}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# vim: syntax=Ruby
|
data/dm-sphinx-adapter.gemspec
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{dm-sphinx-adapter}
|
5
|
-
s.version = "0.7"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Shane Hanna"]
|
9
|
-
s.date = %q{2009-02-21}
|
10
|
-
s.description = %q{A DataMapper Sphinx adapter.}
|
11
|
-
s.email = ["shane.hanna@gmail.com"]
|
12
|
-
s.extra_rdoc_files = ["History.txt", "LICENCE.txt", "Manifest.txt", "README.txt"]
|
13
|
-
s.files = ["History.txt", "LICENCE.txt", "Manifest.txt", "README.txt", "Rakefile", "dm-sphinx-adapter.gemspec", "lib/dm-sphinx-adapter.rb", "lib/dm-sphinx-adapter/adapter.rb", "lib/dm-sphinx-adapter/attribute.rb", "lib/dm-sphinx-adapter/index.rb", "lib/dm-sphinx-adapter/query.rb", "lib/dm-sphinx-adapter/resource.rb", "lib/riddle.rb", "lib/riddle/client.rb", "lib/riddle/client/filter.rb", "lib/riddle/client/message.rb", "lib/riddle/client/response.rb", "test/files/model.rb", "test/files/source.xml", "test/files/sphinx.conf", "test/helper.rb", "test/test_adapter.rb", "test/test_attribute.rb", "test/test_index.rb", "test/test_query.rb", "test/test_resource.rb"]
|
14
|
-
s.has_rdoc = true
|
15
|
-
s.homepage = %q{http://dm-sphinx.rubyforge.org}
|
16
|
-
s.rdoc_options = ["--main", "README.txt"]
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = %q{dm-sphinx-adapter}
|
19
|
-
s.rubygems_version = %q{1.3.1}
|
20
|
-
s.summary = %q{A DataMapper Sphinx adapter.}
|
21
|
-
s.test_files = ["test/test_adapter.rb", "test/test_attribute.rb", "test/test_index.rb", "test/test_query.rb", "test/test_resource.rb"]
|
22
|
-
|
23
|
-
if s.respond_to? :specification_version then
|
24
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
-
s.specification_version = 2
|
26
|
-
|
27
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 0.9.10"])
|
29
|
-
s.add_development_dependency(%q<hoe>, [">= 1.8.3"])
|
30
|
-
else
|
31
|
-
s.add_dependency(%q<dm-core>, ["~> 0.9.10"])
|
32
|
-
s.add_dependency(%q<hoe>, [">= 1.8.3"])
|
33
|
-
end
|
34
|
-
else
|
35
|
-
s.add_dependency(%q<dm-core>, ["~> 0.9.10"])
|
36
|
-
s.add_dependency(%q<hoe>, [">= 1.8.3"])
|
37
|
-
end
|
38
|
-
end
|