rb-fsevent 0.3.4 → 0.3.5

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.
@@ -4,7 +4,7 @@ Very simple & usable Mac OSX FSEvents API
4
4
 
5
5
  - RubyCocoa not required!
6
6
  - Signals are working
7
- - Tested on Ruby 1.8.7 & 1.9.2
7
+ - Tested on Ruby 1.8.6, 1.8.7 & 1.9.2
8
8
 
9
9
  == Install
10
10
 
@@ -25,7 +25,7 @@ private
25
25
  end
26
26
 
27
27
  def launch_bin
28
- @pipe = IO.popen("#{bin_path}/fsevent_watch #{path.shellescape}")
28
+ @pipe = IO.popen("#{bin_path}/fsevent_watch #{shellescape(path)}")
29
29
  end
30
30
 
31
31
  def listen
@@ -39,4 +39,22 @@ private
39
39
  stop
40
40
  end
41
41
 
42
+ # for Ruby 1.8.6 support
43
+ def shellescape(str)
44
+ # An empty argument will be skipped, so return empty quotes.
45
+ return "''" if str.empty?
46
+
47
+ str = str.dup
48
+
49
+ # Process as a single byte sequence because not all shell
50
+ # implementations are multibyte aware.
51
+ str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/n, "\\\\\\1")
52
+
53
+ # A LF cannot be escaped with a backslash because a backslash + LF
54
+ # combo is regarded as line continuation and simply ignored.
55
+ str.gsub!(/\n/, "'\n'")
56
+
57
+ return str
58
+ end
59
+
42
60
  end
@@ -1,3 +1,3 @@
1
1
  class FSEvent
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-fsevent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 5
10
+ version: 0.3.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thibaud Guillaume-Gentil
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-25 00:00:00 +02:00
18
+ date: 2010-10-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency