zyre 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +2 -0
- data.tar.gz.sig +0 -0
- data/History.md +8 -0
- data/LICENSE.txt +20 -0
- data/README.md +104 -0
- data/ext/zyre_ext/event.c +479 -0
- data/ext/zyre_ext/extconf.rb +25 -0
- data/ext/zyre_ext/node.c +850 -0
- data/ext/zyre_ext/poller.c +272 -0
- data/ext/zyre_ext/zyre_ext.c +154 -0
- data/ext/zyre_ext/zyre_ext.h +99 -0
- data/lib/observability/instrumentation/zyre.rb +52 -0
- data/lib/zyre.rb +53 -0
- data/lib/zyre/event.rb +82 -0
- data/lib/zyre/event/enter.rb +19 -0
- data/lib/zyre/event/evasive.rb +17 -0
- data/lib/zyre/event/exit.rb +18 -0
- data/lib/zyre/event/join.rb +18 -0
- data/lib/zyre/event/leave.rb +18 -0
- data/lib/zyre/event/shout.rb +19 -0
- data/lib/zyre/event/silent.rb +18 -0
- data/lib/zyre/event/stop.rb +9 -0
- data/lib/zyre/event/whisper.rb +18 -0
- data/lib/zyre/node.rb +147 -0
- data/lib/zyre/poller.rb +16 -0
- data/lib/zyre/testing.rb +296 -0
- data/spec/observability/instrumentation/zyre_spec.rb +56 -0
- data/spec/spec_helper.rb +62 -0
- data/spec/zyre/event_spec.rb +141 -0
- data/spec/zyre/node_spec.rb +356 -0
- data/spec/zyre/poller_spec.rb +44 -0
- data/spec/zyre/testing_spec.rb +260 -0
- data/spec/zyre_spec.rb +55 -0
- metadata +224 -0
- metadata.gz.sig +3 -0
data/spec/zyre_spec.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env rspec -cfd
|
2
|
+
|
3
|
+
require_relative 'spec_helper'
|
4
|
+
|
5
|
+
require 'zyre'
|
6
|
+
|
7
|
+
|
8
|
+
RSpec.describe Zyre do
|
9
|
+
|
10
|
+
|
11
|
+
# Pattern for matching IPv4 addresses
|
12
|
+
IPV4_ADDRESS = /^((?:(?:^|\.)(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){4})$/
|
13
|
+
|
14
|
+
|
15
|
+
it "knows what version of the underlying library it's using" do
|
16
|
+
expect( described_class.zyre_version ).to be_a( Integer )
|
17
|
+
expect( described_class.zyre_version ).to be >= 2_00_00
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
it "knows what broadcast-capable network interfaces are available" do
|
22
|
+
result = described_class.interfaces
|
23
|
+
expect( result ).to be_a( Hash )
|
24
|
+
expect( result.size ).to be >= 1
|
25
|
+
|
26
|
+
iface = result.keys.first
|
27
|
+
expect( iface ).to match( /\A\p{Alpha}\S+\z/ )
|
28
|
+
|
29
|
+
# :FIXME: This might be flaky for several reasons: no network interfaces,
|
30
|
+
# first interface is IPv6, etc.
|
31
|
+
expect( result[iface] ).to be_a( Hash ).
|
32
|
+
and include( :address, :broadcast, :netmask )
|
33
|
+
expect( result[iface][:address] ).to match( IPV4_ADDRESS )
|
34
|
+
expect( result[iface][:broadcast] ).to match( IPV4_ADDRESS )
|
35
|
+
expect( result[iface][:netmask] ).to match( IPV4_ADDRESS )
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
it "can normalize symbol-keyed headers into an RFC822-style string Hash" do
|
40
|
+
headers = {
|
41
|
+
protocol_version: 2,
|
42
|
+
content_type: 'application/json',
|
43
|
+
'disposition' => 'attachment'.b
|
44
|
+
}
|
45
|
+
result = described_class.normalize_headers( headers )
|
46
|
+
|
47
|
+
expect( result ).to include( 'Protocol-version', 'Content-type', 'disposition' )
|
48
|
+
expect( result['Protocol-version'] ).to eq( '2' )
|
49
|
+
expect( result['Content-type'] ).to eq( 'application/json' )
|
50
|
+
expect( result['disposition'] ).to eq( 'attachment' )
|
51
|
+
expect( result['disposition'].encoding ).to eq( Encoding::US_ASCII )
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
metadata
ADDED
@@ -0,0 +1,224 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zyre
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Granger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIID+DCCAmCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
14
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0xOTEyMjQyMDE5NTFaFw0yMDEyMjMyMDE5
|
15
|
+
NTFaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
16
|
+
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
17
|
+
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
18
|
+
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
|
19
|
+
5PU2AEbf04GGSrmqADGWXeaslaoRdb1fu/0M5qfPTRn5V39sWD9umuDAF9qqil/x
|
20
|
+
Sl6phTvgBrG8GExHbNZpLARd3xrBYLEFsX7RvBn2UPfgsrtvpdXjsHGfpT3IPN+B
|
21
|
+
vQ66lts4alKC69TE5cuKasWBm+16A4aEe3XdZBRNmtOu/g81gvwA7fkJHKllJuaI
|
22
|
+
dXzdHqq+zbGZVSQ7pRYHYomD0IiDe1DbIouFnPWmagaBnGHwXkDT2bKKP+s2v21m
|
23
|
+
ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
|
24
|
+
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYD
|
25
|
+
VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4DANBgkqhkiG
|
26
|
+
9w0BAQsFAAOCAYEAifxlz7x0EfT3fjhM520ZEIrWa+tLMuLKNefkY18u8tZnx4EX
|
27
|
+
Xxwh3tna3fvNfrOrdY5leIj1dbv4FTRg+gIBnIxAySqvpGvI/Axg5EdYbwninCLL
|
28
|
+
LAKCmRo+5QwaPMYN2zdHIjGrp8jg1neCo5zy6tVvyTv0DMI6FLrydVJYduMMDFSy
|
29
|
+
gQKR1rVOcCJtnBnLCF9+kKEUKohAHOmGsE7OBZFnjMIpH5yUDUVJKByv0gIipFt0
|
30
|
+
1T6zff6oVU0w8WBiNKR381+6sF3wIZVnVY0XeJg6hNL+YecE8ILxLhHTmtT/BO0S
|
31
|
+
3xPze9uXDR+iD6HYl8KU5QEg/dXFPhfQb512vVkTJDZvMcwu6PxDUjHFChLjAji/
|
32
|
+
AZXjg1C5E9znTkeUR8ieU9F1MOKoiH57a5lYSTI8Ga8PpsNXTxNeXc16Ob26CqrJ
|
33
|
+
83uuAYSy65yXDGXXPVBeKPVnYrqp91pqpS5Nh7wfuiCrE8lgU8PATh7K4BV1UhAT
|
34
|
+
0MHbAT42wTYkfUj3
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
37
|
+
dependencies:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: loggability
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0.17'
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0.17'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rake-deveiate
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0.15'
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.15.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.15'
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 0.15.1
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rake-compiler
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - "~>"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '1.1'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.1'
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: rubocop
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - "~>"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0.91'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0.91'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rspec_junit_formatter
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0.4'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0.4'
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: simplecov-cobertura
|
116
|
+
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - "~>"
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '1.4'
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "~>"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '1.4'
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: observability
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - "~>"
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0.3'
|
135
|
+
type: :development
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - "~>"
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0.3'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rspec-wait
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - "~>"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0.0'
|
149
|
+
type: :development
|
150
|
+
prerelease: false
|
151
|
+
version_requirements: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0.0'
|
156
|
+
description: A ZRE library for Ruby. This is a Ruby (MRI) binding for the Zyre library
|
157
|
+
for reliable group messaging over local area networks, an implementation of the
|
158
|
+
ZeroMQ Realtime Exchange protocol.
|
159
|
+
email:
|
160
|
+
- ged@faeriemud.org
|
161
|
+
executables: []
|
162
|
+
extensions:
|
163
|
+
- ext/zyre_ext/extconf.rb
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- History.md
|
167
|
+
- LICENSE.txt
|
168
|
+
- README.md
|
169
|
+
- ext/zyre_ext/event.c
|
170
|
+
- ext/zyre_ext/extconf.rb
|
171
|
+
- ext/zyre_ext/node.c
|
172
|
+
- ext/zyre_ext/poller.c
|
173
|
+
- ext/zyre_ext/zyre_ext.c
|
174
|
+
- ext/zyre_ext/zyre_ext.h
|
175
|
+
- lib/observability/instrumentation/zyre.rb
|
176
|
+
- lib/zyre.rb
|
177
|
+
- lib/zyre/event.rb
|
178
|
+
- lib/zyre/event/enter.rb
|
179
|
+
- lib/zyre/event/evasive.rb
|
180
|
+
- lib/zyre/event/exit.rb
|
181
|
+
- lib/zyre/event/join.rb
|
182
|
+
- lib/zyre/event/leave.rb
|
183
|
+
- lib/zyre/event/shout.rb
|
184
|
+
- lib/zyre/event/silent.rb
|
185
|
+
- lib/zyre/event/stop.rb
|
186
|
+
- lib/zyre/event/whisper.rb
|
187
|
+
- lib/zyre/node.rb
|
188
|
+
- lib/zyre/poller.rb
|
189
|
+
- lib/zyre/testing.rb
|
190
|
+
- spec/observability/instrumentation/zyre_spec.rb
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
- spec/zyre/event_spec.rb
|
193
|
+
- spec/zyre/node_spec.rb
|
194
|
+
- spec/zyre/poller_spec.rb
|
195
|
+
- spec/zyre/testing_spec.rb
|
196
|
+
- spec/zyre_spec.rb
|
197
|
+
homepage: https://gitlab.com/ravngroup/open-source/ruby-zyre
|
198
|
+
licenses:
|
199
|
+
- BSD-3-Clause
|
200
|
+
metadata:
|
201
|
+
homepage_uri: https://gitlab.com/ravngroup/open-source/ruby-zyre
|
202
|
+
documentation_uri: https://deveiate.org/code/zyre
|
203
|
+
changelog_uri: https://deveiate.org/code/zyre/History_md.html
|
204
|
+
source_uri: https://gitlab.com/ravngroup/open-source/ruby-zyre/-/tree/master
|
205
|
+
post_install_message:
|
206
|
+
rdoc_options: []
|
207
|
+
require_paths:
|
208
|
+
- lib
|
209
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - ">="
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '0'
|
219
|
+
requirements: []
|
220
|
+
rubygems_version: 3.1.4
|
221
|
+
signing_key:
|
222
|
+
specification_version: 4
|
223
|
+
summary: A ZRE library for Ruby.
|
224
|
+
test_files: []
|
metadata.gz.sig
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
$�{��!��qZ͝���-�c}��U�P%'U���1��{���{%.�X�:�r���](�-��;�Λ��AC]~S����tZ$��#��L9��1���`~ /59Y��܄�P~�J�E:�H��߄��j�R%\�I%��ƏTV�Ld�\���^���O��a�Hd��E�*�I���t>�,W+%��2����:�*
|
2
|
+
+�y��L�Р�j�+�L�0]�]�=L&zb�����Kޝ�O���re���a�^��� Jg��4BZ�K0n�J���gE¬�`Y��1��M^��S(�$�����n�PZS��vl_��);�j��Q
|
3
|
+
�I{���_V��,��8��
|