websolr-acts_as_solr 1.3.1.1 → 1.3.2.0

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{Shim from websolr to acts_as_solr}
10
10
  gem.email = "kyle@kylemaxwell.com"
11
11
  gem.homepage = "http://github.com/fizx/websolr-acts_as_solr"
12
- gem.authors = ["Kyle Maxwell"]
13
- gem.add_dependency "acts_as_solr", "1.3.1"
14
- gem.add_dependency "rest-client"
12
+ gem.authors = ["Kyle Maxwell", "Nick Zadrozny"]
13
+ gem.add_dependency "acts_as_solr", "1.3.2"
15
14
  gem.add_dependency "json"
16
15
  gem.add_development_dependency "rspec", ">= 0"
17
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1.1
1
+ 1.3.2.0
@@ -1,12 +1,12 @@
1
1
  # Post-require hooks for acts_as_solr and sunspot if this
2
2
  # gem is loaded and WEBSOLR_URL is defined.
3
3
 
4
- gem "acts_as_solr", :version => "1.1.3"
4
+ gem "acts_as_solr", :version => "1.3.2"
5
5
  require "acts_as_solr"
6
6
 
7
7
  if ENV["WEBSOLR_URL"]
8
8
  require "json"
9
- require "rest_client"
9
+ require "net/http"
10
10
  require "uri"
11
11
 
12
12
  api_key = ENV["WEBSOLR_URL"][/[0-9a-f]{11}/] or raise "Invalid WEBSOLR_URL: bad or no api key"
@@ -14,24 +14,32 @@ if ENV["WEBSOLR_URL"]
14
14
  ENV["WEBSOLR_CONFIG_HOST"] ||= "www.websolr.com"
15
15
 
16
16
  @pending = true
17
- puts "Checking index availability..."
17
+ Rails.logger.info "Checking index availability..."
18
18
 
19
- response = RestClient.post("http://#{ENV["WEBSOLR_CONFIG_HOST"]}/schema/#{api_key}.json", :client => "acts_as_solr")
20
- json = JSON.parse(response.to_s)
21
- case json["status"]
22
- when "ok"
23
- puts "Index is available!"
24
- @pending = false
25
- when "pending"
26
- puts "Provisioning index, things may not be working for a few seconds ..."
27
- sleep 5
28
- when "error"
29
- STDERR.puts json["message"]
30
- @pending = false
31
- else
32
- STDERR.puts "wtf: #{json.inspect}"
19
+ begin
20
+ schema_url = URI.parse("http://#{ENV["WEBSOLR_CONFIG_HOST"]}/schema/#{api_key}.json")
21
+ response = Net::HTTP.post_form(schema_url, "client" => "acts_as_solr-1.3")
22
+ json = JSON.parse(response.body.to_s)
23
+
24
+ case json["status"]
25
+ when "ok"
26
+ Rails.logger.info "Index is available!"
27
+ @pending = false
28
+ when "pending"
29
+ Rails.logger.info "Provisioning index, things may not be working for a few seconds ..."
30
+ sleep 5
31
+ when "error"
32
+ Rails.logger.error json["message"]
33
+ @pending = false
34
+ else
35
+ Rails.logger.error "wtf: #{json.inspect}"
36
+ end
37
+ rescue Exception => e
38
+ STDERR.puts "Error checking index status. It may or may not be available.\n" +
39
+ "Please email support@onemorecloud.com if this problem persists.\n" +
40
+ "Exception: #{e.message}"
33
41
  end
34
-
42
+
35
43
  module ActsAsSolr
36
44
  class Post
37
45
  def self.execute(request)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{websolr-acts_as_solr}
8
- s.version = "1.3.1.1"
8
+ s.version = "1.3.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Kyle Maxwell"]
12
- s.date = %q{2010-03-29}
11
+ s.authors = ["Kyle Maxwell", "Nick Zadrozny"]
12
+ s.date = %q{2010-05-27}
13
13
  s.description = %q{Shim from websolr to acts_as_solr}
14
14
  s.email = %q{kyle@kylemaxwell.com}
