flying-sphinx 1.2.1 → 1.3.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.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +11 -35
- data/Appraisals +23 -21
- data/Gemfile +5 -10
- data/README.textile +5 -3
- data/flying-sphinx.gemspec +7 -3
- data/lib/flying_sphinx.rb +8 -2
- data/lib/flying_sphinx/action.rb +1 -1
- data/lib/flying_sphinx/api.rb +6 -20
- data/lib/flying_sphinx/cli.rb +3 -1
- data/lib/flying_sphinx/configuration.rb +1 -1
- data/lib/flying_sphinx/configuration_options.rb +12 -15
- data/lib/flying_sphinx/configurer.rb +62 -0
- data/lib/flying_sphinx/controller.rb +26 -27
- data/lib/flying_sphinx/request/hmac.rb +20 -0
- data/lib/flying_sphinx/response/json.rb +2 -0
- data/lib/flying_sphinx/setting_files.rb +1 -1
- data/lib/flying_sphinx/version.rb +1 -1
- data/spec/acceptance/configuring_spec.rb +34 -0
- data/spec/acceptance/get_info_spec.rb +5 -4
- data/spec/acceptance/start_or_stop_sphinx_spec.rb +12 -2
- data/spec/flying_sphinx/action_spec.rb +1 -1
- data/spec/flying_sphinx/api_spec.rb +2 -22
- data/spec/flying_sphinx/configuration_spec.rb +1 -1
- data/spec/flying_sphinx/controller_spec.rb +33 -19
- data/spec/flying_sphinx/setting_files_spec.rb +16 -16
- data/spec/spec_helper.rb +1 -0
- data/spec/support/hmac.rb +23 -0
- data/spec/support/multipart.rb +56 -0
- data/spec/support/successful_action.rb +7 -1
- metadata +108 -73
- data/gemfiles/rails_2.3.gemfile +0 -21
- data/gemfiles/rails_3.0.gemfile +0 -21
- data/gemfiles/rails_3.2.gemfile +0 -18
- data/gemfiles/rails_4.0.gemfile +0 -18
- data/lib/flying_sphinx/gzipped_hash.rb +0 -36
data/gemfiles/rails_4.0.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 1.0.0", :git => "git://github.com/thoughtbot/appraisal", :branch => "master", :ref => "bd6eef4b6a"
|
6
|
-
gem "rails", "~> 4.0.5"
|
7
|
-
gem "faraday", "~> 0.9.0"
|
8
|
-
if RUBY_VERSION.to_f <= 1.8
|
9
|
-
gem "public_suffix", "< 1.4.0"
|
10
|
-
elsif RUBY_VERSION.to_f <= 1.9
|
11
|
-
gem "public_suffix", "< 1.5.0"
|
12
|
-
elsif RUBY_VERSION.to_f <= 2.0
|
13
|
-
gem "public_suffix", "< 1.5.0"
|
14
|
-
else
|
15
|
-
gem "public_suffix"
|
16
|
-
end
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'zlib'
|
2
|
-
|
3
|
-
class FlyingSphinx::GzippedHash
|
4
|
-
def initialize(hash)
|
5
|
-
@hash = hash
|
6
|
-
end
|
7
|
-
|
8
|
-
def to_gzipped_hash
|
9
|
-
hash['gzip'] = 'true'
|
10
|
-
|
11
|
-
keys.each { |key| hash[key] = gzip hash[key], key }
|
12
|
-
|
13
|
-
hash
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
attr_reader :hash
|
19
|
-
|
20
|
-
def keys
|
21
|
-
keys = (hash['extra'] || '').split(';')
|
22
|
-
keys << 'sphinx' if hash['sphinx']
|
23
|
-
keys
|
24
|
-
end
|
25
|
-
|
26
|
-
def gzip(string, key)
|
27
|
-
io = StringIO.new 'w'
|
28
|
-
writer = Zlib::GzipWriter.new io
|
29
|
-
writer.write string
|
30
|
-
writer.close
|
31
|
-
|
32
|
-
Faraday::UploadIO.new(
|
33
|
-
StringIO.new(io.string, 'rb'), 'application/gzip', key
|
34
|
-
)
|
35
|
-
end
|
36
|
-
end
|