jackal 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/jackal/callback.rb +15 -5
- data/lib/jackal/loader.rb +20 -14
- data/lib/jackal/version.rb +1 -1
- 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: 21788721bbd42cb37b1a3a32431de360a07d8722
|
4
|
+
data.tar.gz: be2baadcafd0eb1d9dd2483b7ca2d4b1e223c869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4b0bd8c69a72d965a1a2632dfdad6774bbadb42303b1bb8c86ffb5e0fa864edaed11a8e15901f512ad69e2973d309229fddfd9817df649f1901789aa429a51
|
7
|
+
data.tar.gz: 40ea38a0fc50d7723fbcc1ff3100d4fa66fde87340c83bd24652dbeff350cb517f0e565d11b6c11e86e8579ff1714c00271f1964efbe56e82c139a7c2bfd8600
|
data/CHANGELOG.md
CHANGED
data/lib/jackal/callback.rb
CHANGED
@@ -6,10 +6,11 @@ module Jackal
|
|
6
6
|
|
7
7
|
include Utils::Payload
|
8
8
|
include Utils::Config
|
9
|
-
include Utils::Config
|
10
9
|
# @!parse include Jackal::Utils::Payload
|
11
10
|
# @!parse include Jackal::Utils::Config
|
12
|
-
|
11
|
+
|
12
|
+
include Bogo::Constants
|
13
|
+
include Bogo::Memoization
|
13
14
|
|
14
15
|
# @return [Array<Formatter>] formatters
|
15
16
|
attr_reader :formatters
|
@@ -26,12 +27,21 @@ module Jackal
|
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
30
|
+
# @return [Jackal::Assets::Store]
|
31
|
+
# @note the assets library is NOT a dependency of jackal and must
|
32
|
+
# be included at runtime!
|
33
|
+
def asset_store
|
34
|
+
memoize(:asset_store) do
|
35
|
+
require 'jackal-assets'
|
36
|
+
Jackal::Assets::Store.new
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
29
40
|
# @return [Utils::Process]
|
30
41
|
def process_manager
|
31
|
-
|
32
|
-
|
42
|
+
memoize(:process_manager) do
|
43
|
+
Utils::Process.new
|
33
44
|
end
|
34
|
-
@_process
|
35
45
|
end
|
36
46
|
|
37
47
|
# Validity of message
|
data/lib/jackal/loader.rb
CHANGED
@@ -35,22 +35,28 @@ module Jackal
|
|
35
35
|
opts.fetch(:sources, {}).each do |kind, source_args|
|
36
36
|
source = Carnivore::Source.build(
|
37
37
|
:type => source_args[:type].to_sym,
|
38
|
-
:args => source_args.fetch(:args, {}).merge(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
:args => source_args.fetch(:args, {}).merge(
|
39
|
+
:name => "#{namespace}_#{key}_#{kind}",
|
40
|
+
:orphan_callback => lambda{|message|
|
41
|
+
warn "No callbacks matched message. Auto confirming message from source. (#{message})"
|
42
|
+
message.confirm!
|
43
|
+
if(name.to_s.end_with?('input'))
|
44
|
+
destination = Carnivore::Supervisor.supervisor[name.to_s.sub('_input', '_output')]
|
45
|
+
if(destination)
|
46
|
+
warn "Auto pushing orphaned message to next destination (#{message} -> #{destination.name})"
|
47
|
+
begin
|
48
|
+
destination.transmit(Utils.unpack(message))
|
49
|
+
rescue => e
|
50
|
+
error "Failed to auto push message (#{message}): #{e.class} - #{e}"
|
51
|
+
end
|
52
|
+
else
|
53
|
+
warn "Failed to location destination for message forward! (Destination: #{destination} #{message})"
|
50
54
|
end
|
55
|
+
else
|
56
|
+
error "Cannot auto forward from output source. No messages should be encountered here! (#{message})"
|
51
57
|
end
|
52
|
-
|
53
|
-
|
58
|
+
}
|
59
|
+
)
|
54
60
|
)
|
55
61
|
Carnivore::Utils.info "Registered new source: #{namespace}_#{key}_#{kind}"
|
56
62
|
if(kind.to_s == 'input')
|
data/lib/jackal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carnivore
|