rb-inotify 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +53 -0
- data/Gemfile +11 -7
- data/README.md +1 -3
- data/lib/rb-inotify/notifier.rb +2 -1
- data/lib/rb-inotify/version.rb +1 -1
- data/rb-inotify.gemspec +1 -6
- data/spec/notifier_spec.rb +18 -8
- metadata +9 -66
- data/.travis.yml +0 -19
- data/Rakefile +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb4c62648ba29b5ec98d68e15997cf32f6e6f92e27d4821f49de4173a78efc0a
|
4
|
+
data.tar.gz: 5f2b3f9c2d48383f56cfcfbc64e20c868958267cbddf503c3abdfc9ffd79e273
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0682826d3fb06dc0d6fae0fcbd815cafd0d765692c0765b70ec7747514e8769b25a940d1bcce9c154fcd9b64336622c0cfb49485ab3ef1e4041d2872b2949e95'
|
7
|
+
data.tar.gz: 9d9d61b740e92704547a130297ca436e219fea53509a212475fff77df20d214a6e630eccd0d166badb19003745b7f08e7fd3187710f80bebfeba0278bb8137d4
|
@@ -0,0 +1,53 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
|
8
|
+
env:
|
9
|
+
CONSOLE_OUTPUT: XTerm
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: ${{matrix.ruby}} on ${{matrix.os}}
|
14
|
+
runs-on: ${{matrix.os}}-latest
|
15
|
+
continue-on-error: ${{matrix.experimental}}
|
16
|
+
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
os:
|
20
|
+
- ubuntu
|
21
|
+
|
22
|
+
ruby:
|
23
|
+
- "2.5"
|
24
|
+
- "2.6"
|
25
|
+
- "2.7"
|
26
|
+
- "3.0"
|
27
|
+
- "3.1"
|
28
|
+
- "3.2"
|
29
|
+
- "3.3"
|
30
|
+
|
31
|
+
experimental: [false]
|
32
|
+
|
33
|
+
include:
|
34
|
+
- os: ubuntu
|
35
|
+
ruby: truffleruby
|
36
|
+
experimental: true
|
37
|
+
- os: ubuntu
|
38
|
+
ruby: jruby
|
39
|
+
experimental: true
|
40
|
+
- os: ubuntu
|
41
|
+
ruby: head
|
42
|
+
experimental: true
|
43
|
+
|
44
|
+
steps:
|
45
|
+
- uses: actions/checkout@v4
|
46
|
+
- uses: ruby/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: ${{matrix.ruby}}
|
49
|
+
bundler-cache: true
|
50
|
+
|
51
|
+
- name: Run tests
|
52
|
+
timeout-minutes: 10
|
53
|
+
run: bundle exec rspec
|
data/Gemfile
CHANGED
@@ -3,14 +3,18 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in utopia.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
group :
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
gem 'tty-prompt'
|
6
|
+
group :maintenance, optional: true do
|
7
|
+
gem "bake-gem"
|
8
|
+
gem "bake-modernize"
|
11
9
|
end
|
12
10
|
|
13
11
|
group :test do
|
14
|
-
|
15
|
-
|
12
|
+
gem "rspec", "~> 3.6"
|
13
|
+
|
14
|
+
gem 'simplecov'
|
15
|
+
gem 'coveralls', require: false
|
16
|
+
|
17
|
+
gem "bundler"
|
18
|
+
gem "rake"
|
19
|
+
gem "concurrent-ruby"
|
16
20
|
end
|
data/README.md
CHANGED
@@ -6,9 +6,7 @@ It uses the [FFI](http://wiki.github.com/ffi/ffi) gem to avoid having to compile
|
|
6
6
|
|
7
7
|
[API documentation is available on rdoc.info](http://rdoc.info/projects/nex3/rb-inotify).
|
8
8
|
|
9
|
-
[![
|
10
|
-
[![Code Climate](https://codeclimate.com/github/guard/rb-inotify.svg)](https://codeclimate.com/github/guard/rb-inotify)
|
11
|
-
[![Coverage Status](https://coveralls.io/repos/guard/rb-inotify/badge.svg)](https://coveralls.io/r/guard/rb-inotify)
|
9
|
+
[![Development Status](https://github.com/guard/rb-inotify/workflows/Test/badge.svg)](https://github.com/guard/rb-inotify/actions?workflow=Test)
|
12
10
|
|
13
11
|
## Usage
|
14
12
|
|
data/lib/rb-inotify/notifier.rb
CHANGED
@@ -50,6 +50,7 @@ module INotify
|
|
50
50
|
# @raise [SystemCallError] if inotify failed to initialize for some reason
|
51
51
|
def initialize
|
52
52
|
@running = Mutex.new
|
53
|
+
@stop = false
|
53
54
|
@pipe = IO.pipe
|
54
55
|
# JRuby shutdown sometimes runs IO finalizers before all threads finish.
|
55
56
|
if RUBY_ENGINE == 'jruby'
|
@@ -231,12 +232,12 @@ module INotify
|
|
231
232
|
def run
|
232
233
|
@running.synchronize do
|
233
234
|
Thread.current[:INOTIFY_RUN_THREAD] = true
|
234
|
-
@stop = false
|
235
235
|
|
236
236
|
process until @stop
|
237
237
|
end
|
238
238
|
ensure
|
239
239
|
Thread.current[:INOTIFY_RUN_THREAD] = false
|
240
|
+
@stop = false
|
240
241
|
end
|
241
242
|
|
242
243
|
# Stop watching for filesystem events.
|
data/lib/rb-inotify/version.rb
CHANGED
data/rb-inotify.gemspec
CHANGED
@@ -17,12 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.required_ruby_version = '>= 2.
|
20
|
+
spec.required_ruby_version = '>= 2.5'
|
21
21
|
|
22
22
|
spec.add_dependency "ffi", "~> 1.0"
|
23
|
-
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.6"
|
25
|
-
spec.add_development_dependency "bundler"
|
26
|
-
spec.add_development_dependency "rake"
|
27
|
-
spec.add_development_dependency "concurrent-ruby"
|
28
23
|
end
|
data/spec/notifier_spec.rb
CHANGED
@@ -94,22 +94,32 @@ describe INotify::Notifier do
|
|
94
94
|
@notifier.stop
|
95
95
|
|
96
96
|
dir.join("three.txt").write("hello world")
|
97
|
-
|
98
|
-
|
99
|
-
dir.join("four.txt").write("hello world")
|
100
|
-
run_thread.join
|
97
|
+
run_thread.join(1) or raise "timeout"
|
101
98
|
|
102
99
|
expect(events.map(&:name)).to match_array(%w(one.txt two.txt))
|
103
100
|
end
|
104
101
|
|
105
102
|
it "can be stopped from within a callback" do
|
106
|
-
|
107
|
-
barrier_queue = barriers.dup
|
108
|
-
events = recording(dir, :create) { @notifier.stop }
|
103
|
+
recording(dir, :create) { @notifier.stop }
|
109
104
|
|
110
105
|
run_thread = Thread.new { @notifier.run }
|
106
|
+
|
111
107
|
dir.join("one.txt").write("hello world")
|
112
|
-
run_thread.join
|
108
|
+
run_thread.join(1) or raise "timeout"
|
109
|
+
end
|
110
|
+
|
111
|
+
it "can be stopped before it starts processing" do
|
112
|
+
barrier = Concurrent::Event.new
|
113
|
+
|
114
|
+
run_thread = Thread.new do
|
115
|
+
barrier.wait
|
116
|
+
@notifier.run
|
117
|
+
end
|
118
|
+
|
119
|
+
@notifier.stop
|
120
|
+
barrier.set
|
121
|
+
|
122
|
+
run_thread.join(1) or raise "timeout"
|
113
123
|
end
|
114
124
|
end
|
115
125
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb-inotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natalie Weizenbaum
|
8
8
|
- Samuel Williams
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-05-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -25,63 +25,7 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.0'
|
28
|
-
|
29
|
-
name: rspec
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '3.6'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '3.6'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: bundler
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rake
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: concurrent-ruby
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
description:
|
28
|
+
description:
|
85
29
|
email:
|
86
30
|
- nex342@gmail.com
|
87
31
|
- samuel.williams@oriontransfer.co.nz
|
@@ -89,13 +33,12 @@ executables: []
|
|
89
33
|
extensions: []
|
90
34
|
extra_rdoc_files: []
|
91
35
|
files:
|
36
|
+
- ".github/workflows/test.yaml"
|
92
37
|
- ".gitignore"
|
93
|
-
- ".travis.yml"
|
94
38
|
- ".yardopts"
|
95
39
|
- Gemfile
|
96
40
|
- LICENSE.md
|
97
41
|
- README.md
|
98
|
-
- Rakefile
|
99
42
|
- lib/rb-inotify.rb
|
100
43
|
- lib/rb-inotify/errors.rb
|
101
44
|
- lib/rb-inotify/event.rb
|
@@ -112,7 +55,7 @@ homepage: https://github.com/guard/rb-inotify
|
|
112
55
|
licenses:
|
113
56
|
- MIT
|
114
57
|
metadata: {}
|
115
|
-
post_install_message:
|
58
|
+
post_install_message:
|
116
59
|
rdoc_options: []
|
117
60
|
require_paths:
|
118
61
|
- lib
|
@@ -120,15 +63,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
63
|
requirements:
|
121
64
|
- - ">="
|
122
65
|
- !ruby/object:Gem::Version
|
123
|
-
version: '2.
|
66
|
+
version: '2.5'
|
124
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
68
|
requirements:
|
126
69
|
- - ">="
|
127
70
|
- !ruby/object:Gem::Version
|
128
71
|
version: '0'
|
129
72
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
131
|
-
signing_key:
|
73
|
+
rubygems_version: 3.5.3
|
74
|
+
signing_key:
|
132
75
|
specification_version: 4
|
133
76
|
summary: A Ruby wrapper for Linux inotify, using FFI
|
134
77
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
|
4
|
-
matrix:
|
5
|
-
include:
|
6
|
-
- rvm: 2.3
|
7
|
-
- rvm: 2.4
|
8
|
-
- rvm: 2.5
|
9
|
-
- rvm: 2.6
|
10
|
-
- rvm: jruby
|
11
|
-
- rvm: truffleruby
|
12
|
-
- rvm: jruby-head
|
13
|
-
- rvm: ruby-head
|
14
|
-
allow_failures:
|
15
|
-
- rvm: truffleruby
|
16
|
-
- rvm: jruby
|
17
|
-
- rvm: ruby-head
|
18
|
-
- rvm: jruby-head
|
19
|
-
fast_finish: true
|