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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45218ba7c579c8674c984e1a83fa2afe215402ed
4
- data.tar.gz: 793385f2bcd5587cdf11047e5427dfe8436bb206
3
+ metadata.gz: eec416048b475825ac7608f06c5ad6a19af64621
4
+ data.tar.gz: d2655d443d2985284b57876211f4f7e8fc37b1ca
5
5
  SHA512:
6
- metadata.gz: 51dd80db361b32eb2b0b5dae29a5a08ce27d90473566cb36a21b5dabc3f6a837c2fb0fe6992d63f98141edf7bc457101478eb794e88effa7d7c366731e4f1859
7
- data.tar.gz: 243272b1f2e1d4b30525e6da08e23f962bed1f5a0d068fb9640233368a20bc49867b7dfd6da35ac525837ff7594f279775f7926a458f46e049e8347072557ed4
6
+ metadata.gz: 5260e4d7d4888c8916d3ef53f8b9461397d7efd1bce1668529b09746831f60bb91058079eb82b79196256f0338ae9f776bca64e8c980771a8644c406a8f078b1
7
+ data.tar.gz: 92cbd2aca339b1b063c99a9fa25e1b49aacf5bd60ecfcdcbd3a407b156d4fd8ec63e79379f5238b7bbf7de51d5d60f2199e3563bbe1b671ac061d8543480f9ee
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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.0
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
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE2MDExOTE0MTUyNVoXDTE3MDExODE0MTUyNVowSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAMw9ZEKGJysjfGB97gh2L884jzymuenfVeYmX7ZIDJarTuHi5Jjtl0x5+399
19
- YpObcoYD2kAMIMTXJl6ZaOUtjBXKFLK4JzKxm9Sk1ivagF5tfgdoFzlc25xzqJbQ
20
- xvS9qqLM25zj6O5G3/HegthOQNXRODJuwa2prZ8/9pBQhKKy/CNmD6Ly6ar5Uy5I
21
- 8D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QB+A53lZgv65cKi2MtGR1xUBUjZab
18
+ RGrVAfTS9afvTujmoZ61BsWWUQHiQu+9U8174/7JQhAJNMmDM0FXBn6QAgJpOw6s
19
+ 4kN5I7F8vTVpM4yp7zq2pR/HPerTyZzuebm/dZaoAEvUFd6zChtOPgN7FEILyCke
20
+ yMwXDC5MfZVM+8Oga41YJIghu97mmvf9hvGcXYWLY+6DaadhQRvfGkfhesBoPG5W
21
+ Q05qceHNhABrCTJdCO+BJIwJ3A0YkDIZzNWXR6VbJVxqggr1SZhbnyAQ6HWmapIs
22
+ ace9XishKEyMwjsxAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
+ HQYDVR0OBBYEFNdRuJnQ5ZAIbOGjkMrk3ZjFgGyxMCYGA1UdEQQfMB2BG2dlbW1h
24
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
+ ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBAKGs6VYnuZm6Yr/LKFUa
26
+ 1lbWK6pv/lFtzaf4BcFNrCJUUefmmt5rLrAVEhoPvIAt2j4xqNxGUNlQijW5yimF
27
+ u0qjD1I6xBa+Im4IlnoXIYeJmrd3R05mnD+L1hoa/3kyzxXn2pfEUDGLOwoomMj0
28
+ ab7aVh6HLeSv7hlqseXrZzpXpkf83NUU/VKrqa0YTsc6E85641xyh1CgQHqJdYgG
29
+ T67weCbXQc/VXDmbIFGJYPPBwtwaZV+BASYSljzs5h04Pj+qYXOCzDcs+PEc2Plf
30
+ UcYTvu3QIfYeGXXfoT2URmFVLXZwf0Mmk8X04wGu0Ffp+U57v1nMdyfXTpY0jHA2
31
+ wZ0=
33
32
  -----END CERTIFICATE-----
34
- date: 2016-04-19 00:00:00.000000000 Z
33
+ date: 2018-08-05 00:00:00.000000000 Z
35
34
  dependencies: []
36
35
  description:
37
- email: james@r0bertson.co.uk
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.4.8
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