rbzk 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 683a39e67965c9497615c0371514fe71ce8a047cf0b083b1ae464f4320d3bd0f
4
- data.tar.gz: b640310d6e167e6d4c07027298769bd4d1038ba71584f6860d79091189791f85
3
+ metadata.gz: 15c22b690a9f4468b2cd2a819f0d98002c7127ca05a60d32900ffbb93b1785c1
4
+ data.tar.gz: 6bdccf44dc137c44fa32502a33b5e22331535c628413b99049186c84ef38ab2e
5
5
  SHA512:
6
- metadata.gz: 2002e3c54b5626142cabdf2433baacdc8d116f79ac3831afe20b88b5c5a287019c20cf5c6e494170975affb7476e32b8986123826894beffb2a2a1dff0c5ad43
7
- data.tar.gz: 4f27bac72f9241163ae046b36082ff76be75078d8e6a51ea91001cea141d6355e5af821c6b4d54d62a28db7ec11f382477663ee1f34883f1ea569b506435863b
6
+ metadata.gz: 00710ea8cd440e358a368179472ed0e3663368c93b9c73b3eb4247da44a2bfb8d4890b5a1d228373f2414fa24af330388bbc5095aca027a97cc0acdd0d293387
7
+ data.tar.gz: ebfee036a5b801a0186e5bf59afedce2e5ef9cd4301fce3c02000b1601198d3a6acf6eb6a59fb531061540a26973ddb1e673894263b6df68b777e1d04138d836
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Ruby implementation of the ZK protocol for fingerprint and biometric attendance devices.
4
4
 
5
+ This project is inspired by and based on the [pyzk Python library](https://github.com/fananimi/pyzk), adapting its protocol implementation to Ruby while maintaining compatibility with ZKTeco devices.
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
data/lib/rbzk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBZK
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/rbzk/zk.rb CHANGED
@@ -15,8 +15,13 @@ module RBZK
15
15
 
16
16
  def test_ping
17
17
  begin
18
- system("ping -c 1 -W 5 #{@ip} > /dev/null 2>&1")
19
- return $?.success?
18
+ Timeout.timeout(5) do
19
+ s = TCPSocket.new(@ip, @port)
20
+ s.close
21
+ return true
22
+ end
23
+ rescue Timeout::Error, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError => e
24
+ return false
20
25
  rescue => e
21
26
  return false
22
27
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbzk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khaled AbuShqear
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-21 00:00:00.000000000 Z
10
+ date: 2025-05-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bytes