rb-inotify 0.9.5 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/VERSION +1 -1
- data/lib/rb-inotify.rb +2 -1
- data/lib/rb-inotify/errors.rb +3 -0
- data/lib/rb-inotify/event.rb +1 -1
- data/lib/rb-inotify/notifier.rb +15 -5
- data/rb-inotify.gemspec +6 -4
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MjdkMDg4NDNjNGI0ZWY5ZWU0MGY5ZDlkMDE0NTljYTdjZjhkOWE5NQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NjNiOGM3MzlhZWRiMWM3NzQyMTRjZTFiYzgwNGQyOTFlOTBkOTVlOQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OTVjMWMyYjE3ZDc3MmM0NDQ5NDY3MzAyZDNkMTllYTQyMjNjMWFjMzc0NDkz
|
10
|
+
Yzg4YjY0ZjdmZDExYTY4MDBmMDNjNjAyYTIzYTAzNTdhMDc0YWVmMTlkNzcy
|
11
|
+
NmNmNTYyNWE4YTAwN2Y1NmQ0YjAwZmJjNDQ1MWViYzc4NTdmN2Y=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2UwMjc1M2EyZTYyM2FmZDZlYjE2OTYzNzQ3MmUyOGY5MmUyOTc5MDliNGUz
|
14
|
+
ZDYxYzdlNzdhNWQ4ZjU0ZjE2NzhiMjc5MzNhMzFkN2E4YTNiMWM3ZjI4OWJk
|
15
|
+
YjZlMTQ4ZDBlNGI3ZWRmYTNlMDNhYzFiYzgwMWFiNWVkZmQyMzU=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.7
|
data/lib/rb-inotify.rb
CHANGED
@@ -3,6 +3,7 @@ require 'rb-inotify/native/flags'
|
|
3
3
|
require 'rb-inotify/notifier'
|
4
4
|
require 'rb-inotify/watcher'
|
5
5
|
require 'rb-inotify/event'
|
6
|
+
require 'rb-inotify/errors'
|
6
7
|
|
7
8
|
# The root module of the library, which is laid out as so:
|
8
9
|
#
|
@@ -13,5 +14,5 @@ module INotify
|
|
13
14
|
# An array containing the version number of rb-inotify.
|
14
15
|
# The numbers in the array are the major, minor, and patch versions,
|
15
16
|
# respectively.
|
16
|
-
VERSION = [0, 9,
|
17
|
+
VERSION = [0, 9, 7]
|
17
18
|
end
|
data/lib/rb-inotify/event.rb
CHANGED
@@ -117,7 +117,7 @@ module INotify
|
|
117
117
|
@notifier = notifier
|
118
118
|
@watcher_id = @native[:wd]
|
119
119
|
|
120
|
-
raise
|
120
|
+
raise QueueOverflowError.new("inotify event queue has overflowed.") if @native[:mask] & Native::Flags::IN_Q_OVERFLOW != 0
|
121
121
|
end
|
122
122
|
|
123
123
|
# Calls the callback of the watcher that fired this event,
|
data/lib/rb-inotify/notifier.rb
CHANGED
@@ -242,6 +242,7 @@ module INotify
|
|
242
242
|
#
|
243
243
|
# @raise [SystemCallError] if closing the underlying file descriptor fails.
|
244
244
|
def close
|
245
|
+
stop
|
245
246
|
if Native.close(@fd) == 0
|
246
247
|
@watchers.clear
|
247
248
|
return
|
@@ -255,9 +256,11 @@ module INotify
|
|
255
256
|
FFI.errno)
|
256
257
|
end
|
257
258
|
|
258
|
-
# Blocks until there are one or more filesystem events
|
259
|
-
#
|
260
|
-
#
|
259
|
+
# Blocks until there are one or more filesystem events that this notifier
|
260
|
+
# has watchers registered for. Once there are events, returns their {Event}
|
261
|
+
# objects.
|
262
|
+
#
|
263
|
+
# This can return an empty list if the watcher was closed elsewhere.
|
261
264
|
#
|
262
265
|
# {#run} or {#process} are ususally preferable to calling this directly.
|
263
266
|
def read_events
|
@@ -269,11 +272,12 @@ module INotify
|
|
269
272
|
rescue SystemCallError => er
|
270
273
|
# EINVAL means that there's more data to be read
|
271
274
|
# than will fit in the buffer size
|
272
|
-
raise er unless er.errno == Errno::EINVAL::Errno
|
275
|
+
raise er unless er.errno == Errno::EINVAL::Errno && tries < 5
|
273
276
|
size *= 2
|
274
277
|
tries += 1
|
275
278
|
retry
|
276
279
|
end
|
280
|
+
return [] if data.nil?
|
277
281
|
|
278
282
|
events = []
|
279
283
|
cookies = {}
|
@@ -292,7 +296,13 @@ module INotify
|
|
292
296
|
# Same as IO#readpartial, or as close as we need.
|
293
297
|
def readpartial(size)
|
294
298
|
# Use Ruby's readpartial if possible, to avoid blocking other threads.
|
295
|
-
|
299
|
+
begin
|
300
|
+
return to_io.readpartial(size) if self.class.supports_ruby_io?
|
301
|
+
rescue Errno::EBADF
|
302
|
+
# If the IO has already been closed, reading from it will cause
|
303
|
+
# Errno::EBADF.
|
304
|
+
return nil
|
305
|
+
end
|
296
306
|
|
297
307
|
tries = 0
|
298
308
|
begin
|
data/rb-inotify.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: rb-inotify 0.9.7 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "rb-inotify"
|
8
|
-
s.version = "0.9.
|
9
|
+
s.version = "0.9.7"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Nathan Weizenbaum"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2016-02-08"
|
13
15
|
s.description = "A Ruby wrapper for Linux's inotify, using FFI"
|
14
16
|
s.email = "nex342@gmail.com"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -22,6 +24,7 @@ Gem::Specification.new do |s|
|
|
22
24
|
"Rakefile",
|
23
25
|
"VERSION",
|
24
26
|
"lib/rb-inotify.rb",
|
27
|
+
"lib/rb-inotify/errors.rb",
|
25
28
|
"lib/rb-inotify/event.rb",
|
26
29
|
"lib/rb-inotify/native.rb",
|
27
30
|
"lib/rb-inotify/native/flags.rb",
|
@@ -30,8 +33,7 @@ Gem::Specification.new do |s|
|
|
30
33
|
"rb-inotify.gemspec"
|
31
34
|
]
|
32
35
|
s.homepage = "http://github.com/nex3/rb-inotify"
|
33
|
-
s.
|
34
|
-
s.rubygems_version = "2.0.3"
|
36
|
+
s.rubygems_version = "2.4.3"
|
35
37
|
s.summary = "A Ruby wrapper for Linux's inotify, using FFI"
|
36
38
|
|
37
39
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb-inotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: yard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.4.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.4.0
|
41
41
|
description: A Ruby wrapper for Linux's inotify, using FFI
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- Rakefile
|
52
52
|
- VERSION
|
53
53
|
- lib/rb-inotify.rb
|
54
|
+
- lib/rb-inotify/errors.rb
|
54
55
|
- lib/rb-inotify/event.rb
|
55
56
|
- lib/rb-inotify/native.rb
|
56
57
|
- lib/rb-inotify/native/flags.rb
|
@@ -66,17 +67,17 @@ require_paths:
|
|
66
67
|
- lib
|
67
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
69
|
requirements:
|
69
|
-
- - '>='
|
70
|
+
- - ! '>='
|
70
71
|
- !ruby/object:Gem::Version
|
71
72
|
version: '0'
|
72
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
74
|
requirements:
|
74
|
-
- - '>='
|
75
|
+
- - ! '>='
|
75
76
|
- !ruby/object:Gem::Version
|
76
77
|
version: '0'
|
77
78
|
requirements: []
|
78
79
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
80
|
+
rubygems_version: 2.4.3
|
80
81
|
signing_key:
|
81
82
|
specification_version: 4
|
82
83
|
summary: A Ruby wrapper for Linux's inotify, using FFI
|