superbolt 0.5.3 → 0.5.4
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 +4 -4
- data/lib/superbolt/app.rb +9 -1
- data/lib/superbolt/router.rb +1 -1
- data/lib/superbolt/version.rb +1 -1
- data/spec/app_spec.rb +23 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 993a942222be7e90d9ceb4abf46ba30cfb3f7635
|
4
|
+
data.tar.gz: 076f2935f293964db9a7942f049f44ccf165f0db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/superbolt/router.rb
CHANGED
data/lib/superbolt/version.rb
CHANGED
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
|
-
|
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.
|
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-
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|