rubberband 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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")
@@ -33,7 +33,7 @@ module ElasticSearch
33
33
  raise NotImplementedError
34
34
  end
35
35
 
36
- def request(method, operation, params={}, body=nil, headers={})
36
+ def request(method, operation, params={}, body=nil)
37
37
  raise NotImplementedError
38
38
  end
39
39
  end
@@ -24,9 +24,9 @@ module ElasticSearch
24
24
 
25
25
  def connect!
26
26
  if @connect_block
27
- @session = Faraday.new :url => @server, :headers => {'User-Agent' => 'Rubberband'}, &@connect_block
27
+ @session = Faraday.new :url => @server, &@connect_block
28
28
  else
29
- @session = Faraday.new :url => @server, :headers => {'User-Agent' => 'Rubberband'}
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, headers={})
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
@@ -38,7 +38,7 @@ module ElasticSearch
38
38
 
39
39
  private
40
40
 
41
- def request(method, operation, params={}, body=nil, headers={})
41
+ def request(method, operation, params={}, body=nil)
42
42
  begin
43
43
  uri = generate_uri(operation)
44
44
  query = generate_query_string(params)
@@ -67,7 +67,7 @@ module ElasticSearch
67
67
  hash
68
68
  end
69
69
 
70
- def request(method, operation, params={}, body=nil, headers={})
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
@@ -1,3 +1,3 @@
1
1
  module ElasticSearch
2
- VERSION = "0.9.6"
2
+ VERSION = "0.9.7"
3
3
  end
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.6
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-03 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday