rubberband 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -50,6 +50,8 @@ Pass a block to Faraday to configure middleware and options:
|
|
50
50
|
|
51
51
|
API:
|
52
52
|
```ruby
|
53
|
+
client.default_index = "test_index"
|
54
|
+
client.default_type = "test_type"
|
53
55
|
client.index({:body => "elasticsearch is cool"}, :id => 1)
|
54
56
|
client.get("1")
|
55
57
|
client.search("body:elasticsearch")
|
@@ -24,9 +24,9 @@ module ElasticSearch
|
|
24
24
|
|
25
25
|
def connect!
|
26
26
|
if @connect_block
|
27
|
-
@session = Faraday.new :url => @server,
|
27
|
+
@session = Faraday.new :url => @server, &@connect_block
|
28
28
|
else
|
29
|
-
@session = Faraday.new :url => @server
|
29
|
+
@session = Faraday.new :url => @server
|
30
30
|
end
|
31
31
|
@session.options[:timeout] = @options[:timeout]
|
32
32
|
end
|
@@ -43,10 +43,9 @@ module ElasticSearch
|
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
|
-
def request(method, operation, params={}, body=nil
|
46
|
+
def request(method, operation, params={}, body=nil)
|
47
47
|
begin
|
48
48
|
response = @session.send(method, generate_uri(operation)) do |req|
|
49
|
-
req.headers = headers
|
50
49
|
req.params = params
|
51
50
|
req.body = body
|
52
51
|
end
|
@@ -67,7 +67,7 @@ module ElasticSearch
|
|
67
67
|
hash
|
68
68
|
end
|
69
69
|
|
70
|
-
def request(method, operation, params={}, body=nil
|
70
|
+
def request(method, operation, params={}, body=nil)
|
71
71
|
begin
|
72
72
|
uri = generate_uri(operation)
|
73
73
|
#puts "request: #{@server} #{method} #{uri} #{params.inspect} #{body}"
|
@@ -86,7 +86,6 @@ module ElasticSearch
|
|
86
86
|
request.uri = uri
|
87
87
|
request.parameters = stringify!(params)
|
88
88
|
request.body = body
|
89
|
-
request.headers = stringify!(headers)
|
90
89
|
response = @client.execute(request)
|
91
90
|
handle_error(response) if response.status >= 500
|
92
91
|
response
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubberband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|