websolr-sunspot_rails 1.1.0.0 → 1.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,9 +9,8 @@ begin
9
9
  gem.description = %Q{websolr to sunspot_rails shim}
10
10
  gem.email = "kyle@kylemaxwell.com"
11
11
  gem.homepage = "http://github.com/fizx/websolr-sunspot_rails"
12
- gem.authors = ["Kyle Maxwell", "John Barnette", "Mat Brown"]
12
+ gem.authors = ["Kyle Maxwell", "John Barnette", "Mat Brown", "Nick Zadrozny"]
13
13
  gem.add_dependency "sunspot_rails", "1.1.0"
14
- gem.add_dependency "rest-client"
15
14
  gem.add_dependency "json"
16
15
  gem.add_development_dependency "rspec"
17
16
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0.0
1
+ 1.1.0.1
@@ -5,7 +5,7 @@ require "sunspot/rails/request_lifecycle"
5
5
 
6
6
  if ENV["WEBSOLR_URL"]
7
7
  require "json"
8
- require "rest_client"
8
+ require "net/http"
9
9
  require "uri"
10
10
 
11
11
  api_key = ENV["WEBSOLR_URL"][/[0-9a-f]{11}/] or raise "Invalid WEBSOLR_URL: bad or no api key"
@@ -14,21 +14,29 @@ if ENV["WEBSOLR_URL"]
14
14
 
15
15
  @pending = true
16
16
  puts "Checking index availability..."
17
+
18
+ begin
19
+ schema_url = URI.parse("http://#{ENV["WEBSOLR_CONFIG_HOST"]}/schema/#{api_key}.json")
20
+ response = Net::HTTP.post_form(schema_url, "client" => "sunspot-1.0")
21
+ json = JSON.parse(response.body.to_s)
17
22
 
18
- response = RestClient.post("http://#{ENV["WEBSOLR_CONFIG_HOST"]}/schema/#{api_key}.json", :client => "sunspot-1.1")
19
- json = JSON.parse(response.to_s)
20
- case json["status"]
21
- when "ok"
22
- puts "Index is available!"
23
- @pending = false
24
- when "pending"
25
- puts "Provisioning index, things may not be working for a few seconds ..."
26
- sleep 5
27
- when "error"
28
- STDERR.puts json["message"]
29
- @pending = false
30
- else
31
- STDERR.puts "wtf: #{json.inspect}"
23
+ case json["status"]
24
+ when "ok"
25
+ puts "Index is available!"
26
+ @pending = false
27
+ when "pending"
28
+ puts "Provisioning index, things may not be working for a few seconds ..."
29
+ sleep 5
30
+ when "error"
31
+ STDERR.puts json["message"]
32
+ @pending = false
33
+ else
34
+ STDERR.puts "wtf: #{json.inspect}"
35
+ end
36
+ rescue Exception => e
37
+ STDERR.puts "Error checking index status. It may or may not be available.\n" +
38
+ "Please email support@onemorecloud.com if this problem persists.\n" +
39
+ "Exception: #{e.message}"
32
40
  end
33
41
 
34
42
  module Sunspot #:nodoc:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{websolr-sunspot_rails}
8
- s.version = "1.1.0.0"
8
+ s.version = "1.1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Kyle Maxwell", "John Barnette", "Mat Brown"]
12
- s.date = %q{2010-05-10}
11
+ s.authors = ["Kyle Maxwell", "John Barnette", "Mat Brown", "Nick Zadrozny"]
12
+ s.date = %q{2010-05-27}
13
13
  s.description = %q{websolr to sunspot_rails shim}
14
14
  s.email = %q{kyle@kylemaxwell.com}
