websolr-sunspot_rails 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.10.1
@@ -9,10 +9,12 @@ if ENV["WEBSOLR_URL"]
9
9
 
10
10
  api_key = ENV["WEBSOLR_URL"][/[0-9a-f]{11}/] or raise "Invalid WEBSOLR_URL: bad or no api key"
11
11
 
12
+ ENV["WEBSOLR_CONFIG_HOST"] ||= "www.websolr.com"
13
+
12
14
  @pending = true
13
- Rails.logger.info "Checking index availability"
14
- until @pending
15
- response = RestClient.post("http://www.websolr.com/schema/#{api_key}.json", :client => "sunspot-0.10")
15
+ Rails.logger.info "Checking index availability..."
16
+ while @pending
17
+ response = RestClient.post("http://#{ENV["WEBSOLR_CONFIG_HOST"]}/schema/#{api_key}.json", :client => "sunspot-0.10")
16
18
  json = JSON.parse(response)
17
19
  case json["status"]
18
20
  when "ok":
@@ -20,11 +22,16 @@ if ENV["WEBSOLR_URL"]
20
22
  @pending = false
21
23
  when "pending":
22
24
  Rails.logger.info "Provisioning index, please wait ..."
25
+ sleep 5
23
26
  when "error"
24
27
  Rails.logger.error json["message"]
25
28
  @pending = false
29
+ else
30
+ Rails.logger.error "wtf: #{json.inspect}"
26
31
  end
27
32
  end
33
+ Rails.logger.info "Moving on..."
34
+
28
35
 
29
36
  module Sunspot #:nodoc:
30
37
  module Rails #:nodoc:
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{websolr-sunspot_rails}
8
- s.version = "0.10.0"
8
+ s.version = "0.10.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kyle Maxwell", "John Barnette", "Mat Brown"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websolr-sunspot_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Maxwell