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 +4 -4
- data/CHANGELOG.md +3 -0
- data/jackal.gemspec +6 -5
- data/lib/jackal/callback.rb +2 -0
- data/lib/jackal/loader.rb +10 -0
- data/lib/jackal/utils.rb +1 -0
- data/lib/jackal/utils/events.rb +30 -0
- data/lib/jackal/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d37bf7fe3fdd8781b65efb59ee095c8d4246e5f7
|
4
|
+
data.tar.gz: 1c34139ec85c8bf205a300f13da15909b83d5141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2283663ce0cfefde1345b3ff192c2219baa4f76f9351858f662e3dbdda8b18489fb7fe22b3ed4c535566af8b023fdfa78af33379a0c86001d86b9caa665abfa
|
7
|
+
data.tar.gz: ee76400cd2f2ae5206ebd778076d7990d5e93a1da209e57b3ced0fa1ca58686e1f7bd4aae4594b308f34036d44f6320a8c8c13c44757797d06d545197c63a949
|
data/CHANGELOG.md
CHANGED
data/jackal.gemspec
CHANGED
@@ -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.
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
s.
|
17
|
-
s.
|
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'
|
data/lib/jackal/callback.rb
CHANGED
@@ -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
|
data/lib/jackal/loader.rb
CHANGED
@@ -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
|
data/lib/jackal/utils.rb
CHANGED
@@ -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
|
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.3.
|
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-
|
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
|