tire_async_index 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54ed1e3a9b31cffb57aa5ed2c198a32580394e17
4
- data.tar.gz: 246ca5241dd192048b52509e3355ec708c4c51be
3
+ metadata.gz: e4081d651b185b14d81c3b64215259f417f389ff
4
+ data.tar.gz: 68903a28cc33e94f6c4295efeaa9e014cc4582e2
5
5
  SHA512:
6
- metadata.gz: 7c8d691e6a2bb6eb81603e87e32ce163ad852d587f9017d424f23a4644bb68d4244418130611e4e92c6e157ca0f667efb21f55d34322160a5d28d59b8fbcd349
7
- data.tar.gz: 332481a0edd51798aa7f44c0bec0d3e577c722db058db8770d2ffa1ed831725afc380478665550797058525e31ecb9bfc3d40435ccf9693fa97d545d2923425a
6
+ metadata.gz: 35ffbb447e495545dce03f6208df65a6419c7008ea2253df63aaaabce852fa9896b2362317b86c492fba44b000cf71c56785e585c3af23c6045f5996ef6bc406
7
+ data.tar.gz: d1ad3588b6584adbd491c5a5f254a55aa7bc94910c55bd40e3afba0ebec7f3ff9c6c8ff2b72e59b2796e59dfb3b440c04d27edcfe01d707c2024f9112e25f42e
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - jruby-18mode
8
+ - jruby-19mode
9
+ gemfile:
10
+ - Gemfile
data/README.md CHANGED
@@ -4,8 +4,10 @@ It's extension for [Tire](https://github.com/karmi/tire/) (client for the Elasti
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Add this line to your application's Gemfile after `tire` and `sidekiq` or `resque` gems:
8
8
 
9
+ gem 'tire'
10
+ gem 'sidekiq' #'resque'
9
11
  gem 'tire_async_index'
10
12
 
11
13
  And then execute:
@@ -9,19 +9,24 @@ module TireAsyncIndex
9
9
  def configure
10
10
  self.configuration ||= Configuration.new
11
11
  yield(configuration)
12
+ reconfig_workers
12
13
  end
13
14
 
14
- def queue_name
15
+ def queue
15
16
  self.configuration.queue
16
17
  end
17
18
 
18
19
  def engine
19
20
  self.configuration.engine
20
21
  end
21
- end
22
22
 
23
- TireAsyncIndex.configure {}
23
+ def reconfig_workers
24
+ SidekiqUpdateIndexWorker.sidekiq_options_hash["queue"] = TireAsyncIndex.queue if defined?(Sidekiq)
25
+ end
26
+
27
+ end
24
28
 
25
29
  require 'tire_async_index/workers/sidekiq_update_index_worker' if defined?(Sidekiq)
26
30
  require 'tire_async_index/workers/resque_update_index_job' if defined?(Resque)
27
31
  require 'tire/model/async_callbacks'
32
+ TireAsyncIndex.configure {}
@@ -1,3 +1,3 @@
1
1
  module TireAsyncIndex
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,6 +1,8 @@
1
1
  class ResqueUpdateIndexJob
2
2
 
3
- @queue = TireAsyncIndex.configuration.queue
3
+ def self.queue
4
+ TireAsyncIndex.queue
5
+ end
4
6
 
5
7
  def self.perform class_name, id
6
8
  class_name.constantize.find_by_id(id).try(:update_index)
@@ -1,7 +1,7 @@
1
1
  class SidekiqUpdateIndexWorker
2
2
 
3
3
  include Sidekiq::Worker
4
- sidekiq_options queue: TireAsyncIndex.configuration.queue
4
+ sidekiq_options queue: :normal
5
5
 
6
6
  def perform class_name, id
7
7
  class_name.constantize.find_by_id(id).try(:update_index)
@@ -11,7 +11,7 @@ end
11
11
  describe TireAsyncIndex do
12
12
  context "configurable" do
13
13
  it "valid default config settings" do
14
- TireAsyncIndex.queue_name.should eql :normal
14
+ TireAsyncIndex.queue.should eql :normal
15
15
  TireAsyncIndex.engine.should eql :none
16
16
  end
17
17
 
@@ -20,7 +20,7 @@ describe TireAsyncIndex do
20
20
  config.use_queue :high
21
21
  end
22
22
 
23
- TireAsyncIndex.queue_name.should eql :high
23
+ TireAsyncIndex.queue.should eql :high
24
24
  end
25
25
 
26
26
  it "should be able to set sidekiq as engine" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tire_async_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Efremov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-29 00:00:00.000000000 Z
11
+ date: 2013-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tire
@@ -131,6 +131,7 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - .gitignore
133
133
  - .rspec
134
+ - .travis.yml
134
135
  - Gemfile
135
136
  - LICENSE.txt
136
137
  - README.md