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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff99ce5082a3420d7bd3e8b37080b6c45cc6a631
4
- data.tar.gz: 181ebc2ce81ee6975634876df0c837432842fb62
3
+ metadata.gz: 21788721bbd42cb37b1a3a32431de360a07d8722
4
+ data.tar.gz: be2baadcafd0eb1d9dd2483b7ca2d4b1e223c869
5
5
  SHA512:
6
- metadata.gz: 9fa1626917c81a7b48079c4cbb06b59a68c42a6010cad6bce62139526d447a6c8f05f3061a109a87751602d576b20932c8b1ed5daf1c055db80f247502fe6ce5
7
- data.tar.gz: f903b018316cee786c2029341474577fd66e75871c2bdbc91b479dcfb24a925b0461046c8aaf48edf7b2c7e3a317e15ead4f7339cb26acb9ecc7d4f76a92cc30
6
+ metadata.gz: bd4b0bd8c69a72d965a1a2632dfdad6774bbadb42303b1bb8c86ffb5e0fa864edaed11a8e15901f512ad69e2973d309229fddfd9817df649f1901789aa429a51
7
+ data.tar.gz: 40ea38a0fc50d7723fbcc1ff3100d4fa66fde87340c83bd24652dbeff350cb517f0e565d11b6c11e86e8579ff1714c00271f1964efbe56e82c139a7c2bfd8600
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.4
2
+ * Fix nesting for orphan callback setup
3
+ * Add constant and memoization helpers into `Callback`
4
+
1
5
  # v0.2.2
2
6
  * Automatically forward payloads with no matches
3
7
  * Fix input sources setup
@@ -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
- # @!parse include Jackal::Utils::Constants
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
- unless(@_process)
32
- @_process = Utils::Process.new
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(:name => "#{namespace}_#{key}_#{kind}"),
39
- :orphan_callback => lambda{|message|
40
- warn "No callbacks matched message. Auto confirming message from source. (#{message})"
41
- message.confirm!
42
- if(name.to_s.end_with?('input'))
43
- destination = Carnivore::Supervisor.supervisor[name.to_s.sub('_input', '_output')]
44
- if(destination)
45
- warn "Auto pushing orphaned message to next destination (#{message} -> #{destination.name})"
46
- begin
47
- destination.transmit(Utils.unpack(message))
48
- rescue => e
49
- error "Failed to auto push message (#{message}): #{e.class} - #{e}"
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
- end
53
- }
58
+ }
59
+ )
54
60
  )
55
61
  Carnivore::Utils.info "Registered new source: #{namespace}_#{key}_#{kind}"
56
62
  if(kind.to_s == 'input')
@@ -1,4 +1,4 @@
1
1
  module Jackal
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.2.2')
3
+ VERSION = Gem::Version.new('0.2.4')
4
4
  end
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.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-21 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carnivore