15
15
  s.extra_rdoc_files = [
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.homepage = %q{http://github.com/fizx/websolr-acts_as_solr}
32
32
  s.rdoc_options = ["--charset=UTF-8"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.6}
34
+ s.rubygems_version = %q{1.3.7}
35
35
  s.summary = %q{Shim from websolr to acts_as_solr}
36
36
  s.test_files = [
37
37
  "test/helper.rb",
@@ -42,20 +42,17 @@ Gem::Specification.new do |s|
42
42
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
43
  s.specification_version = 3
44
44
 
45
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
46
- s.add_runtime_dependency(%q<acts_as_solr>, ["= 1.3.1"])
47
- s.add_runtime_dependency(%q<rest-client>, [">= 0"])
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ s.add_runtime_dependency(%q<acts_as_solr>, ["= 1.3.2"])
48
47
  s.add_runtime_dependency(%q<json>, [">= 0"])
49
48
  s.add_development_dependency(%q<rspec>, [">= 0"])
50
49
  else
51
- s.add_dependency(%q<acts_as_solr>, ["= 1.3.1"])
52
- s.add_dependency(%q<rest-client>, [">= 0"])
50
+ s.add_dependency(%q<acts_as_solr>, ["= 1.3.2"])
53
51
  s.add_dependency(%q<json>, [">= 0"])
54
52
  s.add_dependency(%q<rspec>, [">= 0"])
55
53
  end
56
54
  else
57
- s.add_dependency(%q<acts_as_solr>, ["= 1.3.1"])
58
- s.add_dependency(%q<rest-client>, [">= 0"])
55
+ s.add_dependency(%q<acts_as_solr>, ["= 1.3.2"])
59
56
  s.add_dependency(%q<json>, [">= 0"])
60
57
  s.add_dependency(%q<rspec>, [">= 0"])
61
58
  end
metadata CHANGED
@@ -1,73 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websolr-acts_as_solr
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 79
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 3
8
- - 1
9
- - 1
10
- version: 1.3.1.1
9
+ - 2
10
+ - 0
11
+ version: 1.3.2.0
11
12
  platform: ruby
12
13
  authors:
13
14
  - Kyle Maxwell
15
+ - Nick Zadrozny
14
16
  autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2010-03-29 00:00:00 -07:00
20
+ date: 2010-05-27 00:00:00 -07:00
19
21
  default_executable:
20
22
  dependencies:
21
23
  - !ruby/object:Gem::Dependency
22
24
  name: acts_as_solr
23
25
  prerelease: false
24
26
  requirement: &id001 !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
29
  - - "="
27
30
  - !ruby/object:Gem::Version
31
+ hash: 31
28
32
  segments:
29
33
  - 1
30
34
  - 3
31
- - 1
32
- version: 1.3.1
35
+ - 2
36
+ version: 1.3.2
33
37
  type: :runtime
34
38
  version_requirements: *id001
35
39
  - !ruby/object:Gem::Dependency
36
- name: rest-client
40
+ name: json
37
41
  prerelease: false
38
42
  requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
45
  - - ">="
41
46
  - !ruby/object:Gem::Version
47
+ hash: 3
42
48
  segments:
43
49
  - 0
44
50
  version: "0"
45
51
  type: :runtime
46
52
  version_requirements: *id002
47
- - !ruby/object:Gem::Dependency
48
- name: json
49
- prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
57
- type: :runtime
58
- version_requirements: *id003
59
53
  - !ruby/object:Gem::Dependency
60
54
  name: rspec
61
55
  prerelease: false
62
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
63
58
  requirements:
64
59
  - - ">="
65
60
  - !ruby/object:Gem::Version
61
+ hash: 3
66
62
  segments:
67
63
  - 0
68
64
  version: "0"
69
65
  type: :development
70
- version_requirements: *id004
66
+ version_requirements: *id003
71
67
  description: Shim from websolr to acts_as_solr
72
68
  email: kyle@kylemaxwell.com
73
69
  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: Shim from websolr to acts_as_solr