rflow-components-irc 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/rflow/components/irc/client.rb +11 -3
- data/lib/rflow/components/irc/version.rb +1 -1
- data/rflow-components-irc.gemspec +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfb79dc8f8a832d4326d97e85f9ed6fb259a4f94
|
4
|
+
data.tar.gz: ef0d7d05223440784d24303cea0e9d7a0a2bdc3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d102cf9be927b2a4ebb5e24a3f2b80b1bc36683065b7bc41299f972beb0786c5daad999192250e39757fd112bb067bcb7660debc9093515e8cfdfa3c8893205
|
7
|
+
data.tar.gz: cf64251f82bcd83ae7088b097df4c90eb55f31c3b9597222ed8a392522143ba71d798997f607c02db7e18d7475618437975d540dd97e7cc5998605c3e265a793
|
data/.travis.yml
CHANGED
@@ -8,6 +8,7 @@ rvm:
|
|
8
8
|
before_install:
|
9
9
|
- sudo apt-get install libtool autoconf automake uuid-dev build-essential
|
10
10
|
- wget http://download.zeromq.org/zeromq-3.2.4.tar.gz && tar zxvf zeromq-3.2.4.tar.gz && cd zeromq-3.2.4 && ./configure && make && sudo make install && cd ..
|
11
|
+
- gem update bundler
|
11
12
|
# Only has 4.0.4, need 3.2 version due to old em-zeromq
|
12
13
|
# - sudo add-apt-repository -y ppa:chris-lea/zeromq
|
13
14
|
# - sudo apt-get update
|
@@ -10,6 +10,7 @@ class RFlow
|
|
10
10
|
class Client < RFlow::Component
|
11
11
|
input_port :to_server
|
12
12
|
output_port :from_server
|
13
|
+
output_port :log_port
|
13
14
|
|
14
15
|
attr_accessor :config
|
15
16
|
attr_accessor :client_connection
|
@@ -55,7 +56,7 @@ class RFlow
|
|
55
56
|
client_connection.send_irc_message message
|
56
57
|
else
|
57
58
|
RFlow.logger.debug { "#{name}: Received an IRC::Message message, determining if it's mine" }
|
58
|
-
my_events = message.provenance.find_all {|event| event.component_instance_uuid ==
|
59
|
+
my_events = message.provenance.find_all {|event| event.component_instance_uuid == uuid}
|
59
60
|
RFlow.logger.debug { "#{name}: Found #{my_events.size} processing events from me" }
|
60
61
|
# Attempt to send the data to each context match.
|
61
62
|
# TODO: check for correctness
|
@@ -110,7 +111,7 @@ class RFlow
|
|
110
111
|
m.data.prefix = prefix
|
111
112
|
m.data.command = cmd
|
112
113
|
m.data.parameters = params
|
113
|
-
m.provenance << RFlow::Message::ProcessingEvent.new(client.
|
114
|
+
m.provenance << RFlow::Message::ProcessingEvent.new(client.uuid, Time.now.utc).tap do |e|
|
114
115
|
e.context = signature.to_s
|
115
116
|
e.completed_at = Time.now.utc
|
116
117
|
end
|
@@ -121,8 +122,15 @@ class RFlow
|
|
121
122
|
def unbind(reason = nil)
|
122
123
|
if @connected || @reconnecting
|
123
124
|
RFlow.logger.error "#{client.name}: Disconnected from IRC server #{client.config['server']}:#{client.config['port']} due to '#{reason}', reconnecting ..."
|
125
|
+
|
126
|
+
client.log_port.send_message(RFlow::Message.new('RFlow::Message::Data::Log').tap do |m|
|
127
|
+
m.data.timestamp = Integer(Time.now.to_f * 1000) # ms since epoch
|
128
|
+
m.data.level = 'INFO'
|
129
|
+
m.data.text = "IRC disconnected. Reconnecting in #{client.config['reconnect_interval']} seconds."
|
130
|
+
end)
|
131
|
+
|
124
132
|
EM.add_timer(client.config['reconnect_interval']) do
|
125
|
-
RFlow.logger.
|
133
|
+
RFlow.logger.info "#{client.name}: Attempting reconnect to IRC server #{client.config['server']}:#{client.config['port']}"
|
126
134
|
reconnect(client.config['server'], client.config['port'])
|
127
135
|
end
|
128
136
|
@connected = false
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
22
|
s.require_paths = ["lib"]
|
23
23
|
|
24
|
-
s.add_dependency 'rflow', '~> 1.
|
24
|
+
s.add_dependency 'rflow', '~> 1.1', '>= 1.1.1'
|
25
25
|
|
26
26
|
s.add_development_dependency 'rspec', '~> 3.0'
|
27
27
|
s.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rflow-components-irc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael L. Artz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rflow
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.1'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.1.1
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
29
|
+
version: '1.1'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.1.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rspec
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
118
|
version: '0'
|
113
119
|
requirements: []
|
114
120
|
rubyforge_project: rflow-components-irc
|
115
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.2.2
|
116
122
|
signing_key:
|
117
123
|
specification_version: 4
|
118
124
|
summary: IRC client and server components for the RFlow FBP framework
|