jackal 0.3.10 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/jackal/loader.rb +31 -6
- data/lib/jackal/utils/spec.rb +5 -0
- data/lib/jackal/utils/spec/helpers.rb +16 -1
- data/lib/jackal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02001e5b2ff6b59d1031f8121657bcb1e7ed5ee7
|
4
|
+
data.tar.gz: 0392d96103ada117ed0d36efb82aa8bb4c1033c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eeb8f2de5be35b540209a3a366ffbf7c3668b5df73dd123509549ca7be26ee8b9a3577a80b65499cd23d81a25ea679b5ecd54cfd28e9e8b9757ff692be0afc7
|
7
|
+
data.tar.gz: 23cf4aa6b4966daa6b4329e5d88c03aeaa2ec16b25da321da68a579bb4fb59905784b10316c8f7f908dd5431fef7ba47599d21f82b3b6723c430e19d3faf2bf4
|
data/CHANGELOG.md
CHANGED
data/lib/jackal/loader.rb
CHANGED
@@ -5,25 +5,50 @@ module Jackal
|
|
5
5
|
class Loader
|
6
6
|
class << self
|
7
7
|
|
8
|
-
#
|
8
|
+
# Configure the application
|
9
9
|
#
|
10
10
|
# @param opts [Hash]
|
11
|
-
|
12
|
-
|
11
|
+
# @return [TrueClass]
|
12
|
+
def configure!(opts)
|
13
|
+
default_verbosity = nil
|
13
14
|
if(ENV['JACKAL_TESTING_MODE'])
|
14
15
|
if(!opts[:config])
|
15
16
|
Carnivore.configure!(:verify)
|
16
17
|
else
|
17
18
|
Carnivore.configure!(opts[:config], :force)
|
18
19
|
end
|
20
|
+
default_verbosity = :fatal
|
19
21
|
else
|
20
22
|
Carnivore.configure!(opts[:config])
|
21
23
|
Carnivore::Config.immutable!
|
24
|
+
default_verbosity = :info
|
22
25
|
end
|
23
26
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
default_verbosity = :debug if ENV['DEBUG']
|
28
|
+
const = opts.fetch(:verbosity,
|
29
|
+
Carnivore::Config.fetch(:verbosity, default_verbosity)
|
30
|
+
).to_s.upcase
|
31
|
+
|
32
|
+
Celluloid.logger.level = Celluloid.logger.class.const_get(const)
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
36
|
+
# Scrub and type opts
|
37
|
+
#
|
38
|
+
# @param opts [Slop,Hash]
|
39
|
+
# @return [Smash]
|
40
|
+
def process_opts(opts)
|
41
|
+
opts = opts.to_hash.to_smash
|
42
|
+
opts.delete_if{|k,v| v.nil?}
|
43
|
+
opts
|
44
|
+
end
|
45
|
+
|
46
|
+
# Run the jackal
|
47
|
+
#
|
48
|
+
# @param opts [Hash]
|
49
|
+
def run!(opts)
|
50
|
+
opts = process_opts(opts)
|
51
|
+
configure!(opts)
|
27
52
|
|
28
53
|
Carnivore::Config.fetch(:jackal, :require, []).each do |path|
|
29
54
|
require path
|
data/lib/jackal/utils/spec.rb
CHANGED
@@ -8,6 +8,9 @@ module Jackal
|
|
8
8
|
|
9
9
|
class << self
|
10
10
|
|
11
|
+
# @return [Class] class used to run subsystem
|
12
|
+
attr_accessor :system_runner
|
13
|
+
|
11
14
|
# Valid directories for test payloads
|
12
15
|
#
|
13
16
|
# @param args [String] list of directories to append
|
@@ -29,3 +32,5 @@ module Jackal
|
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
35
|
+
|
36
|
+
Jackal::Utils::Spec.system_runner = Jackal::Loader
|
@@ -62,7 +62,7 @@ def run_setup(config)
|
|
62
62
|
|
63
63
|
Thread.abort_on_exception = true
|
64
64
|
runner = Thread.new do
|
65
|
-
Jackal::
|
65
|
+
Jackal::Utils::Spec.system_runner.run!(:config => path)
|
66
66
|
end
|
67
67
|
source_wait(:setup)
|
68
68
|
runner
|
@@ -98,7 +98,22 @@ end
|
|
98
98
|
# @param wait_time [Numeric] max time to wait for message result (default 1)
|
99
99
|
# @return [Smash] payload result
|
100
100
|
def transmit_and_wait(actor, payload, wait_time = 1)
|
101
|
+
actor.callbacks.each do |c_name|
|
102
|
+
callback = actor.callback_supervisor[actor.callback_name(c_name)]
|
103
|
+
if(callback.respond_to?(:test_payload=))
|
104
|
+
callback.test_payload = Smash.new
|
105
|
+
end
|
106
|
+
end
|
101
107
|
actor.transmit(payload)
|
102
108
|
source_wait(wait_time) { !MessageStore.messages.empty? }
|
109
|
+
actor.callbacks.each do |c_name|
|
110
|
+
callback = actor.callback_supervisor[actor.callback_name(c_name)]
|
111
|
+
if(callback.respond_to?(:test_payload=))
|
112
|
+
unless(MessageStore.messages.empty?)
|
113
|
+
MessageStore.messages.first.deep_merge!(callback.test_payload)
|
114
|
+
end
|
115
|
+
callback.test_payload = nil
|
116
|
+
end
|
117
|
+
end
|
103
118
|
MessageStore.messages.pop
|
104
119
|
end
|
data/lib/jackal/version.rb
CHANGED