riddle 1.3.3 → 1.4.0
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.
- data/README.textile +5 -0
- data/lib/riddle.rb +12 -0
- data/lib/riddle/0.9.9/configuration/searchd.rb +8 -4
- data/lib/riddle/client.rb +7 -7
- data/lib/riddle/client/message.rb +1 -3
- data/lib/riddle/client/response.rb +13 -13
- data/lib/riddle/configuration/distributed_index.rb +7 -3
- data/lib/riddle/configuration/index.rb +16 -12
- data/lib/riddle/configuration/indexer.rb +7 -3
- data/lib/riddle/configuration/realtime_index.rb +6 -2
- data/lib/riddle/configuration/searchd.rb +16 -11
- data/lib/riddle/configuration/section.rb +2 -4
- data/lib/riddle/configuration/sql_source.rb +16 -12
- data/lib/riddle/configuration/xml_source.rb +9 -5
- data/lib/riddle/controller.rb +3 -3
- data/spec/riddle/configuration_spec.rb +24 -1
- data/spec/spec_helper.rb +4 -0
- data/spec/sphinx_helper.rb +1 -1
- data/spec/unit/configuration/searchd_spec.rb +82 -4
- metadata +3 -3
data/README.textile
CHANGED
data/lib/riddle.rb
CHANGED
@@ -1,13 +1,24 @@
|
|
1
|
+
require 'thread'
|
1
2
|
require 'socket'
|
2
3
|
require 'timeout'
|
3
4
|
|
4
5
|
module Riddle #:nodoc:
|
5
6
|
@@mutex = Mutex.new
|
6
7
|
@@escape_pattern = /[\(\)\|\-!@~"&\/]/
|
8
|
+
@@use_encoding = defined?(::Encoding) &&
|
9
|
+
::Encoding.respond_to?(:default_external)
|
7
10
|
|
8
11
|
class ConnectionError < StandardError #:nodoc:
|
9
12
|
#
|
10
13
|
end
|
14
|
+
|
15
|
+
def self.encode(data, encoding = defined?(::Encoding) && ::Encoding.default_external)
|
16
|
+
if @@use_encoding
|
17
|
+
data.force_encoding(encoding)
|
18
|
+
else
|
19
|
+
data
|
20
|
+
end
|
21
|
+
end
|
11
22
|
|
12
23
|
def self.mutex
|
13
24
|
@@mutex
|
@@ -51,6 +62,7 @@ lines after "require 'riddle'" to avoid this warning.
|
|
51
62
|
|
52
63
|
}
|
53
64
|
end
|
65
|
+
|
54
66
|
end
|
55
67
|
|
56
68
|
require 'riddle/auto_version'
|
@@ -5,16 +5,20 @@ module Riddle
|
|
5
5
|
set_listen
|
6
6
|
clear_deprecated
|
7
7
|
|
8
|
-
!( @listen.nil? || @pid_file.nil? )
|
8
|
+
!( @listen.nil? || @listen.empty? || @pid_file.nil? )
|
9
9
|
end
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def set_listen
|
14
|
-
return unless @listen.nil?
|
14
|
+
return unless @listen.nil? || @listen.empty?
|
15
15
|
|
16
|
-
@listen =
|
17
|
-
@listen
|
16
|
+
@listen = []
|
17
|
+
@listen << @port.to_s if @port
|
18
|
+
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
|
19
|
+
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(Fixnum)
|
20
|
+
|
21
|
+
@listen.each { |l| l.insert(0, "#{@address}:") } if @address
|
18
22
|
end
|
19
23
|
|
20
24
|
def clear_deprecated
|
data/lib/riddle/client.rb
CHANGED
@@ -246,7 +246,7 @@ module Riddle
|
|
246
246
|
result[:fields] = response.next_array
|
247
247
|
|
248
248
|
attributes = response.next_int
|
249
|
-
|
249
|
+
attributes.times do
|
250
250
|
attribute_name = response.next
|
251
251
|
type = response.next_int
|
252
252
|
|
@@ -278,7 +278,7 @@ module Riddle
|
|
278
278
|
result[:time] = ('%.3f' % (response.next_int / 1000.0)).to_f || 0.0
|
279
279
|
|
280
280
|
words = response.next_int
|
281
|
-
|
281
|
+
words.times do
|
282
282
|
word = response.next
|
283
283
|
docs = response.next_int
|
284
284
|
hits = response.next_int
|
@@ -615,11 +615,7 @@ module Riddle
|
|
615
615
|
status = -1
|
616
616
|
version = 0
|
617
617
|
length = 0
|
618
|
-
message = Array(messages).join("")
|
619
|
-
|
620
|
-
if message.respond_to?(:force_encoding)
|
621
|
-
message = message.force_encoding('ASCII-8BIT')
|
622
|
-
end
|
618
|
+
message = Riddle.encode(Array(messages).join(""), 'ASCII-8BIT')
|
623
619
|
|
624
620
|
connect do |socket|
|
625
621
|
case command
|
@@ -642,6 +638,10 @@ module Riddle
|
|
642
638
|
|
643
639
|
while response.length < (length || 0)
|
644
640
|
part = socket.recv(length - response.length)
|
641
|
+
|
642
|
+
# will return 0 bytes if remote side closed TCP connection, e.g, searchd segfaulted.
|
643
|
+
break if part.length == 0 && socket.is_a?(TcpSocket)
|
644
|
+
|
645
645
|
response << part if part
|
646
646
|
end
|
647
647
|
end
|
@@ -15,9 +15,7 @@ module Riddle
|
|
15
15
|
|
16
16
|
# Append a string's length, then the string itself
|
17
17
|
def append_string(str)
|
18
|
-
string = str.
|
19
|
-
str.dup.force_encoding('ASCII-8BIT') : str
|
20
|
-
|
18
|
+
string = Riddle.encode(str.dup, 'ASCII-8BIT')
|
21
19
|
@message << [string.send(@size_method)].pack('N') + string
|
22
20
|
end
|
23
21
|
|
@@ -17,7 +17,7 @@ module Riddle
|
|
17
17
|
result = @str[@marker, len]
|
18
18
|
@marker += len
|
19
19
|
|
20
|
-
|
20
|
+
Riddle.encode(result)
|
21
21
|
end
|
22
22
|
|
23
23
|
# Return the next integer value from the stream
|
@@ -25,14 +25,14 @@ module Riddle
|
|
25
25
|
int = @str[@marker, 4].unpack('N*').first
|
26
26
|
@marker += 4
|
27
27
|
|
28
|
-
|
28
|
+
int
|
29
29
|
end
|
30
30
|
|
31
31
|
def next_64bit_int
|
32
32
|
high, low = @str[@marker, 8].unpack('N*N*')[0..1]
|
33
33
|
@marker += 8
|
34
34
|
|
35
|
-
|
35
|
+
(high << 32) + low
|
36
36
|
end
|
37
37
|
|
38
38
|
# Return the next float value from the stream
|
@@ -40,49 +40,49 @@ module Riddle
|
|
40
40
|
float = @str[@marker, 4].unpack('N*').pack('L').unpack('f*').first
|
41
41
|
@marker += 4
|
42
42
|
|
43
|
-
|
43
|
+
float
|
44
44
|
end
|
45
45
|
|
46
46
|
# Returns an array of string items
|
47
47
|
def next_array
|
48
48
|
count = next_int
|
49
49
|
items = []
|
50
|
-
|
50
|
+
count.times do
|
51
51
|
items << self.next
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
items
|
55
55
|
end
|
56
56
|
|
57
57
|
# Returns an array of int items
|
58
58
|
def next_int_array
|
59
59
|
count = next_int
|
60
60
|
items = []
|
61
|
-
|
61
|
+
count.times do
|
62
62
|
items << self.next_int
|
63
63
|
end
|
64
64
|
|
65
|
-
|
65
|
+
items
|
66
66
|
end
|
67
67
|
|
68
68
|
def next_float_array
|
69
69
|
count = next_int
|
70
70
|
items = []
|
71
|
-
|
71
|
+
count.times do
|
72
72
|
items << self.next_float
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
items
|
76
76
|
end
|
77
77
|
|
78
78
|
def next_64bit_int_array
|
79
79
|
count = next_int
|
80
80
|
items = []
|
81
|
-
|
81
|
+
count.times do
|
82
82
|
items << self.next_64bit_int
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
items
|
86
86
|
end
|
87
87
|
|
88
88
|
# Returns the length of the streamed data
|
@@ -91,4 +91,4 @@ module Riddle
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
94
|
-
end
|
94
|
+
end
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class DistributedIndex < Riddle::Configuration::Section
|
4
|
-
self.settings
|
5
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:type, :local, :agent, :agent_blackhole,
|
7
|
+
:agent_connect_timeout, :agent_query_timeout
|
8
|
+
]
|
9
|
+
end
|
6
10
|
|
7
11
|
attr_accessor :name, :local_indexes, :remote_indexes, :agent_blackhole,
|
8
12
|
:agent_connect_timeout, :agent_query_timeout
|
@@ -46,4 +50,4 @@ module Riddle
|
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
49
|
-
end
|
53
|
+
end
|
@@ -1,17 +1,21 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class Index < Riddle::Configuration::Section
|
4
|
-
self.settings
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:type, :source, :path, :docinfo, :mlock, :morphology,
|
7
|
+
:dict, :index_sp, :index_zones, :min_stemming_len, :stopwords,
|
8
|
+
:wordforms, :exceptions, :min_word_len, :charset_dictpath,
|
9
|
+
:charset_type, :charset_table, :ignore_chars, :min_prefix_len,
|
10
|
+
:min_infix_len, :prefix_fields, :infix_fields, :enable_star,
|
11
|
+
:expand_keywords, :ngram_len, :ngram_chars, :phrase_boundary,
|
12
|
+
:phrase_boundary_step, :blend_chars, :blend_mode, :html_strip,
|
13
|
+
:html_index_attrs, :html_remove_elements, :preopen, :ondisk_dict,
|
14
|
+
:inplace_enable, :inplace_hit_gap, :inplace_docinfo_gap,
|
15
|
+
:inplace_reloc_factor, :inplace_write_factor, :index_exact_words,
|
16
|
+
:overshort_step, :stopwords_step, :hitless_words
|
17
|
+
]
|
18
|
+
end
|
15
19
|
|
16
20
|
attr_accessor :name, :parent, :type, :sources, :path, :docinfo, :mlock,
|
17
21
|
:morphologies, :dict, :index_sp, :index_zones, :min_stemming_len,
|
@@ -149,4 +153,4 @@ module Riddle
|
|
149
153
|
end
|
150
154
|
end
|
151
155
|
end
|
152
|
-
end
|
156
|
+
end
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class Indexer < Riddle::Configuration::Section
|
4
|
-
self.settings
|
5
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:mem_limit, :max_iops, :max_iosize, :max_xmlpipe2_field,
|
7
|
+
:write_buffer, :max_file_field_buffer
|
8
|
+
]
|
9
|
+
end
|
6
10
|
|
7
11
|
attr_accessor *self.settings
|
8
12
|
|
@@ -17,4 +21,4 @@ module Riddle
|
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
20
|
-
end
|
24
|
+
end
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class RealtimeIndex < Riddle::Configuration::Section
|
4
|
-
self.settings
|
5
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:type, :path, :rt_mem_limit, :rt_field, :rt_attr_uint,
|
7
|
+
:rt_attr_bigint, :rt_attr_float, :rt_attr_timestamp, :rt_attr_string
|
8
|
+
]
|
9
|
+
end
|
6
10
|
|
7
11
|
attr_accessor :name
|
8
12
|
attr_accessor *self.settings
|
@@ -1,19 +1,24 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class Searchd < Riddle::Configuration::Section
|
4
|
-
self.settings
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:listen, :address, :port, :log, :query_log,
|
7
|
+
:query_log_format, :read_timeout, :client_timeout, :max_children,
|
8
|
+
:pid_file, :max_matches, :seamless_rotate, :preopen_indexes,
|
9
|
+
:unlink_old, :attr_flush_period, :ondisk_dict_default, :max_packet_size,
|
10
|
+
:mva_updates_pool, :crash_log_path, :max_filters, :max_filter_values,
|
11
|
+
:listen_backlog, :read_buffer, :read_unhinted, :max_batch_queries,
|
12
|
+
:subtree_docs_cache, :subtree_hits_cache, :workers, :dist_threads,
|
13
|
+
:binlog_path, :binlog_flush, :binlog_max_log_size, :collation_server,
|
14
|
+
:collation_libc_locale, :plugin_dir, :mysql_version_string,
|
15
|
+
:rt_flush_period, :thread_stack, :expansion_limit,
|
16
|
+
:compat_sphinxql_magics, :watchdog, :client_key
|
17
|
+
]
|
18
|
+
end
|
15
19
|
|
16
20
|
attr_accessor *self.settings
|
21
|
+
attr_accessor :mysql41
|
17
22
|
|
18
23
|
def render
|
19
24
|
raise ConfigurationError unless valid?
|
@@ -1,17 +1,21 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class SQLSource < Riddle::Configuration::Source
|
4
|
-
self.settings
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:type, :sql_host, :sql_user, :sql_pass, :sql_db,
|
7
|
+
:sql_port, :sql_sock, :mysql_connect_flags, :mysql_ssl_cert,
|
8
|
+
:mysql_ssl_key, :mysql_ssl_ca, :odbc_dsn, :sql_query_pre, :sql_query,
|
9
|
+
:sql_joined_field, :sql_file_field, :sql_query_range, :sql_range_step,
|
10
|
+
:sql_query_killlist, :sql_attr_uint, :sql_attr_bool, :sql_attr_bigint,
|
11
|
+
:sql_attr_timestamp, :sql_attr_str2ordinal, :sql_attr_float,
|
12
|
+
:sql_attr_multi, :sql_attr_string, :sql_attr_str2wordcount,
|
13
|
+
:sql_column_buffers, :sql_field_string, :sql_field_str2wordcount,
|
14
|
+
:sql_query_post, :sql_query_post_index, :sql_ranged_throttle,
|
15
|
+
:sql_query_info, :mssql_winauth, :mssql_unicode, :unpack_zlib,
|
16
|
+
:unpack_mysqlcompress, :unpack_mysqlcompress_maxsize
|
17
|
+
]
|
18
|
+
end
|
15
19
|
|
16
20
|
attr_accessor *self.settings
|
17
21
|
|
@@ -45,4 +49,4 @@ module Riddle
|
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
48
|
-
end
|
52
|
+
end
|
@@ -1,10 +1,14 @@
|
|
1
1
|
module Riddle
|
2
2
|
class Configuration
|
3
3
|
class XMLSource < Riddle::Configuration::Source
|
4
|
-
self.settings
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
def self.settings
|
5
|
+
[
|
6
|
+
:type, :xmlpipe_command, :xmlpipe_field,
|
7
|
+
:xmlpipe_attr_uint, :xmlpipe_attr_bool, :xmlpipe_attr_timestamp,
|
8
|
+
:xmlpipe_attr_str2ordinal, :xmlpipe_attr_float, :xmlpipe_attr_multi,
|
9
|
+
:xmlpipe_fixup_utf8
|
10
|
+
]
|
11
|
+
end
|
8
12
|
|
9
13
|
attr_accessor *self.settings
|
10
14
|
|
@@ -26,4 +30,4 @@ module Riddle
|
|
26
30
|
end
|
27
31
|
end
|
28
32
|
end
|
29
|
-
end
|
33
|
+
end
|
data/lib/riddle/controller.rb
CHANGED
@@ -12,7 +12,7 @@ module Riddle
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def sphinx_version
|
15
|
-
`#{indexer} 2>&1`[
|
15
|
+
`#{indexer} 2>&1`[/Sphinx (\d+\.\d+(\.\d+|(?:-dev|(\-id64)?\-beta)))/, 1]
|
16
16
|
rescue
|
17
17
|
nil
|
18
18
|
end
|
@@ -32,7 +32,7 @@ module Riddle
|
|
32
32
|
|
33
33
|
cmd = "#{searchd} --pidfile --config \"#{@path}\""
|
34
34
|
|
35
|
-
if RUBY_PLATFORM =~ /mswin/
|
35
|
+
if RUBY_PLATFORM =~ /mswin|mingw/
|
36
36
|
system("start /B #{cmd} 1> NUL 2>&1")
|
37
37
|
else
|
38
38
|
`#{cmd}`
|
@@ -53,7 +53,7 @@ module Riddle
|
|
53
53
|
stop_flag = 'stop' if Riddle.loaded_version.split('.').first == '0'
|
54
54
|
cmd = %(#{searchd} --pidfile --config "#{@path}" --#{stop_flag})
|
55
55
|
|
56
|
-
if RUBY_PLATFORM =~ /mswin/
|
56
|
+
if RUBY_PLATFORM =~ /mswin|mingw/
|
57
57
|
system("start /B #{cmd} 1> NUL 2>&1")
|
58
58
|
else
|
59
59
|
`#{cmd}`
|
@@ -1,5 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Riddle::Configuration do
|
4
|
-
|
4
|
+
describe Riddle::Configuration::Index do
|
5
|
+
describe '#settings' do
|
6
|
+
it 'should return array with all settings of index' do
|
7
|
+
Riddle::Configuration::Index.settings.should_not be_empty
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should return array which contains a docinfo' do
|
11
|
+
Riddle::Configuration::Index.settings.should be_include :docinfo
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'class inherited from Riddle::Configuration::Index' do
|
17
|
+
before :all do
|
18
|
+
class TestIndex < Riddle::Configuration::Index; end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#settings' do
|
22
|
+
it 'should has same settings as Riddle::Configuration::Index' do
|
23
|
+
TestIndex.settings.should == Riddle::Configuration::Index.settings
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
5
28
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/sphinx_helper.rb
CHANGED
@@ -37,7 +37,7 @@ class SphinxHelper
|
|
37
37
|
structure = File.open("spec/fixtures/sql/structure.sql") { |f| f.read }
|
38
38
|
structure.split(/;/).each { |sql| client.query sql }
|
39
39
|
client.query <<-SQL
|
40
|
-
LOAD DATA
|
40
|
+
LOAD DATA INFILE '#{@path}/fixtures/sql/data.tsv' INTO TABLE
|
41
41
|
`riddle`.`people` FIELDS TERMINATED BY ',' ENCLOSED BY "'" (gender,
|
42
42
|
first_name, middle_initial, last_name, street_address, city, state,
|
43
43
|
postcode, email, birthday)
|
@@ -5,17 +5,17 @@ describe Riddle::Configuration::Searchd do
|
|
5
5
|
it "should be invalid without a listen or pid_file" do
|
6
6
|
searchd = Riddle::Configuration::Searchd.new
|
7
7
|
searchd.should_not be_valid
|
8
|
-
|
8
|
+
|
9
9
|
searchd.port = 3312
|
10
10
|
searchd.should_not be_valid
|
11
|
-
|
11
|
+
|
12
12
|
searchd.pid_file = "file.pid"
|
13
13
|
searchd.should be_valid
|
14
|
-
|
14
|
+
|
15
15
|
searchd.port = nil
|
16
16
|
searchd.listen = nil
|
17
17
|
searchd.should_not be_valid
|
18
|
-
|
18
|
+
|
19
19
|
searchd.listen = "localhost:3312"
|
20
20
|
searchd.should be_valid
|
21
21
|
end
|
@@ -101,6 +101,84 @@ searchd
|
|
101
101
|
port = 3312
|
102
102
|
pid_file = file.pid
|
103
103
|
client_key = secret
|
104
|
+
}
|
105
|
+
SEARCHD
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
if Riddle.loaded_version.to_f >= 0.9
|
110
|
+
it "should render with mysql41 on the default port if true" do
|
111
|
+
searchd = Riddle::Configuration::Searchd.new
|
112
|
+
searchd.mysql41 = true
|
113
|
+
searchd.pid_file = 'file.pid'
|
114
|
+
|
115
|
+
searchd.render.should == <<-SEARCHD
|
116
|
+
searchd
|
117
|
+
{
|
118
|
+
listen = 9306:mysql41
|
119
|
+
pid_file = file.pid
|
120
|
+
}
|
121
|
+
SEARCHD
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should render with mysql41 on a given port" do
|
125
|
+
searchd = Riddle::Configuration::Searchd.new
|
126
|
+
searchd.mysql41 = 9307
|
127
|
+
searchd.pid_file = 'file.pid'
|
128
|
+
|
129
|
+
searchd.render.should == <<-SEARCHD
|
130
|
+
searchd
|
131
|
+
{
|
132
|
+
listen = 9307:mysql41
|
133
|
+
pid_file = file.pid
|
134
|
+
}
|
135
|
+
SEARCHD
|
136
|
+
end
|
137
|
+
|
138
|
+
it "allows for both normal and mysql41 connections" do
|
139
|
+
searchd = Riddle::Configuration::Searchd.new
|
140
|
+
searchd.mysql41 = true
|
141
|
+
searchd.port = 9312
|
142
|
+
searchd.pid_file = 'file.pid'
|
143
|
+
|
144
|
+
searchd.render.should == <<-SEARCHD
|
145
|
+
searchd
|
146
|
+
{
|
147
|
+
listen = 9312
|
148
|
+
listen = 9306:mysql41
|
149
|
+
pid_file = file.pid
|
150
|
+
}
|
151
|
+
SEARCHD
|
152
|
+
end
|
153
|
+
|
154
|
+
it "uses given address for mysql41 connections" do
|
155
|
+
searchd = Riddle::Configuration::Searchd.new
|
156
|
+
searchd.mysql41 = true
|
157
|
+
searchd.address = '127.0.0.1'
|
158
|
+
searchd.pid_file = 'file.pid'
|
159
|
+
|
160
|
+
searchd.render.should == <<-SEARCHD
|
161
|
+
searchd
|
162
|
+
{
|
163
|
+
listen = 127.0.0.1:9306:mysql41
|
164
|
+
pid_file = file.pid
|
165
|
+
}
|
166
|
+
SEARCHD
|
167
|
+
end
|
168
|
+
|
169
|
+
it "applies the given address to both normal and mysql41 connections" do
|
170
|
+
searchd = Riddle::Configuration::Searchd.new
|
171
|
+
searchd.mysql41 = true
|
172
|
+
searchd.port = 9312
|
173
|
+
searchd.address = 'sphinx.server.local'
|
174
|
+
searchd.pid_file = 'file.pid'
|
175
|
+
|
176
|
+
searchd.render.should == <<-SEARCHD
|
177
|
+
searchd
|
178
|
+
{
|
179
|
+
listen = sphinx.server.local:9312
|
180
|
+
listen = sphinx.server.local:9306:mysql41
|
181
|
+
pid_file = file.pid
|
104
182
|
}
|
105
183
|
SEARCHD
|
106
184
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: riddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.4.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pat Allan
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-02 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
hash:
|
147
|
+
hash: 1550771664451883617
|
148
148
|
segments:
|
149
149
|
- 0
|
150
150
|
version: "0"
|