mwmitchell-rsolr 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +9 -1
- data/lib/rsolr/connection.rb +13 -7
- data/lib/rsolr.rb +8 -2
- data/rsolr.gemspec +2 -3
- metadata +2 -3
- data/lib/core_ext.rb +0 -25
data/CHANGES.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
+
0.8.7 - May 6, 2009
|
2
|
+
Added method_missing to RSolr::Connection, which sets the request handler path,
|
3
|
+
based on the method name:
|
4
|
+
# this sends a request like: /music_library?q=>coltrane
|
5
|
+
solr.music_library :q=>'coltrane'
|
6
|
+
Removed the core_ext file, put the Array extension code directly into rsolr.rb
|
7
|
+
|
1
8
|
0.8.6 - April 25, 2009
|
2
|
-
Removed the Mash stuff -- which means the response keys from solr are only accessable using String based keys.
|
9
|
+
Removed the Mash stuff -- which means the response keys from solr are only accessable using String based keys.
|
10
|
+
Use RSolr::Ext if you want more magic.
|
3
11
|
|
4
12
|
0.8.5 - April 7, 2009
|
5
13
|
The RSolr::Message #add method now accepts a single Message::Document or an array of Message::Document objects
|
data/lib/rsolr/connection.rb
CHANGED
@@ -10,9 +10,15 @@ class RSolr::Connection
|
|
10
10
|
@opts = opts
|
11
11
|
end
|
12
12
|
|
13
|
+
# Send a request to a request handler using the method name.
|
14
|
+
# This does not handle data, only selects
|
15
|
+
def method_missing(method_name, params)
|
16
|
+
send_request("/#{method_name}", map_params(params))
|
17
|
+
end
|
18
|
+
|
13
19
|
# send a request to the "select" handler
|
14
|
-
def select(params
|
15
|
-
send_request('/select', map_params(params)
|
20
|
+
def select(params)
|
21
|
+
send_request('/select', map_params(params))
|
16
22
|
end
|
17
23
|
|
18
24
|
# sends data to the update handler
|
@@ -103,12 +109,12 @@ class RSolr::Connection
|
|
103
109
|
# if the wt is :ruby, evaluate the ruby string response
|
104
110
|
if adapter_response[:params][:wt] == :ruby
|
105
111
|
data = Kernel.eval(data)
|
112
|
+
# attach a method called #adapter_response that returns the original adapter response value
|
113
|
+
def data.adapter_response
|
114
|
+
@adapter_response
|
115
|
+
end
|
116
|
+
data.send(:instance_variable_set, '@adapter_response', adapter_response)
|
106
117
|
end
|
107
|
-
# attach a method called #adapter_response that returns the original adapter response value
|
108
|
-
def data.adapter_response
|
109
|
-
@adapter_response
|
110
|
-
end
|
111
|
-
data.send(:instance_variable_set, '@adapter_response', adapter_response)
|
112
118
|
data
|
113
119
|
end
|
114
120
|
|
data/lib/rsolr.rb
CHANGED
@@ -2,11 +2,17 @@
|
|
2
2
|
|
3
3
|
$: << File.dirname(__FILE__) unless $:.include?(File.dirname(__FILE__))
|
4
4
|
|
5
|
-
|
5
|
+
unless Array.respond_to?(:extract_options!)
|
6
|
+
class Array
|
7
|
+
def extract_options!
|
8
|
+
last.is_a?(::Hash) ? pop : {}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
6
12
|
|
7
13
|
module RSolr
|
8
14
|
|
9
|
-
VERSION = '0.8.
|
15
|
+
VERSION = '0.8.7'
|
10
16
|
|
11
17
|
autoload :Message, 'rsolr/message'
|
12
18
|
autoload :Connection, 'rsolr/connection'
|
data/rsolr.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rsolr"
|
3
|
-
s.version = "0.8.
|
4
|
-
s.date = "2009-
|
3
|
+
s.version = "0.8.7"
|
4
|
+
s.date = "2009-05-06"
|
5
5
|
s.summary = "A Ruby client for Apache Solr"
|
6
6
|
s.email = "goodieboy@gmail.com"
|
7
7
|
s.homepage = "http://github.com/mwmitchell/rsolr"
|
@@ -11,7 +11,6 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.files = [
|
12
12
|
"examples/http.rb",
|
13
13
|
"examples/direct.rb",
|
14
|
-
"lib/core_ext.rb",
|
15
14
|
"lib/rsolr.rb",
|
16
15
|
"lib/rsolr/adapter/direct.rb",
|
17
16
|
"lib/rsolr/adapter/http.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mwmitchell-rsolr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Mitchell
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -36,7 +36,6 @@ extra_rdoc_files:
|
|
36
36
|
files:
|
37
37
|
- examples/http.rb
|
38
38
|
- examples/direct.rb
|
39
|
-
- lib/core_ext.rb
|
40
39
|
- lib/rsolr.rb
|
41
40
|
- lib/rsolr/adapter/direct.rb
|
42
41
|
- lib/rsolr/adapter/http.rb
|
data/lib/core_ext.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#class Symbol
|
2
|
-
|
3
|
-
# allow symbol chaining: :one.two.three
|
4
|
-
# This breaks Rails, probably lots of other things too :(
|
5
|
-
#def method_missing(m)
|
6
|
-
# [self.to_s, m.to_s].join('.').to_sym
|
7
|
-
#end
|
8
|
-
|
9
|
-
#end
|
10
|
-
|
11
|
-
#class Hash
|
12
|
-
#
|
13
|
-
# def to_mash
|
14
|
-
# self.is_a?(Mash) ? self : Mash.new(self)
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
#end
|
18
|
-
|
19
|
-
unless Array.respond_to?(:extract_options!)
|
20
|
-
class Array
|
21
|
-
def extract_options!
|
22
|
-
last.is_a?(::Hash) ? pop : {}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|