secret_knock 0.3.0 → 0.3.1
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 +0 -0
- data.tar.gz.sig +0 -0
- data/lib/secret_knock.rb +11 -3
- metadata +23 -24
- 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: eec416048b475825ac7608f06c5ad6a19af64621
|
4
|
+
data.tar.gz: d2655d443d2985284b57876211f4f7e8fc37b1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5260e4d7d4888c8916d3ef53f8b9461397d7efd1bce1668529b09746831f60bb91058079eb82b79196256f0338ae9f776bca64e8c980771a8644c406a8f078b1
|
7
|
+
data.tar.gz: 92cbd2aca339b1b063c99a9fa25e1b49aacf5bd60ecfcdcbd3a407b156d4fd8ec63e79379f5238b7bbf7de51d5d60f2199e3563bbe1b671ac061d8543480f9ee
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/secret_knock.rb
CHANGED
@@ -8,9 +8,9 @@ class SecretKnock
|
|
8
8
|
attr_reader :h, :message, :listening
|
9
9
|
|
10
10
|
def initialize(verbose: true, external: nil,
|
11
|
-
short_delay: 0.35, long_delay: 0.9)
|
11
|
+
short_delay: 0.35, long_delay: 0.9, debug: false)
|
12
12
|
|
13
|
-
@verbose, @external = verbose, external
|
13
|
+
@verbose, @external, @debug = verbose, external, debug
|
14
14
|
|
15
15
|
# ranked by frequency. see https://en.wikipedia.org/wiki/Letter_frequency
|
16
16
|
keys = ["e", "t", "a", "o", "i", "n", "s", "h", "r", "d", "l", "c", "u", "m",
|
@@ -54,6 +54,7 @@ class SecretKnock
|
|
54
54
|
playback knockerize(s)
|
55
55
|
end
|
56
56
|
|
57
|
+
# listens for knocking in the background which allows the control
|
57
58
|
def detect(timeout: 2, repeat: true)
|
58
59
|
|
59
60
|
listen
|
@@ -108,6 +109,9 @@ class SecretKnock
|
|
108
109
|
@t = Time.now
|
109
110
|
|
110
111
|
@external.knock if @external
|
112
|
+
|
113
|
+
puts '@a: ' + @a.inspect if @debug
|
114
|
+
|
111
115
|
end
|
112
116
|
|
113
117
|
alias knock knocked
|
@@ -169,6 +173,10 @@ class SecretKnock
|
|
169
173
|
end
|
170
174
|
|
171
175
|
end
|
176
|
+
|
177
|
+
def reset()
|
178
|
+
@a = []
|
179
|
+
end
|
172
180
|
|
173
181
|
def short_pause()
|
174
182
|
sleep @short_delay + 0.1
|
@@ -191,4 +199,4 @@ class SecretKnock
|
|
191
199
|
|
192
200
|
end
|
193
201
|
|
194
|
-
end
|
202
|
+
end
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,31 +10,30 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
+
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Zs+o5zexvKrktw==
|
13
|
+
MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwODA1MDMzODQ4WhcN
|
15
|
+
MTkwODA1MDMzODQ4WjAsMSowKAYDVQQDDC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vu3QIfYeGXXfoT2URmFVLXZwf0Mmk8X04wGu0Ffp+U57v1nMdyfXTpY0jHA2
|
31
|
+
wZ0=
|
33
32
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
33
|
+
date: 2018-08-05 00:00:00.000000000 Z
|
35
34
|
dependencies: []
|
36
35
|
description:
|
37
|
-
email: james@
|
36
|
+
email: james@jamesrobertson.eu
|
38
37
|
executables: []
|
39
38
|
extensions: []
|
40
39
|
extra_rdoc_files: []
|
@@ -60,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
59
|
version: '0'
|
61
60
|
requirements: []
|
62
61
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.6.13
|
64
63
|
signing_key:
|
65
64
|
specification_version: 4
|
66
65
|
summary: Listens for a hidden message in a succession of knocks (or button presses)
|
metadata.gz.sig
CHANGED
Binary file
|