jruby-elasticsearch 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  require "java"
2
- require "elasticsearch/namespace"
2
+ require "jruby-elasticsearch/namespace"
3
3
 
4
4
  class ElasticSearch::ActionListener
5
5
  include org.elasticsearch.action.ActionListener
@@ -20,6 +20,8 @@ class ElasticSearch::ActionListener
20
20
  @failure_callbacks << block
21
21
  when :success
22
22
  @success_callbacks << block
23
+ else
24
+ raise "Unknown event '#{what}' for #{self.class.name}"
23
25
  end
24
26
  return self
25
27
  end # def on
@@ -40,7 +42,7 @@ class ElasticSearch::ActionListener
40
42
  @success_callbacks.each { |c| c.call(response) }
41
43
  else
42
44
  # Default if no success callbacks
43
- puts "#{self.class.name}#onResponse => #{response.inspect}"
45
+ puts "#{self.class.name}#onResponse => #{response.inspect} (#{self})"
44
46
  end
45
47
  end # def onResponse
46
48
  end # class ElasticSearch::ActionListener
@@ -1,5 +1,5 @@
1
- require "elasticsearch/namespace"
2
- require "elasticsearch/request"
1
+ require "jruby-elasticsearch/namespace"
2
+ require "jruby-elasticsearch/request"
3
3
 
4
4
  class ElasticSearch::BulkRequest < ElasticSearch::Request
5
5
  # Create a new index request.
@@ -1,4 +1,4 @@
1
- require "elasticsearch/namespace"
1
+ require "jruby-elasticsearch/namespace"
2
2
 
3
3
  class ElasticSearch::BulkStream
4
4
  def initialize
@@ -1,6 +1,6 @@
1
1
  require "java"
2
- require "elasticsearch/namespace"
3
- require "elasticsearch/indexrequest"
2
+ require "jruby-elasticsearch/namespace"
3
+ require "jruby-elasticsearch/indexrequest"
4
4
 
5
5
  class ElasticSearch::Client
6
6
  def initialize
@@ -1,5 +1,5 @@
1
- require "elasticsearch/namespace"
2
- require "elasticsearch/request"
1
+ require "jruby-elasticsearch/namespace"
2
+ require "jruby-elasticsearch/request"
3
3
 
4
4
  class ElasticSearch::IndexRequest < ElasticSearch::Request
5
5
  # Create a new index request.
@@ -11,7 +11,7 @@ class ElasticSearch::IndexRequest < ElasticSearch::Request
11
11
  @data = data
12
12
 
13
13
  @prep = @client.prepareIndex(index, type, id)
14
- super
14
+ super()
15
15
  end
16
16
 
17
17
  # Execute this index request.
@@ -1,5 +1,5 @@
1
- require "elasticsearch/namespace"
2
- require "elasticsearch/actionlistener"
1
+ require "jruby-elasticsearch/namespace"
2
+ require "jruby-elasticsearch/actionlistener"
3
3
 
4
4
  class ElasticSearch::Request
5
5
  # Create a new index request.
@@ -9,7 +9,9 @@ class ElasticSearch::Request
9
9
 
10
10
  # See ElasticSearch::ActionListener#on
11
11
  def on(event, &block)
12
- return @handler.on(*args, &block)
12
+ puts "Event[#{event}] => #{block} (#{@handler})"
13
+ @handler.on(event, &block)
14
+ return self
13
15
  end
14
16
 
15
17
  # Execute this index request.
@@ -1,4 +1,4 @@
1
- require "elasticsearch/client"
1
+ require "jruby-elasticsearch/client"
2
2
 
3
3
  #class Proc
4
4
  #include java.lang.Runnable
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jordan Sissel
@@ -28,14 +28,14 @@ extensions: []
28
28
  extra_rdoc_files: []
29
29
 
30
30
  files:
31
- - lib/elasticsearch.rb
32
- - lib/elasticsearch/namespace.rb
33
- - lib/elasticsearch/bulkrequest.rb
34
- - lib/elasticsearch/actionlistener.rb
35
- - lib/elasticsearch/request.rb
36
- - lib/elasticsearch/indexrequest.rb
37
- - lib/elasticsearch/client.rb
38
- - lib/elasticsearch/bulkstream.rb
31
+ - lib/jruby-elasticsearch.rb
32
+ - lib/jruby-elasticsearch/namespace.rb
33
+ - lib/jruby-elasticsearch/bulkrequest.rb
34
+ - lib/jruby-elasticsearch/actionlistener.rb
35
+ - lib/jruby-elasticsearch/request.rb
36
+ - lib/jruby-elasticsearch/indexrequest.rb
37
+ - lib/jruby-elasticsearch/client.rb
38
+ - lib/jruby-elasticsearch/bulkstream.rb
39
39
  has_rdoc: true
40
40
  homepage: https://github.com/jordansissel/jruby-elasticsearch
41
41
  licenses: