rb-kqueue 0.2.6 → 0.2.7

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
  SHA256:
3
- metadata.gz: 0f24844743c7766edc2ddfa6c7c125a5ff7419eac128d6695fcb8da70c07d66b
4
- data.tar.gz: '008dd0f2124471e3a190cb80458774076d6ed5f1cbba1dc020f8e6a0f3250eb8'
3
+ metadata.gz: 523d4296fcd67116273396bc9132da9e83aacfd2dabb268bdcd6ce7de3405406
4
+ data.tar.gz: a41304312b5eb7aec15c210571edf966f3678763be585a57efe5d7fd878ca009
5
5
  SHA512:
6
- metadata.gz: d86c4ef6d17773c5ca1b6567ea9be15b7c2b179bac98253d7c2d230dea89d6ba8c0c20badd335e3944843eb1902b077fb0690eb392ba0b6cf357c8362521676d
7
- data.tar.gz: bbdde67f0d98268d46c7b4c8a13fe0497a017671efdfbab0c7754f577c2a58aa4e8397603f033ad316fb4f28633a6fe78e1ee21c1e3bb71c2c62fc4b6ba0fa7b
6
+ metadata.gz: fd6b826fdab416c3c8f3bb5da0e351158a849d6169545e0ae1833237039ba7c8aa773600b10b40c959ed36e423f1b9f1a44fcfcb00a863a307ba062ccc72e945
7
+ data.tar.gz: 5cf9e86f55267e5127bd2dfd3eb1754ce006ebd442d5a1707a3abcfbe5068a90e42fbc9f70f49e8fcfcca0b0404f4b32c690bea448d75136380d5499b223c1ae
@@ -1,3 +1,3 @@
1
1
  module KQueue
2
- VERSION = [0, 2, 6]
2
+ VERSION = [0, 2, 7]
3
3
  end
@@ -37,20 +37,24 @@ module KQueue
37
37
  FFI.errno)
38
38
  end
39
39
 
40
- ObjectSpace.define_finalizer(self, lambda do
41
- next unless Native.close(@fd) < 0
42
- raise SystemCallError.new(
43
- "Failed to close file #{path}" +
44
- case FFI.errno
45
- when Errno::EBADF::Errno; ": Invalid file descriptor."
46
- when Errno::EINTR::Errno; ": Closing interrupted."
47
- when Errno::EIO::Errno; ": IO error."
48
- else; ""
49
- end,
50
- FFI.errno)
51
- end)
40
+ ObjectSpace.define_finalizer(self, self.class.finalizer(@fd, path))
52
41
  super(queue, @fd, :vnode, flags, nil, callback)
53
42
  end
43
+
44
+ def self.finalizer(fd, path)
45
+ lambda do
46
+ next unless Native.close(fd) < 0
47
+ raise SystemCallError.new(
48
+ "Failed to close file #{path}" +
49
+ case FFI.errno
50
+ when Errno::EBADF::Errno; ": Invalid file descriptor."
51
+ when Errno::EINTR::Errno; ": Closing interrupted."
52
+ when Errno::EIO::Errno; ": IO error."
53
+ else; ""
54
+ end,
55
+ FFI.errno)
56
+ end
57
+ end
54
58
  end
55
59
  end
56
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-kqueue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Arnold
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-04-14 00:00:00.000000000 Z
12
+ date: 2021-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi