rb-fsevent 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -167,6 +167,30 @@ 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
+ if (setpgid(0,0) < 0) {
190
+ fprintf(stderr, "Unable to set new process group.\n");
191
+ return 1;
192
+ }
193
+
170
194
  parse_cli_settings(argc, argv);
171
195
 
172
196
  FSEventStreamContext context = {0, NULL, NULL, NULL, NULL};
@@ -28,7 +28,8 @@ class FSEvent
28
28
  end
29
29
 
30
30
  def run
31
- while !pipe.eof?
31
+ @running = true
32
+ while @running && !pipe.eof?
32
33
  if line = pipe.readline
33
34
  modified_dir_paths = line.split(":").select { |dir| dir != "\n" }
34
35
  callback.call(modified_dir_paths)
@@ -46,7 +47,7 @@ class FSEvent
46
47
  end
47
48
  rescue IOError
48
49
  ensure
49
- @pipe = false
50
+ @pipe = @running = nil
50
51
  end
51
52
 
52
53
  if RUBY_VERSION < '1.9'
@@ -1,3 +1,3 @@
1
1
  class FSEvent
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-fsevent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-07-06 00:00:00.000000000 +02:00
13
+ date: 2011-07-31 00:00:00.000000000 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
18
- requirement: &2152430220 !ruby/object:Gem::Requirement
18
+ requirement: &2152592720 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.0.10
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *2152430220
26
+ version_requirements: *2152592720
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
- requirement: &2152429140 !ruby/object:Gem::Requirement
29
+ requirement: &2152585800 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 2.5.0
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *2152429140
37
+ version_requirements: *2152585800
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: guard-rspec
40
- requirement: &2152427640 !ruby/object:Gem::Requirement
40
+ requirement: &2152585300 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ~>
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: 0.1.9
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *2152427640
48
+ version_requirements: *2152585300
49
49
  description: FSEvents API with Signals catching (without RubyCocoa)
50
50
  email:
51
51
  - thibaud@thibaud.me
@@ -75,18 +75,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
- segments:
79
- - 0
80
- hash: -3134696196885608875
81
78
  required_rubygems_version: !ruby/object:Gem::Requirement
82
79
  none: false
83
80
  requirements:
84
81
  - - ! '>='
85
82
  - !ruby/object:Gem::Version
86
83
  version: '0'
87
- segments:
88
- - 0
89
- hash: -3134696196885608875
90
84
  requirements: []
91
85
  rubyforge_project: rb-fsevent
92
86
  rubygems_version: 1.6.2