jackal 0.3.16 → 0.3.18

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: 9f7870c19fd3fa82eff237643836103515b7f8be
4
- data.tar.gz: c9aac6405362913a7735b7d8a66fe221940b1af8
3
+ metadata.gz: d37bf7fe3fdd8781b65efb59ee095c8d4246e5f7
4
+ data.tar.gz: 1c34139ec85c8bf205a300f13da15909b83d5141
5
5
  SHA512:
6
- metadata.gz: 2d011a1fb7f3f25f65012936380927a13152cb90fcbcfa7b0e5a42a5d40b0482c6373c0c399172267ffd6eb8c53f726fa9497d0a6c376d86815d676ae77b2f8a
7
- data.tar.gz: bb8c5378964a7e7663a3757fe32e9977be55d85e1d3e32b0f34833b62aadd7e4da37e50db159b2d7740e125303b8fd540e77f5266f8529e639cffe42d7c7b624
6
+ metadata.gz: c2283663ce0cfefde1345b3ff192c2219baa4f76f9351858f662e3dbdda8b18489fb7fe22b3ed4c535566af8b023fdfa78af33379a0c86001d86b9caa665abfa
7
+ data.tar.gz: ee76400cd2f2ae5206ebd778076d7990d5e93a1da209e57b3ced0fa1ca58686e1f7bd4aae4594b308f34036d44f6320a8c8c13c44757797d06d545197c63a949
@@ -1,3 +1,6 @@
1
+ # v0.3.18
2
+ * Add support for event generation
3
+
1
4
  # v0.3.16
2
5
  * Add `app_host` configuration helper method
3
6
 
@@ -10,11 +10,12 @@ Gem::Specification.new do |s|
10
10
  s.description = 'Message processing helper'
11
11
  s.require_path = 'lib'
12
12
  s.license = 'Apache 2.0'
13
- s.add_dependency 'carnivore', '>= 0.3.14', '< 1.0.0'
14
- s.add_dependency 'bogo', '>= 0.1.24', '< 1.0.0'
15
- s.add_dependency 'bogo-cli', '~> 0.1'
16
- s.add_dependency 'bogo-config', '>= 0.1.12', '< 1.0.0'
17
- s.add_dependency 'childprocess'
13
+ s.add_runtime_dependency 'carnivore', '>= 0.3.14', '< 1.0.0'
14
+ s.add_runtime_dependency 'bogo', '>= 0.1.24', '< 1.0.0'
15
+ s.add_runtime_dependency 'bogo-cli', '~> 0.1'
16
+ s.add_runtime_dependency 'bogo-config', '>= 0.1.12', '< 1.0.0'
17
+ s.add_runtime_dependency 'childprocess'
18
+ s.add_development_dependency 'carnivore-actor'
18
19
  s.files = Dir['{lib,bin}/**/**/*'] + %w(jackal.gemspec README.md CHANGELOG.md CONTRIBUTING.md LICENSE)
19
20
  s.executables << 'jackal'
20
21
  s.executables << 'jackal-test'
@@ -7,8 +7,10 @@ module Jackal
7
7
 
8
8
  include Utils::Payload
9
9
  include Utils::Config
10
+ include Utils::Events
10
11
  # @!parse include Jackal::Utils::Payload
11
12
  # @!parse include Jackal::Utils::Config
13
+ # @!parse include Jackal::Utils::Events
12
14
 
13
15
  include Bogo::Constants
14
16
  include Bogo::Memoization
@@ -98,6 +98,16 @@ module Jackal
98
98
  end
99
99
  end
100
100
  end
101
+ if(events_opts = Carnivore::Config.get(:jackal, :events))
102
+ Carnivore.configure do
103
+ Carnivore::Source.build(
104
+ :type => events_opts[:type].to_sym,
105
+ :args => events_opts.fetch(:args, {}).merge(
106
+ :name => :events
107
+ )
108
+ )
109
+ end
110
+ end
101
111
  Jackal::Utils.load_http_hook
102
112
  Carnivore.start!
103
113
  rescue => e
@@ -16,6 +16,7 @@ module Jackal
16
16
  autoload :Constants, 'jackal/utils/constants'
17
17
  autoload :HttpApi, 'jackal/utils/http_api'
18
18
  autoload :Process, 'jackal/utils/process'
19
+ autoload :Events, 'jackal/utils/events'
19
20
 
20
21
  extend Payload
21
22
  extend Constants
@@ -0,0 +1,30 @@
1
+ require 'jackal'
2
+
3
+ module Jackal
4
+ module Utils
5
+ # Event generation helper
6
+ module Events
7
+
8
+ # Send event
9
+ #
10
+ # @param type [String, Symbol] event type
11
+ # @param data [Smash] optional data
12
+ # @return [NilClass]
13
+ def event!(type, data=Smash.new)
14
+ event_source = Carnivore::Supervisor.supervisor[:events]
15
+ if(event_source)
16
+ payload = new_payload(
17
+ :event, :event => Smash.new(
18
+ :type => type,
19
+ :stamp => Time.now.to_f,
20
+ :data => data
21
+ )
22
+ )
23
+ debug "Sending event data - type: #{type} ID: #{payload[:id]} data: #{data.inspect}"
24
+ event_source.transmit(payload)
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -1,4 +1,4 @@
1
1
  module Jackal
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.3.16')
3
+ VERSION = Gem::Version.new('0.3.18')
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.3.16
4
+ version: 0.3.18
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-07-16 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carnivore
@@ -98,6 +98,20 @@ dependencies:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
+ - !ruby/object:Gem::Dependency
102
+ name: carnivore-actor
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
101
115
  description: Message processing helper
102
116
  email: code@chrisroberts.org
103
117
  executables:
@@ -122,6 +136,7 @@ files:
122
136
  - lib/jackal/utils.rb
123
137
  - lib/jackal/utils/config.rb
124
138
  - lib/jackal/utils/constants.rb
139
+ - lib/jackal/utils/events.rb
125
140
  - lib/jackal/utils/http_api.rb
126
141
  - lib/jackal/utils/payload.rb
127
142
  - lib/jackal/utils/process.rb