elastic_queue 0.0.6 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14471f1e862b30ad31d2370ec3ec68457547d0b1
4
- data.tar.gz: 0624f98c19ca622f348be5e649e22221118cff3e
3
+ metadata.gz: d6e669dd2eb27b5ca9f483235d30ad5ec96d084b
4
+ data.tar.gz: 9d52ff8a5a841d10fe77b5a74786eea687bbb494
5
5
  SHA512:
6
- metadata.gz: 58db006ad5be84b3f156ac06212b3bff9b7e029e5fc6aeccf3884cb809acce31c79683717be25c1d670acbf5c1dbcbbdc07ae9f8a11ffc54b98ec96a5c63a933
7
- data.tar.gz: 8fcd435c33c7b33818bb934bf4d75203603b18c5f42d0fc062bcbdd224f47f03654b7d2097e94c3e6b468745e5081195ccde0a1530c5ac632dd185cd7f488a35
6
+ metadata.gz: 24f5f08d5e042d2c4bfe8d7d063d2f2b3aebd81251d2fb494dc7c1088e809b9d5a99f296f7feaeb1260d7052e392fdf0c1ade304af51ec4a90dc0b7ba9ee1007
7
+ data.tar.gz: 6b548e8ffe120b156ab211d8260acca28f2ebfb6e2ed3ef873f4492cdefc3984d70e080c506addf3298c3eedb657c8cc424d9cfca7441c689de861b4388c6c64
@@ -9,7 +9,7 @@ module ElasticQueue
9
9
  include Percolation
10
10
 
11
11
  def self.search_client
12
- Elasticsearch::Client.new
12
+ Elasticsearch::Client.new hosts: ElasticQueue::OPTIONS[:elasticsearch_hosts]
13
13
  end
14
14
 
15
15
  def self.models(*models)
@@ -50,6 +50,5 @@ module ElasticQueue
50
50
  def null_filter(term, value)
51
51
  { missing: { field: term, existence: true, null_value: true } }
52
52
  end
53
-
54
53
  end
55
54
  end
@@ -31,7 +31,6 @@ module ElasticQueue
31
31
  search_client.delete index: '_percolator', type: 'dynamic_percolator', id: search_id
32
32
  search
33
33
  end
34
-
35
34
  end
36
35
 
37
36
  def in_queue?(model)
@@ -0,0 +1,12 @@
1
+ module ElasticQueue
2
+ class Railtie < ::Rails::Railtie
3
+ initializer 'ElasticQueue options initializer', after: :after_initialize do
4
+ elastic_queue_default_options = { elasticsearch_hosts: [{ host: 'localhost', port: 9200, protocol: 'http' }] }.with_indifferent_access
5
+ if defined?(Rails) && File.exists?(Rails.root.join('config', 'elastic_queue.yml').to_s)
6
+ ElasticQueue::OPTIONS = elastic_queue_default_options.merge(YAML.load_file(Rails.root.join('config', 'elastic_queue.yml').to_s)[Rails.env].with_indifferent_access)
7
+ else
8
+ ElasticQueue::OPTIONS = elastic_queue_default_options
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module ElasticQueue
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
data/lib/elastic_queue.rb CHANGED
@@ -2,6 +2,7 @@ require 'active_support'
2
2
  require 'elasticsearch'
3
3
  require 'elastic_queue/base'
4
4
  require 'elastic_queue/queueable'
5
+ require 'elastic_queue/railtie.rb' if defined? Rails
5
6
 
6
7
  module ElasticQueue
7
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruth Thompson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-15 00:00:00.000000000 Z
12
+ date: 2014-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -148,6 +148,7 @@ files:
148
148
  - lib/elastic_queue/query.rb
149
149
  - lib/elastic_queue/query_options.rb
150
150
  - lib/elastic_queue/queueable.rb
151
+ - lib/elastic_queue/railtie.rb
151
152
  - lib/elastic_queue/results.rb
152
153
  - lib/elastic_queue/sorts.rb
153
154
  - lib/elastic_queue/version.rb