riddle 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +14 -8
  3. data/Gemfile +2 -10
  4. data/HISTORY +3 -0
  5. data/README.markdown +1 -1
  6. data/Rakefile +2 -0
  7. data/bin/loadsphinx +39 -0
  8. data/lib/riddle.rb +2 -0
  9. data/lib/riddle/0.9.8.rb +2 -0
  10. data/lib/riddle/0.9.9.rb +2 -0
  11. data/lib/riddle/0.9.9/client.rb +2 -0
  12. data/lib/riddle/0.9.9/client/filter.rb +2 -0
  13. data/lib/riddle/0.9.9/configuration/searchd.rb +2 -0
  14. data/lib/riddle/1.10.rb +2 -0
  15. data/lib/riddle/1.10/client.rb +2 -0
  16. data/lib/riddle/2.0.1.rb +2 -0
  17. data/lib/riddle/2.0.1/client.rb +2 -0
  18. data/lib/riddle/2.1.0.rb +2 -0
  19. data/lib/riddle/auto_version.rb +2 -0
  20. data/lib/riddle/client.rb +2 -0
  21. data/lib/riddle/client/filter.rb +2 -0
  22. data/lib/riddle/client/message.rb +2 -0
  23. data/lib/riddle/client/response.rb +2 -0
  24. data/lib/riddle/command_failed_error.rb +2 -0
  25. data/lib/riddle/command_result.rb +2 -0
  26. data/lib/riddle/configuration.rb +2 -0
  27. data/lib/riddle/configuration/common.rb +2 -0
  28. data/lib/riddle/configuration/distributed_index.rb +2 -0
  29. data/lib/riddle/configuration/index.rb +2 -0
  30. data/lib/riddle/configuration/index_settings.rb +2 -0
  31. data/lib/riddle/configuration/indexer.rb +2 -0
  32. data/lib/riddle/configuration/parser.rb +1 -0
  33. data/lib/riddle/configuration/realtime_index.rb +2 -0
  34. data/lib/riddle/configuration/remote_index.rb +2 -0
  35. data/lib/riddle/configuration/searchd.rb +2 -0
  36. data/lib/riddle/configuration/section.rb +2 -0
  37. data/lib/riddle/configuration/source.rb +2 -0
  38. data/lib/riddle/configuration/sql_source.rb +2 -0
  39. data/lib/riddle/configuration/template_index.rb +2 -0
  40. data/lib/riddle/configuration/tsv_source.rb +2 -0
  41. data/lib/riddle/configuration/xml_source.rb +2 -0
  42. data/lib/riddle/controller.rb +2 -0
  43. data/lib/riddle/execute_command.rb +2 -0
  44. data/lib/riddle/query.rb +4 -1
  45. data/lib/riddle/query/delete.rb +2 -0
  46. data/lib/riddle/query/insert.rb +2 -0
  47. data/lib/riddle/query/select.rb +2 -0
  48. data/riddle.gemspec +3 -1
  49. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e8107a5880b8a9bf181bd6f395dddef5cd887b0
4
- data.tar.gz: daf50f55994fe6b909cceeae4aeb2a8c8568a8ba
3
+ metadata.gz: c8a66c7b7cd5135ff4cd51a4d22fb0221bf811cf
4
+ data.tar.gz: b972aa2c33a99d6ac336e70ce8fd79977ee02953
5
5
  SHA512:
6
- metadata.gz: 25262a9682bdc924d5219fe696064ec6a3c773dcca7228465f132735ea7887cb2ff68662399b22c4a81e5b806821b8f3e0893d90a314ae864a2511eea74df628
7
- data.tar.gz: b1b0ccf8b7609ae714c488caebe693427dee20b26ba4ea4e5b9c925f0007f8713319b39a425a75eed52cfc7759ad8037d66abfb5aee40d4f424ce233a93f5130
6
+ metadata.gz: e7fcc99152ccaaaa7f0b16428b818c18b6d2dfa74bc5bd588c4c348d2360b342768e45b7090b47b686f62c691800f62dd64afd993f6d563e3377fbbedb451644
7
+ data.tar.gz: 63435a5f30519f6acdeed8b8ef5f1b3baa57a25fc49e76e63074cc69db2f05037e0bc211dda0e13b2e1570e81dab1dad9c07ba9fe1dce2f728998bf74598ac27
data/.travis.yml CHANGED
@@ -1,16 +1,22 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
- - 2.3.4
5
- - 2.4.1
6
- - jruby-9.1.10.0
3
+ - 2.2.8
4
+ - 2.3.5
5
+ - 2.4.2
6
+ - jruby-9.1.14.0
7
7
  env:
8
- - SPHINX_BIN=/usr/local/sphinx-2.0.10/bin SPHINX_VERSION=2.0.10
9
- - SPHINX_BIN=/usr/local/sphinx-2.1.9/bin SPHINX_VERSION=2.1.9
10
- - SPHINX_BIN=/usr/local/sphinx-2.2.6/bin SPHINX_VERSION=2.2.6
8
+ global:
9
+ - SPHINX_BIN=ext/sphinx/bin/
10
+ - secure: aP3wCZnnqim/yBWbO8+N2DAJIDVuqewUayK3nBphR/Jt1POIMbqCIuHwk/SG/JfMc6pJIlH0QOX8wI3fF3y5GO6aIrN8xKAX0DoDm+Gkvk/YEk3cK/2fJUwvocR89M99EoV8ctLPaR03B3dm3h2Dh2oe8NQRBfcrL3WtiHHq3d0=
11
+ matrix:
12
+ - SPHINX_VERSION=2.0.10
13
+ - SPHINX_VERSION=2.1.9
14
+ - SPHINX_VERSION=2.2.6
11
15
  before_script:
12
16
  - killall searchd; echo ''
13
- - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
17
+ - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal";
18
+ fi; echo $RUBYOPT
19
+ - "./bin/loadsphinx $SPHINX_VERSION"
14
20
  after_script:
15
21
  - killall searchd; echo ''
16
22
  sudo: false
data/Gemfile CHANGED
@@ -1,16 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
7
  gem 'mysql2', '0.3.20', :platform => :ruby
6
8
  gem 'jdbc-mysql', '5.1.35', :platform => :jruby
7
-
8
- %w[
9
- rspec
10
- rspec-core
11
- rspec-expectations
12
- rspec-mocks
13
- rspec-support
14
- ].each do |library|
15
- gem library, :git => "https://github.com/rspec/#{library}.git"
16
- end
data/HISTORY CHANGED
@@ -1,3 +1,6 @@
1
+ 2.2.1 - December 2nd 2017
2
+ - Check if Mysql2::Client is defined before using it (not just Mysql2).
3
+
1
4
  2.2.0 - June 20th 2017
2
5
  - Add compatibility for MRI's frozen string literals setting.
3
6
  - Stop packaging test files with gem releases (@dimko).
data/README.markdown CHANGED
@@ -14,7 +14,7 @@ Riddle is available as a gem, so you can install it directly:
14
14
 
15
15
  Or include it in a Gemfile:
16
16
 
17
- gem 'riddle', '~> 2.2.0'
17
+ gem 'riddle', '~> 2.2.1'
18
18
 
19
19
  ## Usage
20
20
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler'
3
5
 
data/bin/loadsphinx ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env bash
2
+
3
+ version=$1
4
+ name="sphinx-$version"
5
+ url="http://sphinxsearch.com/files/$name-release.tar.gz"
6
+ bucket="thinking-sphinx"
7
+ directory="ext/sphinx"
8
+ prefix="`pwd`/$directory"
9
+ file="ext/$name.tar.gz"
10
+
11
+ download_and_compile_source () {
12
+ curl -O $url
13
+ tar -zxf $name-release.tar.gz
14
+ cd $name-release
15
+ ./configure --with-mysql --with-pgsql --enable-id64 --prefix=$prefix
16
+ make
17
+ make install
18
+ cd ..
19
+ rm -rf $name-release.tar.gz $name-release
20
+ }
21
+
22
+ load_cache () {
23
+ mkdir ext
24
+ curl -o $file http://$bucket.s3.amazonaws.com/bincaches/$name.tar.gz
25
+ tar -zxf $file
26
+ }
27
+
28
+ push_cache () {
29
+ tar -czf $file $directory
30
+ aws s3 cp $file s3://$bucket/bincaches/$name.tar.gz --acl public-read
31
+ }
32
+
33
+ if curl -i --head --fail http://$bucket.s3.amazonaws.com/bincaches/$name.tar.gz
34
+ then
35
+ load_cache
36
+ else
37
+ download_and_compile_source
38
+ push_cache
39
+ fi
data/lib/riddle.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread'
2
4
  require 'socket'
3
5
  require 'stringio'
data/lib/riddle/0.9.8.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Riddle.loaded_version = '0.9.8'
data/lib/riddle/0.9.9.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Riddle.loaded_version = '0.9.9'
2
4
 
3
5
  require 'riddle/0.9.9/client'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Riddle::Client::Versions[:search] = 0x116
2
4
  Riddle::Client::Versions[:update] = 0x102
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::Client::Filter
2
4
  #
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Searchd
data/lib/riddle/1.10.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'riddle/0.9.9'
2
4
 
3
5
  Riddle.loaded_version = '1.10'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Riddle::Client::Versions[:search] = 0x117
2
4
  Riddle::Client::Versions[:excerpt] = 0x102
3
5
 
data/lib/riddle/2.0.1.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'riddle/0.9.9'
2
4
  require 'riddle/1.10'
3
5
 
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Riddle::Client::Versions[:search] = 0x118
2
4
  Riddle::Client::Versions[:excerpt] = 0x103
data/lib/riddle/2.1.0.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'riddle/0.9.9'
2
4
  require 'riddle/1.10'
3
5
  require 'riddle/2.0.1'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::AutoVersion
2
4
  def self.configure
3
5
  controller = Riddle::Controller.new nil, ''
data/lib/riddle/client.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'riddle/client/filter'
2
4
  require 'riddle/client/message'
3
5
  require 'riddle/client/response'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Client
3
5
  class Filter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Client
3
5
  # This class takes care of the translation of ints, strings and arrays to
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Client
3
5
  # Used to interrogate responses from the Sphinx daemon. Keep in mind none
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::CommandFailedError < StandardError
2
4
  attr_accessor :command_result
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::CommandResult
2
4
  attr_reader :command, :status, :output
3
5
  attr_accessor :successful
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'riddle/configuration/section'
2
4
  require 'riddle/configuration/index_settings'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Common < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class DistributedIndex < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Index < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  module IndexSettings
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Indexer < Riddle::Configuration::Section
@@ -1,4 +1,5 @@
1
1
  # encoding: UTF-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'stringio'
4
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class RealtimeIndex < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class RemoteIndex
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Searchd < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class Source < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class SQLSource < Riddle::Configuration::Source
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class TemplateIndex < Riddle::Configuration::Section
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class TSVSource < Riddle::Configuration::Source
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  class Configuration
3
5
  class XMLSource < Riddle::Configuration::Source
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle
2
4
  NoConfigurationFileError = Class.new StandardError
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::ExecuteCommand
2
4
  WINDOWS = (RUBY_PLATFORM =~ /mswin|mingw/)
3
5
 
data/lib/riddle/query.rb CHANGED
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Riddle::Query
2
4
  ESCAPE_CHARACTERS = /[\(\)\|\-!@~\/"\/\^\$\\><&=\?]/
3
5
  # http://sphinxsearch.com/docs/current/extended-syntax.html
4
6
  ESCAPE_WORDS = /\b(?:MAYBE|NEAR|PARAGRAPH|SENTENCE|ZONE|ZONESPAN)\b/
7
+ MYSQL2_ESCAPE = defined?(Mysql2) && defined?(Mysql::Client)
5
8
 
6
9
  def self.connection(address = '127.0.0.1', port = 9312)
7
10
  require 'mysql2'
@@ -112,7 +115,7 @@ module Riddle::Query
112
115
  end
113
116
 
114
117
  def self.sql_escape(string)
115
- return Mysql2::Client.escape(string) if defined?(Mysql2)
118
+ return Mysql2::Client.escape(string) if MYSQL2_ESCAPE
116
119
 
117
120
  string.gsub(/['"\\]/) { |character| "\\#{character}" }
118
121
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::Query::Delete
2
4
  def initialize(index, *ids)
3
5
  @index = index
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::Query::Insert
2
4
  attr_reader :columns, :values
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Riddle::Query::Select
2
4
  def initialize
3
5
  @values = []
data/riddle.gemspec CHANGED
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding: utf-8 -*-
2
4
  $:.push File.expand_path('../lib', __FILE__)
3
5
 
4
6
  Gem::Specification.new do |s|
5
7
  s.name = 'riddle'
6
- s.version = '2.2.0'
8
+ s.version = '2.2.1'
7
9
  s.platform = Gem::Platform::RUBY
8
10
  s.authors = ['Pat Allan']
9
11
  s.email = ['pat@freelancing-gods.com']
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.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2017-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,7 @@ files:
66
66
  - LICENCE
67
67
  - README.markdown
68
68
  - Rakefile
69
+ - bin/loadsphinx
69
70
  - lib/riddle.rb
70
71
  - lib/riddle/0.9.8.rb
71
72
  - lib/riddle/0.9.9.rb
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  version: '0'
128
129
  requirements: []
129
130
  rubyforge_project: riddle
130
- rubygems_version: 2.6.11
131
+ rubygems_version: 2.6.13
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: An API for Sphinx, written in and for Ruby.