15
15
  s.extra_rdoc_files = [
@@ -29,27 +29,24 @@ Gem::Specification.new do |s|
29
29
  s.homepage = %q{http://github.com/fizx/websolr-sunspot_rails}
30
30
  s.rdoc_options = ["--charset=UTF-8"]
31
31
  s.require_paths = ["lib"]
32
- s.rubygems_version = %q{1.3.6}
32
+ s.rubygems_version = %q{1.3.7}
33
33
  s.summary = %q{websolr to sunspot_rails shim}
34
34
 
35
35
  if s.respond_to? :specification_version then
36
36
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
37
37
  s.specification_version = 3
38
38
 
39
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
39
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
40
40
  s.add_runtime_dependency(%q<sunspot_rails>, ["= 1.1.0"])
41
- s.add_runtime_dependency(%q<rest-client>, [">= 0"])
42
41
  s.add_runtime_dependency(%q<json>, [">= 0"])
43
42
  s.add_development_dependency(%q<rspec>, [">= 0"])
44
43
  else
45
44
  s.add_dependency(%q<sunspot_rails>, ["= 1.1.0"])
46
- s.add_dependency(%q<rest-client>, [">= 0"])
47
45
  s.add_dependency(%q<json>, [">= 0"])
48
46
  s.add_dependency(%q<rspec>, [">= 0"])
49
47
  end
50
48
  else
51
49
  s.add_dependency(%q<sunspot_rails>, ["= 1.1.0"])
52
- s.add_dependency(%q<rest-client>, [">= 0"])
53
50
  s.add_dependency(%q<json>, [">= 0"])
54
51
  s.add_dependency(%q<rspec>, [">= 0"])
55
52
  end
metadata CHANGED
@@ -1,32 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websolr-sunspot_rails
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 85
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 1
8
9
  - 0
9
- - 0
10
- version: 1.1.0.0
10
+ - 1
11
+ version: 1.1.0.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Kyle Maxwell
14
15
  - John Barnette
15
16
  - Mat Brown
17
+ - Nick Zadrozny
16
18
  autorequire:
17
19
  bindir: bin
18
20
  cert_chain: []
19
21
 
20
- date: 2010-05-10 00:00:00 -07:00
22
+ date: 2010-05-27 00:00:00 -07:00
21
23
  default_executable:
22
24
  dependencies:
23
25
  - !ruby/object:Gem::Dependency
24
26
  name: sunspot_rails
25
27
  prerelease: false
26
28
  requirement: &id001 !ruby/object:Gem::Requirement
29
+ none: false
27
30
  requirements:
28
31
  - - "="
29
32
  - !ruby/object:Gem::Version
33
+ hash: 19
30
34
  segments:
31
35
  - 1
32
36
  - 1
@@ -35,41 +39,33 @@ dependencies:
35
39
  type: :runtime
36
40
  version_requirements: *id001
37
41
  - !ruby/object:Gem::Dependency
38
- name: rest-client
42
+ name: json
39
43
  prerelease: false
40
44
  requirement: &id002 !ruby/object:Gem::Requirement
45
+ none: false
41
46
  requirements:
42
47
  - - ">="
43
48
  - !ruby/object:Gem::Version
49
+ hash: 3
44
50
  segments:
45
51
  - 0
46
52
  version: "0"
47
53
  type: :runtime
48
54
  version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: json
51
- prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- segments:
57
- - 0
58
- version: "0"
59
- type: :runtime
60
- version_requirements: *id003
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: rspec
63
57
  prerelease: false
64
- requirement: &id004 !ruby/object:Gem::Requirement
58
+ requirement: &id003 !ruby/object:Gem::Requirement
59
+ none: false
65
60
  requirements:
66
61
  - - ">="
67
62
  - !ruby/object:Gem::Version
63
+ hash: 3
68
64
  segments:
69
65
  - 0
70
66
  version: "0"
71
67
  type: :development
72
- version_requirements: *id004
68
+ version_requirements: *id003
73
69
  description: websolr to sunspot_rails shim
74
70
  email: kyle@kylemaxwell.com
75
71
  executables: []
@@ -98,23 +94,27 @@ rdoc_options:
98
94
  require_paths:
99
95
  - lib
100
96
  required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
101
98
  requirements:
102
99
  - - ">="
103
100
  - !ruby/object:Gem::Version
101
+ hash: 3
104
102
  segments:
105
103
  - 0
106
104
  version: "0"
107
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
108
107
  requirements:
109
108
  - - ">="
110
109
  - !ruby/object:Gem::Version
110
+ hash: 3
111
111
  segments:
112
112
  - 0
113
113
  version: "0"
114
114
  requirements: []
115
115
 
116
116
  rubyforge_project:
117
- rubygems_version: 1.3.6
117
+ rubygems_version: 1.3.7
118
118
  signing_key:
119
119
  specification_version: 3
120
120
  summary: websolr to sunspot_rails shim