superbolt 0.5.3 → 0.5.4

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: b431fab064f963b74d22ee65e00ff416d9272241
4
- data.tar.gz: b06b856a6793911ba2f2d225e681401951084493
3
+ metadata.gz: 993a942222be7e90d9ceb4abf46ba30cfb3f7635
4
+ data.tar.gz: 076f2935f293964db9a7942f049f44ccf165f0db
5
5
  SHA512:
6
- metadata.gz: 37f36e6ac9a18ab4318d2b57f91ff11576e61b32e56cfa13925fa89e786d7dd01ddb2ca470ed534acaaf7b43ad8b2d9443a9a891d46b1e9ab4f0665a338dfcee
7
- data.tar.gz: 18f8123f5ce8aba012e1af2bc1ba64dd7f2ccd8ecc6b67f96b7bf54511a0729f294bbb6f8d376081a8b978bddf0e42da0acab27396abd82b1d7780bce682452a
6
+ metadata.gz: 32bca69f1e4c42a0327f0c72142180351d09cdcb00e1f2276850d454f7f038ef47fafe081c48f884a3469cf655421e0486f4c7ca913f5de92b318d09fc9990a3
7
+ data.tar.gz: 48217dbf508298a7a0f16a4e3ba094f916e13d013a601bebfbd11b2b25422d9a34c47c8ed8fcea4a64f29bea38a9f94ac21057d5949926a9dd9076dc4252dd7e
data/lib/superbolt/app.rb CHANGED
@@ -69,7 +69,15 @@ module Superbolt
69
69
  ack: Runner::Ack,
70
70
  greedy: Runner::Greedy,
71
71
  ar_deferrable: Runner::ActiveRecordDeferrable
72
- }
72
+ }.merge(self.class.additional_runners)
73
+ end
74
+
75
+ def self.additional_runners
76
+ @additional_runners ||= {}
77
+ end
78
+
79
+ def self.additional_runners=(ar)
80
+ @additional_runners = ar
73
81
  end
74
82
 
75
83
  def default_runner
@@ -21,7 +21,7 @@ module Superbolt
21
21
 
22
22
  def perform
23
23
  if handler_class
24
- handler_class.new(arguments, logger).perform
24
+ handler_class.new(arguments, logger).perform
25
25
  else
26
26
  logger.warn "No Superbolt route for event: '#{event}'"
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Superbolt
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
data/spec/app_spec.rb CHANGED
@@ -5,7 +5,7 @@ describe Superbolt::App do
5
5
  Superbolt::App.new(name, {
6
6
  env: env,
7
7
  logger: logger,
8
- runner: runner_type
8
+ config: double('config', runner_type: runner_type, connection_params: true)
9
9
  })
10
10
  }
11
11
 
@@ -23,6 +23,7 @@ describe Superbolt::App do
23
23
  error_queue.clear
24
24
  end
25
25
 
26
+
26
27
  shared_examples 'app' do
27
28
  it "shuts down with any message to the quit queue" do
28
29
  queue.push({please: 'stop'})
@@ -63,7 +64,6 @@ describe Superbolt::App do
63
64
  queue.size.should == 0
64
65
  end
65
66
 
66
-
67
67
  it "passes a logger to the block" do
68
68
  mock_logger = double
69
69
  app.logger = mock_logger
@@ -106,6 +106,15 @@ describe Superbolt::App do
106
106
 
107
107
  context 'when runner acknowledges one and uses activerecord deferrable' do
108
108
  let(:runner_type) { :ar_deferrable }
109
+ module ActiveRecord
110
+ class Base
111
+ end
112
+ end
113
+
114
+ before do
115
+ ActiveRecord::Base.stub(:connection).and_return(double('connection', disconnect!: true))
116
+ ActiveRecord::Base.stub(:establish_connection)
117
+ end
109
118
 
110
119
  it_should_behave_like "app"
111
120
  end
@@ -127,4 +136,16 @@ describe Superbolt::App do
127
136
 
128
137
  it_should_behave_like "app"
129
138
  end
139
+
140
+ context 'when there are additional runners in the apps config' do
141
+ let(:runner_type) { :monster_farts }
142
+
143
+ before do
144
+ Superbolt::App.additional_runners = {monster_farts: 'stinky'}
145
+ end
146
+
147
+ it 'uses the injected runner' do
148
+ app.runner_class.should == 'stinky'
149
+ end
150
+ end
130
151
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - socialchorus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport