riddle 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -5
- data/HISTORY +5 -0
- data/README.markdown +1 -1
- data/lib/riddle/0.9.9/configuration/searchd.rb +7 -1
- data/lib/riddle/configuration/searchd.rb +1 -1
- data/lib/riddle/controller.rb +16 -0
- data/lib/riddle/execute_command.rb +5 -1
- data/riddle.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 34d2ffd1aafa3678203285a425bb6bd893ac8b8e218f6affec4dd0a89136cebe
|
4
|
+
data.tar.gz: 7690d50b67c6d2d7d9b46168c52cfc588f7daa7eb2cafdcacd01f667e8c8e39f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6503e33c3bccdf966e76b2e6da2fabb53b8a4dca7b74ebe52315f303eefaf35fd700fb0dba58f0f675c3fdb90ef4d8d6149c57239d80787cc6cf4ff194407f12
|
7
|
+
data.tar.gz: 45c61b1009289b5d3b4343e718dc3804030dadfd87e9f877fce56503a46397e419c6c0519c1346f9f5961acdc18709bd6b1f8755137128bb9fd2eb9e12974fff
|
data/.travis.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.2.
|
4
|
-
- 2.3.
|
5
|
-
- 2.4.
|
3
|
+
- 2.2.9
|
4
|
+
- 2.3.6
|
5
|
+
- 2.4.3
|
6
|
+
- 2.5.0
|
6
7
|
- jruby-9.1.14.0
|
7
8
|
env:
|
8
9
|
global:
|
@@ -14,9 +15,9 @@ env:
|
|
14
15
|
- SPHINX_VERSION=2.2.6
|
15
16
|
before_script:
|
16
17
|
- killall searchd; echo ''
|
17
|
-
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal";
|
18
|
-
fi; echo $RUBYOPT
|
19
18
|
- "./bin/loadsphinx $SPHINX_VERSION"
|
19
|
+
before_install:
|
20
|
+
- gem update --system
|
20
21
|
after_script:
|
21
22
|
- killall searchd; echo ''
|
22
23
|
sudo: false
|
data/HISTORY
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
2.3.0 - January 14th 2018
|
2
|
+
- Add controller method for merging indices.
|
3
|
+
- Add support for sockets in searchd configuration.
|
4
|
+
- Fix handling of command errors when executed via backticks (verbose).
|
5
|
+
|
1
6
|
2.2.2 - December 2nd 2017
|
2
7
|
- Fix frozen string concatenation for searchd/indexer commands.
|
3
8
|
|
data/README.markdown
CHANGED
@@ -23,7 +23,13 @@ module Riddle
|
|
23
23
|
@listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
|
24
24
|
@listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(NUMBER)
|
25
25
|
|
26
|
-
|
26
|
+
if @listen.empty? && @address
|
27
|
+
@listen << @address
|
28
|
+
else
|
29
|
+
@listen = @listen.collect { |line| "#{@address}:#{line}" } if @address
|
30
|
+
end
|
31
|
+
|
32
|
+
@listen += Array(@socket) if @socket
|
27
33
|
end
|
28
34
|
|
29
35
|
def settings
|
data/lib/riddle/controller.rb
CHANGED
@@ -4,6 +4,8 @@ module Riddle
|
|
4
4
|
NoConfigurationFileError = Class.new StandardError
|
5
5
|
|
6
6
|
class Controller
|
7
|
+
DEFAULT_MERGE_OPTIONS = {:filters => {}}.freeze
|
8
|
+
|
7
9
|
attr_accessor :path, :bin_path, :searchd_binary_name, :indexer_binary_name
|
8
10
|
|
9
11
|
def initialize(configuration, path)
|
@@ -31,6 +33,20 @@ module Riddle
|
|
31
33
|
Riddle::ExecuteCommand.call command, options[:verbose]
|
32
34
|
end
|
33
35
|
|
36
|
+
def merge(destination, source, options = {})
|
37
|
+
options = DEFAULT_MERGE_OPTIONS.merge options
|
38
|
+
|
39
|
+
command = "#{indexer} --config \"#{@path}\"".dup
|
40
|
+
command << " --merge #{destination} #{source}"
|
41
|
+
options[:filters].each do |attribute, value|
|
42
|
+
value = value..value unless value.is_a?(Range)
|
43
|
+
command << " --merge-dst-range #{attribute} #{value.min} #{value.max}"
|
44
|
+
end
|
45
|
+
command << " --rotate" if running?
|
46
|
+
|
47
|
+
Riddle::ExecuteCommand.call command, options[:verbose]
|
48
|
+
end
|
49
|
+
|
34
50
|
def start(options = {})
|
35
51
|
return if running?
|
36
52
|
check_for_configuration_file
|
@@ -30,7 +30,11 @@ class Riddle::ExecuteCommand
|
|
30
30
|
attr_reader :command, :verbose
|
31
31
|
|
32
32
|
def result_from_backticks
|
33
|
-
|
33
|
+
begin
|
34
|
+
output = `#{command}`
|
35
|
+
rescue SystemCallError => error
|
36
|
+
output = error.message
|
37
|
+
end
|
34
38
|
|
35
39
|
Riddle::CommandResult.new command, $?.exitstatus, output
|
36
40
|
end
|
data/riddle.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riddle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project: riddle
|
131
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.7.3
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: An API for Sphinx, written in and for Ruby.
|