rb-fsevent 0.4.1 → 0.4.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.
- data/README.rdoc +3 -7
- data/ext/extconf.rb +7 -3
- data/ext/fsevent/fsevent_watch.c +29 -0
- data/lib/rb-fsevent/fsevent.rb +5 -2
- data/lib/rb-fsevent/version.rb +1 -1
- metadata +70 -45
data/README.rdoc
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Very simple & usable Mac OSX FSEvents API
|
|
4
4
|
|
|
5
5
|
- RubyCocoa not required!
|
|
6
|
-
- Signals are working
|
|
7
|
-
- Tested on MRI 1.8.
|
|
8
|
-
- Tested on JRuby
|
|
6
|
+
- Signals are working (really)
|
|
7
|
+
- Tested on MRI 1.8.7 & 1.9.2
|
|
8
|
+
- Tested on JRuby 1.6.3
|
|
9
9
|
|
|
10
10
|
== Install
|
|
11
11
|
|
|
@@ -247,10 +247,6 @@ The list of tested RVM targets is currently:
|
|
|
247
247
|
|
|
248
248
|
%w[1.8.6 1.8.7 1.9.2 jruby-head]
|
|
249
249
|
|
|
250
|
-
Development note: As of my last attempt to do so, jruby-head's cext support will NOT compile, as-is, using xcode 4.0.1. Simply editing the makefile to point -isysroot to '/' rather than depend on an SDK specific environment and switching the minimum OS to 10.6 was enough to get past this. Making these changes within the context of an RVM installed ruby, however, requires creating a patch and then informing rvm that it needs to apply this patch pre-build.
|
|
251
|
-
|
|
252
|
-
If you have xcode4, and jruby-head has not yet been fixed to allow unmodified compilation, then it's perfectly understandable and acceptable to just remove jruby-head as a testing target. This is especially true considering that it requires an unreleased version of JRuby to begin with.
|
|
253
|
-
|
|
254
250
|
== Authors
|
|
255
251
|
|
|
256
252
|
- {Thibaud Guillaume-Gentil}[http://github.com/thibaudgg]
|
data/ext/extconf.rb
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
require 'mkmf'
|
|
3
3
|
create_makefile('none')
|
|
4
4
|
|
|
5
|
+
# TODO: determine whether we really need to be working around instead of with mkmf
|
|
6
|
+
|
|
5
7
|
if `uname -s`.chomp != 'Darwin'
|
|
6
8
|
puts "Warning! Only Darwin (Mac OS X) systems are supported, nothing will be compiled"
|
|
7
9
|
else
|
|
@@ -37,13 +39,15 @@ else
|
|
|
37
39
|
-dead_strip -framework CoreServices
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
cc_opts = core_flags + ldflags
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
cc_opts += %w{
|
|
43
45
|
-D DEBUG=true
|
|
44
46
|
} if ENV['FWDEBUG'] == "true"
|
|
47
|
+
|
|
48
|
+
cc_bin = `which clang || which gcc`.to_s.strip!
|
|
45
49
|
|
|
46
|
-
compile_command = "CFLAGS='#{cflags.join(' ')} #{wflags.join(' ')}'
|
|
50
|
+
compile_command = "CFLAGS='#{cflags.join(' ')} #{wflags.join(' ')}' #{cc_bin} #{cc_opts.join(' ')} -o '#{gem_root}/bin/fsevent_watch' fsevent/fsevent_watch.c"
|
|
47
51
|
|
|
48
52
|
STDERR.puts(compile_command)
|
|
49
53
|
|
data/ext/fsevent/fsevent_watch.c
CHANGED
|
@@ -167,6 +167,35 @@ static void callback(FSEventStreamRef streamRef,
|
|
|
167
167
|
|
|
168
168
|
int main(int argc, const char *argv[])
|
|
169
169
|
{
|
|
170
|
+
/*
|
|
171
|
+
* a subprocess will initially inherit the process group of its parent. the
|
|
172
|
+
* process group may have a control terminal associated with it, which would
|
|
173
|
+
* be the first tty device opened by the group leader. typically the group
|
|
174
|
+
* leader is your shell and the control terminal is your login device. a
|
|
175
|
+
* subset of signals triggered on the control terminal are sent to all members
|
|
176
|
+
* of the process group, in large part to facilitate sane and consistent
|
|
177
|
+
* cleanup (ex: control terminal was closed).
|
|
178
|
+
*
|
|
179
|
+
* so why the overly descriptive lecture style comment?
|
|
180
|
+
* 1. SIGINT and SIGQUIT are among the signals with this behavior
|
|
181
|
+
* 2. a number of applications gank the above for their own use
|
|
182
|
+
* 3. ruby's insanely useful "guard" is one of these applications
|
|
183
|
+
* 4. despite having some level of understanding of POSIX signals and a few
|
|
184
|
+
* of the scenarios that might cause problems, i learned this one only
|
|
185
|
+
* after reading ruby 1.9's process.c
|
|
186
|
+
* 5. if left completely undocumented, even slightly obscure bugfixes
|
|
187
|
+
* may be removed as cruft by a future maintainer
|
|
188
|
+
*
|
|
189
|
+
* hindsight is 20/20 addition: if you're single-threaded and blocking on IO
|
|
190
|
+
* with a subprocess, then handlers for deferrable signals might not get run
|
|
191
|
+
* when you expect them to. In the case of Ruby 1.8, that means making use of
|
|
192
|
+
* IO::select, which will preserve correct signal handling behavior.
|
|
193
|
+
*/
|
|
194
|
+
if (setpgid(0,0) < 0) {
|
|
195
|
+
fprintf(stderr, "Unable to set new process group.\n");
|
|
196
|
+
return 1;
|
|
197
|
+
}
|
|
198
|
+
|
|
170
199
|
parse_cli_settings(argc, argv);
|
|
171
200
|
|
|
172
201
|
FSEventStreamContext context = {0, NULL, NULL, NULL, NULL};
|
data/lib/rb-fsevent/fsevent.rb
CHANGED
|
@@ -28,7 +28,10 @@ class FSEvent
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def run
|
|
31
|
-
|
|
31
|
+
@running = true
|
|
32
|
+
# please note the use of IO::select() here, as it is used specifically to
|
|
33
|
+
# preserve correct signal handling behavior in ruby 1.8.
|
|
34
|
+
while @running && IO::select([pipe], nil, nil, nil)
|
|
32
35
|
if line = pipe.readline
|
|
33
36
|
modified_dir_paths = line.split(":").select { |dir| dir != "\n" }
|
|
34
37
|
callback.call(modified_dir_paths)
|
|
@@ -46,7 +49,7 @@ class FSEvent
|
|
|
46
49
|
end
|
|
47
50
|
rescue IOError
|
|
48
51
|
ensure
|
|
49
|
-
@pipe =
|
|
52
|
+
@pipe = @running = nil
|
|
50
53
|
end
|
|
51
54
|
|
|
52
55
|
if RUBY_VERSION < '1.9'
|
data/lib/rb-fsevent/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,60 +1,82 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rb-fsevent
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 9
|
|
5
5
|
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 4
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.4.3
|
|
6
11
|
platform: ruby
|
|
7
|
-
authors:
|
|
12
|
+
authors:
|
|
8
13
|
- Thibaud Guillaume-Gentil
|
|
9
14
|
- Travis Tilley
|
|
10
15
|
autorequire:
|
|
11
16
|
bindir: bin
|
|
12
17
|
cert_chain: []
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
dependencies:
|
|
16
|
-
- !ruby/object:Gem::Dependency
|
|
18
|
+
|
|
19
|
+
date: 2011-08-12 00:00:00 Z
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
17
22
|
name: bundler
|
|
18
|
-
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
19
25
|
none: false
|
|
20
|
-
requirements:
|
|
26
|
+
requirements:
|
|
21
27
|
- - ~>
|
|
22
|
-
- !ruby/object:Gem::Version
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 3
|
|
30
|
+
segments:
|
|
31
|
+
- 1
|
|
32
|
+
- 0
|
|
33
|
+
- 10
|
|
23
34
|
version: 1.0.10
|
|
24
35
|
type: :development
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
36
|
+
version_requirements: *id001
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
28
38
|
name: rspec
|
|
29
|
-
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
30
41
|
none: false
|
|
31
|
-
requirements:
|
|
42
|
+
requirements:
|
|
32
43
|
- - ~>
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 27
|
|
46
|
+
segments:
|
|
47
|
+
- 2
|
|
48
|
+
- 5
|
|
49
|
+
- 0
|
|
34
50
|
version: 2.5.0
|
|
35
51
|
type: :development
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- !ruby/object:Gem::Dependency
|
|
52
|
+
version_requirements: *id002
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
39
54
|
name: guard-rspec
|
|
40
|
-
|
|
55
|
+
prerelease: false
|
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
41
57
|
none: false
|
|
42
|
-
requirements:
|
|
58
|
+
requirements:
|
|
43
59
|
- - ~>
|
|
44
|
-
- !ruby/object:Gem::Version
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
hash: 9
|
|
62
|
+
segments:
|
|
63
|
+
- 0
|
|
64
|
+
- 1
|
|
65
|
+
- 9
|
|
45
66
|
version: 0.1.9
|
|
46
67
|
type: :development
|
|
47
|
-
|
|
48
|
-
version_requirements: *2152427640
|
|
68
|
+
version_requirements: *id003
|
|
49
69
|
description: FSEvents API with Signals catching (without RubyCocoa)
|
|
50
|
-
email:
|
|
70
|
+
email:
|
|
51
71
|
- thibaud@thibaud.me
|
|
52
72
|
- ttilley@gmail.com
|
|
53
73
|
executables: []
|
|
54
|
-
|
|
74
|
+
|
|
75
|
+
extensions:
|
|
55
76
|
- ext/extconf.rb
|
|
56
77
|
extra_rdoc_files: []
|
|
57
|
-
|
|
78
|
+
|
|
79
|
+
files:
|
|
58
80
|
- lib/rb-fsevent/fsevent.rb
|
|
59
81
|
- lib/rb-fsevent/version.rb
|
|
60
82
|
- lib/rb-fsevent.rb
|
|
@@ -62,35 +84,38 @@ files:
|
|
|
62
84
|
- ext/fsevent/fsevent_watch.c
|
|
63
85
|
- LICENSE
|
|
64
86
|
- README.rdoc
|
|
65
|
-
has_rdoc: true
|
|
66
87
|
homepage: http://rubygems.org/gems/rb-fsevent
|
|
67
88
|
licenses: []
|
|
89
|
+
|
|
68
90
|
post_install_message:
|
|
69
91
|
rdoc_options: []
|
|
70
|
-
|
|
92
|
+
|
|
93
|
+
require_paths:
|
|
71
94
|
- lib
|
|
72
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
96
|
none: false
|
|
74
|
-
requirements:
|
|
75
|
-
- -
|
|
76
|
-
- !ruby/object:Gem::Version
|
|
77
|
-
|
|
78
|
-
segments:
|
|
97
|
+
requirements:
|
|
98
|
+
- - ">="
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
hash: 3
|
|
101
|
+
segments:
|
|
79
102
|
- 0
|
|
80
|
-
|
|
81
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
|
+
version: "0"
|
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
105
|
none: false
|
|
83
|
-
requirements:
|
|
84
|
-
- -
|
|
85
|
-
- !ruby/object:Gem::Version
|
|
86
|
-
|
|
87
|
-
segments:
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
hash: 3
|
|
110
|
+
segments:
|
|
88
111
|
- 0
|
|
89
|
-
|
|
112
|
+
version: "0"
|
|
90
113
|
requirements: []
|
|
114
|
+
|
|
91
115
|
rubyforge_project: rb-fsevent
|
|
92
|
-
rubygems_version: 1.6
|
|
116
|
+
rubygems_version: 1.8.6
|
|
93
117
|
signing_key:
|
|
94
118
|
specification_version: 3
|
|
95
119
|
summary: Very simple & usable FSEvents API
|
|
96
120
|
test_files: []
|
|
121
|
+
|