sidekiq-sqs 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sidekiq-sqs.rb CHANGED
@@ -7,6 +7,7 @@ require 'sidekiq-sqs/fetcher'
7
7
  require 'sidekiq-sqs/client'
8
8
  require 'sidekiq-sqs/processor'
9
9
  require 'sidekiq-sqs/worker'
10
+ require 'sidekiq-sqs/util'
10
11
  require 'sidekiq-sqs/aws-sdk/batch_send_failure_patch'
11
12
 
12
13
  # TODO The retry server middleware directly writes to a retry zset.
@@ -26,6 +27,7 @@ module Sidekiq
26
27
  Sidekiq::Client.send :include, Sidekiq::Sqs::Client
27
28
  Sidekiq::Processor.send :include, Sidekiq::Sqs::Processor
28
29
  Sidekiq::Worker::ClassMethods.send :include, Sidekiq::Sqs::Worker
30
+ Sidekiq::Util.send :include, Sidekiq::Sqs::Util
29
31
  AWS::SQS::Queue.send :include, Sidekiq::Sqs::AwsSdk::BatchSendFailurePatch
30
32
 
31
33
  # Can't figure how to include/extend and not get a private method...
@@ -0,0 +1,15 @@
1
+ module Sidekiq
2
+ module Sqs
3
+ module Util
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ remove_method :constantize
8
+ end
9
+
10
+ def constantize(string)
11
+ string.constantize
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Sqs
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
data/spec/util_spec.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ Sidekiq::Util.send :include, Sidekiq::Sqs::Util
4
+ class UtilTest
5
+ include Sidekiq::Util
6
+ end
7
+
8
+ describe Sidekiq::Sqs::Util do
9
+ subject { UtilTest.new }
10
+
11
+ describe ".constantize" do
12
+ it "uses activesupport" do
13
+ klass = "UtilTest"
14
+ klass.expects(:constantize).returns(:run)
15
+
16
+ subject.constantize(klass).should eq(:run)
17
+ end
18
+
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
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: 2012-10-17 00:00:00.000000000 Z
12
+ date: 2012-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -159,6 +159,7 @@ files:
159
159
  - lib/sidekiq-sqs/fetcher.rb
160
160
  - lib/sidekiq-sqs/manager.rb
161
161
  - lib/sidekiq-sqs/processor.rb
162
+ - lib/sidekiq-sqs/util.rb
162
163
  - lib/sidekiq-sqs/version.rb
163
164
  - lib/sidekiq-sqs/worker.rb
164
165
  - lib/top_level.rb
@@ -167,6 +168,7 @@ files:
167
168
  - spec/sidekiq-sqs/processor_spec.rb
168
169
  - spec/sidekiq-sqs/worker_spec.rb
169
170
  - spec/spec_helper.rb
171
+ - spec/util_spec.rb
170
172
  homepage: http://github.com/jmoses/sidekiq-sqs
171
173
  licenses: []
172
174
  post_install_message:
@@ -196,3 +198,4 @@ test_files:
196
198
  - spec/sidekiq-sqs/processor_spec.rb
197
199
  - spec/sidekiq-sqs/worker_spec.rb
198
200
  - spec/spec_helper.rb
201
+ - spec/util_spec.rb