secret_knock 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -2
- data/lib/secret_knock.rb +22 -8
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45218ba7c579c8674c984e1a83fa2afe215402ed
|
4
|
+
data.tar.gz: 793385f2bcd5587cdf11047e5427dfe8436bb206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51dd80db361b32eb2b0b5dae29a5a08ce27d90473566cb36a21b5dabc3f6a837c2fb0fe6992d63f98141edf7bc457101478eb794e88effa7d7c366731e4f1859
|
7
|
+
data.tar.gz: 243272b1f2e1d4b30525e6da08e23f962bed1f5a0d068fb9640233368a20bc49867b7dfd6da35ac525837ff7594f279775f7926a458f46e049e8347072557ed4
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
SYT�[�4|�j��ØG�m��&�k�VJ��l���,��7�S|g�2(�E7�y�#]�d#UtZ��B��u
|
2
|
+
�N �%��~��Պ��Bu
|
data/lib/secret_knock.rb
CHANGED
@@ -55,15 +55,31 @@ class SecretKnock
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def detect(timeout: 2, repeat: true)
|
58
|
-
|
58
|
+
|
59
59
|
listen
|
60
60
|
|
61
61
|
Thread.new do
|
62
|
-
|
62
|
+
|
63
|
+
if @external and @external.respond_to? :on_listening then
|
64
|
+
@external.on_listening
|
65
|
+
end
|
66
|
+
|
63
67
|
sleep 0.2 while @t + timeout > Time.now or @a.length <= 1
|
68
|
+
|
69
|
+
if @external and @external.respond_to? :on_processing then
|
70
|
+
@external.on_processing
|
71
|
+
end
|
72
|
+
|
64
73
|
msg = decipher()
|
65
74
|
on_timeout msg
|
66
|
-
|
75
|
+
|
76
|
+
begin
|
77
|
+
@external.message msg if @external
|
78
|
+
rescue
|
79
|
+
puts
|
80
|
+
puts "\rSecretKnock @external notifier " + ($!).inspect
|
81
|
+
end
|
82
|
+
|
67
83
|
detect(timeout: timeout, repeat: repeat) if repeat
|
68
84
|
end
|
69
85
|
end
|
@@ -99,8 +115,6 @@ class SecretKnock
|
|
99
115
|
def knocks(n)
|
100
116
|
|
101
117
|
n.times { knocked }
|
102
|
-
|
103
|
-
puts (['knock'] * n).join ', ' if @verbose
|
104
118
|
short_pause
|
105
119
|
|
106
120
|
end
|
@@ -171,10 +185,10 @@ class SecretKnock
|
|
171
185
|
|
172
186
|
def decipher()
|
173
187
|
|
174
|
-
@a.join.gsub(/(\d{2})(\d)/,'\1,\2').split(',')
|
175
|
-
.inject([]) do |r, x|
|
188
|
+
@a.join.gsub(/(\d{2})(\d)/,'\1,\2').split(',').inject([]) do |r, x|
|
176
189
|
(x != '42' ? r << @hb[x.to_i] : r[0..-2])
|
177
|
-
end.join
|
190
|
+
end.join
|
191
|
+
|
178
192
|
end
|
179
193
|
|
180
194
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: secret_knock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
99xt/V2xyDfAqj78KwcwRRl/reRM/gEwgnYu81SLIJj/VBHE111bleyFUb95Y6rQ
|
32
32
|
Zs+o5zexvKrktw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
34
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
Binary file
|