rb-fsevent 0.9.2 → 0.11.1
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.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/Gemfile +3 -0
- data/Guardfile +8 -0
- data/{LICENSE → LICENSE.txt} +3 -1
- data/README.md +260 -0
- data/Rakefile +33 -0
- data/bin/fsevent_watch +0 -0
- data/ext/{fsevent_watch/LICENSE → LICENSE} +1 -1
- data/ext/fsevent_watch/FSEventsFix.c +626 -0
- data/ext/fsevent_watch/FSEventsFix.h +105 -0
- data/ext/fsevent_watch/{fsevent_watch/TSICTString.c → TSICTString.c} +34 -55
- data/ext/fsevent_watch/{fsevent_watch/TSICTString.h → TSICTString.h} +0 -0
- data/ext/fsevent_watch/{fsevent_watch/cli.c → cli.c} +48 -7
- data/ext/fsevent_watch/{fsevent_watch/cli.h → cli.h} +3 -3
- data/ext/fsevent_watch/{fsevent_watch/common.h → common.h} +1 -13
- data/ext/fsevent_watch/compat.c +41 -0
- data/ext/fsevent_watch/compat.h +100 -0
- data/ext/fsevent_watch/defines.h +42 -0
- data/ext/fsevent_watch/{fsevent_watch/main.c → main.c} +101 -62
- data/ext/fsevent_watch/signal_handlers.c +66 -0
- data/ext/fsevent_watch/signal_handlers.h +16 -0
- data/ext/rakefile.rb +225 -41
- data/lib/otnetstring.rb +85 -0
- data/lib/rb-fsevent/fsevent.rb +53 -7
- data/lib/rb-fsevent/version.rb +3 -1
- data/lib/rb-fsevent.rb +2 -1
- data/rb-fsevent.gemspec +26 -0
- metadata +53 -56
- data/README.rdoc +0 -255
- data/ext/fsevent_watch/Info.plist +0 -38
- data/ext/fsevent_watch/fsevent_watch/compat.c +0 -20
- data/ext/fsevent_watch/fsevent_watch/compat.h +0 -40
- data/ext/fsevent_watch/fsevent_watch.xcodeproj/project.pbxproj +0 -254
- data/ext/fsevent_watch/xcconfig/Common.xcconfig +0 -82
- data/ext/fsevent_watch/xcconfig/Debug.xcconfig +0 -19
- data/ext/fsevent_watch/xcconfig/Release.xcconfig +0 -23
- data/ext/fsevent_watch/xcconfig/fsevent_watch.xcconfig +0 -17
- data/ext/rb-fsevent.xcconfig +0 -33
data/ext/rakefile.rb
CHANGED
@@ -1,47 +1,231 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'rubygems' unless defined?(Gem)
|
3
|
+
require 'pathname'
|
4
|
+
require 'date'
|
5
|
+
require 'time'
|
6
|
+
require 'rake/clean'
|
7
|
+
|
8
|
+
raise "unable to find xcodebuild" unless system('which', 'xcodebuild')
|
9
|
+
|
10
|
+
|
11
|
+
FSEVENT_WATCH_EXE_VERSION = '0.1.5'
|
12
|
+
|
13
|
+
$this_dir = Pathname.new(__FILE__).dirname.expand_path
|
14
|
+
$final_exe = $this_dir.parent.join('bin/fsevent_watch')
|
15
|
+
|
16
|
+
$src_dir = $this_dir.join('fsevent_watch')
|
17
|
+
$obj_dir = $this_dir.join('build')
|
18
|
+
|
19
|
+
SRC = Pathname.glob("#{$src_dir}/*.c")
|
20
|
+
OBJ = SRC.map {|s| $obj_dir.join("#{s.basename('.c')}.o")}
|
21
|
+
|
22
|
+
$now = DateTime.now.xmlschema rescue Time.now.xmlschema
|
23
|
+
|
24
|
+
$CC = ENV['CC'] || `which clang || which gcc`.strip
|
25
|
+
$CFLAGS = ENV['CFLAGS'] || '-fconstant-cfstrings -fasm-blocks -fstrict-aliasing -Wall'
|
26
|
+
$ARCHFLAGS = ENV['ARCHFLAGS'] || '-arch x86_64'
|
27
|
+
$DEFINES = "-DNS_BUILD_32_LIKE_64 -DNS_BLOCK_ASSERTIONS -DPROJECT_VERSION=#{FSEVENT_WATCH_EXE_VERSION}"
|
28
|
+
|
29
|
+
$GCC_C_LANGUAGE_STANDARD = ENV['GCC_C_LANGUAGE_STANDARD'] || 'gnu11'
|
30
|
+
|
31
|
+
# generic developer id name so it'll match correctly for anyone who has only
|
32
|
+
# one developer id in their keychain (not that I expect anyone else to bother)
|
33
|
+
$CODE_SIGN_IDENTITY = 'Developer ID Application'
|
34
|
+
|
35
|
+
$arch = `uname -m`.strip
|
36
|
+
$os_release = `uname -r`.strip
|
37
|
+
$BUILD_TRIPLE = "#{$arch}-apple-darwin#{$os_release}"
|
38
|
+
|
39
|
+
$CCVersion = `#{$CC} --version | head -n 1`.strip
|
40
|
+
|
41
|
+
|
42
|
+
CLEAN.include OBJ.map(&:to_s)
|
43
|
+
CLEAN.include $obj_dir.join('Info.plist').to_s
|
44
|
+
CLEAN.include $obj_dir.join('fsevent_watch').to_s
|
45
|
+
CLOBBER.include $final_exe.to_s
|
46
|
+
|
47
|
+
|
48
|
+
task :sw_vers do
|
49
|
+
$mac_product_version = `sw_vers -productVersion`.strip
|
50
|
+
$mac_build_version = `sw_vers -buildVersion`.strip
|
51
|
+
$MACOSX_DEPLOYMENT_TARGET = ENV['MACOSX_DEPLOYMENT_TARGET'] || $mac_product_version.sub(/\.\d*$/, '')
|
52
|
+
$CFLAGS = "#{$CFLAGS} -mmacosx-version-min=#{$MACOSX_DEPLOYMENT_TARGET}"
|
53
|
+
end
|
54
|
+
|
55
|
+
task :get_sdk_info => :sw_vers do
|
56
|
+
$SDK_INFO = {}
|
57
|
+
version_info = `xcodebuild -version -sdk macosx#{$MACOSX_DEPLOYMENT_TARGET}`
|
58
|
+
raise "invalid SDK" unless !!$?.exitstatus
|
59
|
+
version_info.strip.each_line do |line|
|
60
|
+
next if line.strip.empty?
|
61
|
+
next unless line.include?(':')
|
62
|
+
match = line.match(/([^:]*): (.*)/)
|
63
|
+
next unless match
|
64
|
+
$SDK_INFO[match[1]] = match[2]
|
30
65
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
66
|
+
end
|
67
|
+
|
68
|
+
task :debug => :sw_vers do
|
69
|
+
$DEFINES = "-DDEBUG #{$DEFINES}"
|
70
|
+
$CFLAGS = "#{$CFLAGS} -O0 -fno-omit-frame-pointer -g"
|
71
|
+
end
|
72
|
+
|
73
|
+
task :release => :sw_vers do
|
74
|
+
$DEFINES = "-DNDEBUG #{$DEFINES}"
|
75
|
+
$CFLAGS = "#{$CFLAGS} -Ofast"
|
76
|
+
end
|
77
|
+
|
78
|
+
desc 'configure build type depending on whether ENV var FWDEBUG is set'
|
79
|
+
task :set_build_type => :sw_vers do
|
80
|
+
if ENV['FWDEBUG']
|
81
|
+
Rake::Task[:debug].invoke
|
82
|
+
else
|
83
|
+
Rake::Task[:release].invoke
|
35
84
|
end
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
85
|
+
end
|
86
|
+
|
87
|
+
desc 'set build arch to ppc'
|
88
|
+
task :ppc do
|
89
|
+
$ARCHFLAGS = '-arch ppc'
|
90
|
+
end
|
91
|
+
|
92
|
+
desc 'set build arch to x86_64'
|
93
|
+
task :x86_64 do
|
94
|
+
$ARCHFLAGS = '-arch x86_64'
|
95
|
+
end
|
96
|
+
|
97
|
+
desc 'set build arch to i386'
|
98
|
+
task :x86 do
|
99
|
+
$ARCHFLAGS = '-arch i386'
|
100
|
+
end
|
101
|
+
|
102
|
+
desc 'set build arch to arm64'
|
103
|
+
task :arm64 do
|
104
|
+
$ARCHFLAGS = '-arch arm64'
|
105
|
+
end
|
106
|
+
|
107
|
+
task :setup_env => [:set_build_type, :sw_vers, :get_sdk_info]
|
108
|
+
|
109
|
+
directory $obj_dir.to_s
|
110
|
+
file $obj_dir.to_s => :setup_env
|
111
|
+
|
112
|
+
SRC.zip(OBJ).each do |source, object|
|
113
|
+
file object.to_s => [source.to_s, $obj_dir.to_s] do
|
114
|
+
cmd = [
|
115
|
+
$CC,
|
116
|
+
$ARCHFLAGS,
|
117
|
+
"-std=#{$GCC_C_LANGUAGE_STANDARD}",
|
118
|
+
$CFLAGS,
|
119
|
+
$DEFINES,
|
120
|
+
"-I#{$src_dir}",
|
121
|
+
'-isysroot',
|
122
|
+
$SDK_INFO['Path'],
|
123
|
+
'-c', source,
|
124
|
+
'-o', object
|
125
|
+
]
|
126
|
+
sh(cmd.map {|s| s.to_s}.join(' '))
|
40
127
|
end
|
41
|
-
|
42
|
-
|
43
|
-
|
128
|
+
end
|
129
|
+
|
130
|
+
file $obj_dir.join('Info.plist').to_s => [$obj_dir.to_s, :setup_env] do
|
131
|
+
File.open($obj_dir.join('Info.plist').to_s, 'w+') do |file|
|
132
|
+
indentation = ''
|
133
|
+
indent = lambda {|num| indentation = ' ' * num }
|
134
|
+
add = lambda {|str| file << "#{indentation}#{str}\n" }
|
135
|
+
key = lambda {|str| add["<key>#{str}</key>"] }
|
136
|
+
string = lambda {|str| add["<string>#{str}</string>"] }
|
137
|
+
|
138
|
+
|
139
|
+
add['<?xml version="1.0" encoding="UTF-8"?>']
|
140
|
+
add['<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">']
|
141
|
+
add['<plist version="1.0">']
|
142
|
+
|
143
|
+
indent[2]
|
144
|
+
add['<dict>']
|
145
|
+
indent[4]
|
146
|
+
|
147
|
+
key['CFBundleExecutable']
|
148
|
+
string['fsevent_watch']
|
149
|
+
key['CFBundleIdentifier']
|
150
|
+
string['com.teaspoonofinsanity.fsevent_watch']
|
151
|
+
key['CFBundleName']
|
152
|
+
string['fsevent_watch']
|
153
|
+
key['CFBundleDisplayName']
|
154
|
+
string['FSEvent Watch CLI']
|
155
|
+
key['NSHumanReadableCopyright']
|
156
|
+
string['Copyright (C) 2011-2017 Travis Tilley']
|
157
|
+
|
158
|
+
key['CFBundleVersion']
|
159
|
+
string["#{FSEVENT_WATCH_EXE_VERSION}"]
|
160
|
+
key['LSMinimumSystemVersion']
|
161
|
+
string["#{$MACOSX_DEPLOYMENT_TARGET}"]
|
162
|
+
key['DTSDKBuild']
|
163
|
+
string["#{$SDK_INFO['ProductBuildVersion']}"]
|
164
|
+
key['DTSDKName']
|
165
|
+
string["macosx#{$SDK_INFO['SDKVersion']}"]
|
166
|
+
key['DTSDKPath']
|
167
|
+
string["#{$SDK_INFO['Path']}"]
|
168
|
+
key['BuildMachineOSBuild']
|
169
|
+
string["#{$mac_build_version}"]
|
170
|
+
key['BuildMachineOSVersion']
|
171
|
+
string["#{$mac_product_version}"]
|
172
|
+
key['FSEWCompiledAt']
|
173
|
+
string["#{$now}"]
|
174
|
+
key['FSEWVersionInfoBuilder']
|
175
|
+
string["#{`whoami`.strip}"]
|
176
|
+
key['FSEWBuildTriple']
|
177
|
+
string["#{$BUILD_TRIPLE}"]
|
178
|
+
key['FSEWCC']
|
179
|
+
string["#{$CC}"]
|
180
|
+
key['FSEWCCVersion']
|
181
|
+
string["#{$CCVersion}"]
|
182
|
+
key['FSEWCFLAGS']
|
183
|
+
string["#{$CFLAGS}"]
|
184
|
+
|
185
|
+
indent[2]
|
186
|
+
add['</dict>']
|
187
|
+
indent[0]
|
188
|
+
|
189
|
+
add['</plist>']
|
44
190
|
end
|
45
191
|
end
|
46
192
|
|
47
|
-
|
193
|
+
desc 'generate an Info.plist used for code signing as well as embedding build settings into the resulting binary'
|
194
|
+
task :plist => $obj_dir.join('Info.plist').to_s
|
195
|
+
|
196
|
+
|
197
|
+
file $obj_dir.join('fsevent_watch').to_s => [$obj_dir.to_s, $obj_dir.join('Info.plist').to_s] + OBJ.map(&:to_s) do
|
198
|
+
cmd = [
|
199
|
+
$CC,
|
200
|
+
$ARCHFLAGS,
|
201
|
+
"-std=#{$GCC_C_LANGUAGE_STANDARD}",
|
202
|
+
$CFLAGS,
|
203
|
+
$DEFINES,
|
204
|
+
"-I#{$src_dir}",
|
205
|
+
'-isysroot',
|
206
|
+
$SDK_INFO['Path'],
|
207
|
+
'-framework CoreFoundation -framework CoreServices',
|
208
|
+
'-sectcreate __TEXT __info_plist',
|
209
|
+
$obj_dir.join('Info.plist')
|
210
|
+
] + OBJ + [
|
211
|
+
'-o', $obj_dir.join('fsevent_watch')
|
212
|
+
]
|
213
|
+
sh(cmd.map {|s| s.to_s}.join(' '))
|
214
|
+
end
|
215
|
+
|
216
|
+
desc 'compile and link build/fsevent_watch'
|
217
|
+
task :build => $obj_dir.join('fsevent_watch').to_s
|
218
|
+
|
219
|
+
desc 'codesign build/fsevent_watch binary'
|
220
|
+
task :codesign => :build do
|
221
|
+
sh "codesign -s '#{$CODE_SIGN_IDENTITY}' #{$obj_dir.join('fsevent_watch')}"
|
222
|
+
end
|
223
|
+
|
224
|
+
directory $this_dir.parent.join('bin')
|
225
|
+
|
226
|
+
desc 'replace bundled fsevent_watch binary with build/fsevent_watch'
|
227
|
+
task :replace_exe => [$this_dir.parent.join('bin'), :build] do
|
228
|
+
sh "mv #{$obj_dir.join('fsevent_watch')} #{$final_exe}"
|
229
|
+
end
|
230
|
+
|
231
|
+
task :default => [:replace_exe, :clean]
|
data/lib/otnetstring.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# Copyright (c) 2011 Konstantin Haase
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
20
|
+
|
21
|
+
|
22
|
+
require 'stringio'
|
23
|
+
|
24
|
+
module OTNetstring
|
25
|
+
class Error < StandardError; end
|
26
|
+
|
27
|
+
class << self
|
28
|
+
def parse(io, encoding = 'internal', fallback_encoding = nil)
|
29
|
+
fallback_encoding = io.encoding if io.respond_to? :encoding
|
30
|
+
io = StringIO.new(io) if io.respond_to? :to_str
|
31
|
+
length, byte = "", nil
|
32
|
+
|
33
|
+
while byte.nil? || byte =~ /\d/
|
34
|
+
length << byte if byte
|
35
|
+
byte = io.read(1)
|
36
|
+
end
|
37
|
+
|
38
|
+
if length.size > 9
|
39
|
+
raise Error, "#{length} is longer than 9 digits"
|
40
|
+
elsif length !~ /\d+/
|
41
|
+
raise Error, "Expected '#{byte}' to be a digit"
|
42
|
+
end
|
43
|
+
length = Integer(length)
|
44
|
+
|
45
|
+
case byte
|
46
|
+
when '#' then Integer io.read(length)
|
47
|
+
when ',' then with_encoding io.read(length), encoding, fallback_encoding
|
48
|
+
when '~' then
|
49
|
+
raise Error, "nil has length of 0, #{length} given" unless length == 0
|
50
|
+
when '!' then io.read(length) == 'true'
|
51
|
+
when '[', '{'
|
52
|
+
array = []
|
53
|
+
start = io.pos
|
54
|
+
array << parse(io, encoding, fallback_encoding) while io.pos - start < length
|
55
|
+
raise Error, 'Nested element longer than container' if io.pos - start != length
|
56
|
+
byte == "{" ? Hash[*array] : array
|
57
|
+
else
|
58
|
+
raise Error, "Unknown type '#{byte}'"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def encode(obj, string_sep = ',')
|
63
|
+
case obj
|
64
|
+
when String then with_encoding "#{obj.bytesize}#{string_sep}#{obj}", "binary"
|
65
|
+
when Integer then encode(obj.inspect, '#')
|
66
|
+
when NilClass then "0~"
|
67
|
+
when Array then encode(obj.map { |e| encode(e) }.join, '[')
|
68
|
+
when Hash then encode(obj.map { |a,b| encode(a)+encode(b) }.join, '{')
|
69
|
+
when FalseClass, TrueClass then encode(obj.inspect, '!')
|
70
|
+
else raise Error, 'cannot encode %p' % obj
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def with_encoding(str, encoding, fallback = nil)
|
77
|
+
return str unless str.respond_to? :encode
|
78
|
+
encoding = Encoding.find encoding if encoding.respond_to? :to_str
|
79
|
+
encoding ||= fallback
|
80
|
+
encoding ? str.encode(encoding) : str
|
81
|
+
rescue EncodingError
|
82
|
+
str.force_encoding(encoding)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/rb-fsevent/fsevent.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'otnetstring'
|
4
|
+
|
1
5
|
class FSEvent
|
2
6
|
class << self
|
3
7
|
class_eval <<-END
|
@@ -38,26 +42,67 @@ class FSEvent
|
|
38
42
|
# please note the use of IO::select() here, as it is used specifically to
|
39
43
|
# preserve correct signal handling behavior in ruby 1.8.
|
40
44
|
while @running && IO::select([@pipe], nil, nil, nil)
|
41
|
-
|
42
|
-
|
43
|
-
|
45
|
+
# managing the IO ourselves allows us to be careful and never pass an
|
46
|
+
# incomplete message to OTNetstring.parse()
|
47
|
+
message = ""
|
48
|
+
length = ""
|
49
|
+
byte = nil
|
50
|
+
|
51
|
+
reading_length = true
|
52
|
+
found_length = false
|
53
|
+
|
54
|
+
while reading_length
|
55
|
+
byte = @pipe.read_nonblock(1)
|
56
|
+
if "#{byte}" =~ /\d/
|
57
|
+
length << byte
|
58
|
+
found_length = true
|
59
|
+
elsif found_length == false
|
60
|
+
next
|
61
|
+
else
|
62
|
+
reading_length = false
|
63
|
+
end
|
64
|
+
end
|
65
|
+
length = Integer(length, 10)
|
66
|
+
type = byte
|
67
|
+
|
68
|
+
message << "#{length}#{type}"
|
69
|
+
message << @pipe.read(length)
|
70
|
+
|
71
|
+
decoded = OTNetstring.parse(message)
|
72
|
+
modified_paths = decoded["events"].map {|event| event["path"]}
|
73
|
+
# passing the full info as a second block param feels icky, but such is
|
74
|
+
# the trap of backward compatibility.
|
75
|
+
case callback.arity
|
76
|
+
when 1
|
77
|
+
callback.call(modified_paths)
|
78
|
+
when 2
|
79
|
+
callback.call(modified_paths, decoded)
|
44
80
|
end
|
45
81
|
end
|
46
|
-
rescue Interrupt, IOError
|
82
|
+
rescue Interrupt, IOError, Errno::EBADF
|
47
83
|
ensure
|
48
84
|
stop
|
49
85
|
end
|
50
86
|
|
51
87
|
def stop
|
52
88
|
unless @pipe.nil?
|
53
|
-
Process.kill('KILL', @pipe.pid)
|
89
|
+
Process.kill('KILL', @pipe.pid) if process_running?(@pipe.pid)
|
54
90
|
@pipe.close
|
55
91
|
end
|
56
|
-
rescue IOError
|
92
|
+
rescue IOError, Errno::EBADF
|
57
93
|
ensure
|
58
94
|
@running = false
|
59
95
|
end
|
60
96
|
|
97
|
+
def process_running?(pid)
|
98
|
+
begin
|
99
|
+
Process.kill(0, pid)
|
100
|
+
true
|
101
|
+
rescue Errno::ESRCH
|
102
|
+
false
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
61
106
|
if RUBY_VERSION < '1.9'
|
62
107
|
def open_pipe
|
63
108
|
IO.popen("'#{self.class.watcher_path}' #{options_string} #{shellescaped_paths}")
|
@@ -99,11 +144,12 @@ class FSEvent
|
|
99
144
|
private
|
100
145
|
|
101
146
|
def parse_options(options={})
|
102
|
-
opts = []
|
147
|
+
opts = ['--format=otnetstring']
|
103
148
|
opts.concat(['--since-when', options[:since_when]]) if options[:since_when]
|
104
149
|
opts.concat(['--latency', options[:latency]]) if options[:latency]
|
105
150
|
opts.push('--no-defer') if options[:no_defer]
|
106
151
|
opts.push('--watch-root') if options[:watch_root]
|
152
|
+
opts.push('--file-events') if options[:file_events]
|
107
153
|
# ruby 1.9's IO.popen(array-of-stuff) syntax requires all items to be strings
|
108
154
|
opts.map {|opt| "#{opt}"}
|
109
155
|
end
|
data/lib/rb-fsevent/version.rb
CHANGED
data/lib/rb-fsevent.rb
CHANGED
data/rb-fsevent.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rb-fsevent/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'rb-fsevent'
|
8
|
+
s.version = FSEvent::VERSION
|
9
|
+
s.authors = ['Thibaud Guillaume-Gentil', 'Travis Tilley']
|
10
|
+
s.email = ['thibaud@thibaud.gg', 'ttilley@gmail.com']
|
11
|
+
s.homepage = 'http://rubygems.org/gems/rb-fsevent'
|
12
|
+
s.summary = 'Very simple & usable FSEvents API'
|
13
|
+
s.description = 'FSEvents API with Signals catching (without RubyCocoa)'
|
14
|
+
s.license = 'MIT'
|
15
|
+
|
16
|
+
s.metadata = {
|
17
|
+
'source_code_uri' => 'https://github.com/thibaudgg/rb-fsevent'
|
18
|
+
}
|
19
|
+
|
20
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
21
|
+
s.require_path = 'lib'
|
22
|
+
|
23
|
+
s.add_development_dependency 'rspec', '~> 3.6'
|
24
|
+
s.add_development_dependency 'guard-rspec', '~> 4.2'
|
25
|
+
s.add_development_dependency 'rake', '~> 12.0'
|
26
|
+
end
|
metadata
CHANGED
@@ -1,118 +1,115 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb-fsevent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Thibaud Guillaume-Gentil
|
9
8
|
- Travis Tilley
|
10
|
-
autorequire:
|
9
|
+
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2022-02-06 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
15
|
+
name: rspec
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
20
|
+
version: '3.6'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- - ~>
|
25
|
+
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
27
|
+
version: '3.6'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
|
-
name: rspec
|
29
|
+
name: guard-rspec
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- - ~>
|
32
|
+
- - "~>"
|
37
33
|
- !ruby/object:Gem::Version
|
38
|
-
version: '2
|
34
|
+
version: '4.2'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- - ~>
|
39
|
+
- - "~>"
|
45
40
|
- !ruby/object:Gem::Version
|
46
|
-
version: '2
|
41
|
+
version: '4.2'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
43
|
+
name: rake
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- - ~>
|
46
|
+
- - "~>"
|
53
47
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
48
|
+
version: '12.0'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- - ~>
|
53
|
+
- - "~>"
|
61
54
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
55
|
+
version: '12.0'
|
63
56
|
description: FSEvents API with Signals catching (without RubyCocoa)
|
64
57
|
email:
|
65
|
-
- thibaud@thibaud.
|
58
|
+
- thibaud@thibaud.gg
|
66
59
|
- ttilley@gmail.com
|
67
60
|
executables: []
|
68
61
|
extensions: []
|
69
62
|
extra_rdoc_files: []
|
70
63
|
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- Gemfile
|
66
|
+
- Guardfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
71
70
|
- bin/fsevent_watch
|
71
|
+
- ext/LICENSE
|
72
|
+
- ext/fsevent_watch/FSEventsFix.c
|
73
|
+
- ext/fsevent_watch/FSEventsFix.h
|
74
|
+
- ext/fsevent_watch/TSICTString.c
|
75
|
+
- ext/fsevent_watch/TSICTString.h
|
76
|
+
- ext/fsevent_watch/cli.c
|
77
|
+
- ext/fsevent_watch/cli.h
|
78
|
+
- ext/fsevent_watch/common.h
|
79
|
+
- ext/fsevent_watch/compat.c
|
80
|
+
- ext/fsevent_watch/compat.h
|
81
|
+
- ext/fsevent_watch/defines.h
|
82
|
+
- ext/fsevent_watch/main.c
|
83
|
+
- ext/fsevent_watch/signal_handlers.c
|
84
|
+
- ext/fsevent_watch/signal_handlers.h
|
85
|
+
- ext/rakefile.rb
|
86
|
+
- lib/otnetstring.rb
|
87
|
+
- lib/rb-fsevent.rb
|
72
88
|
- lib/rb-fsevent/fsevent.rb
|
73
89
|
- lib/rb-fsevent/version.rb
|
74
|
-
-
|
75
|
-
- ext/fsevent_watch/fsevent_watch/cli.c
|
76
|
-
- ext/fsevent_watch/fsevent_watch/cli.h
|
77
|
-
- ext/fsevent_watch/fsevent_watch/common.h
|
78
|
-
- ext/fsevent_watch/fsevent_watch/compat.c
|
79
|
-
- ext/fsevent_watch/fsevent_watch/compat.h
|
80
|
-
- ext/fsevent_watch/fsevent_watch/main.c
|
81
|
-
- ext/fsevent_watch/fsevent_watch/TSICTString.c
|
82
|
-
- ext/fsevent_watch/fsevent_watch/TSICTString.h
|
83
|
-
- ext/fsevent_watch/fsevent_watch.xcodeproj/project.pbxproj
|
84
|
-
- ext/fsevent_watch/Info.plist
|
85
|
-
- ext/fsevent_watch/LICENSE
|
86
|
-
- ext/fsevent_watch/xcconfig/Common.xcconfig
|
87
|
-
- ext/fsevent_watch/xcconfig/Debug.xcconfig
|
88
|
-
- ext/fsevent_watch/xcconfig/fsevent_watch.xcconfig
|
89
|
-
- ext/fsevent_watch/xcconfig/Release.xcconfig
|
90
|
-
- ext/rakefile.rb
|
91
|
-
- ext/rb-fsevent.xcconfig
|
92
|
-
- LICENSE
|
93
|
-
- README.rdoc
|
90
|
+
- rb-fsevent.gemspec
|
94
91
|
homepage: http://rubygems.org/gems/rb-fsevent
|
95
|
-
licenses:
|
96
|
-
|
92
|
+
licenses:
|
93
|
+
- MIT
|
94
|
+
metadata:
|
95
|
+
source_code_uri: https://github.com/thibaudgg/rb-fsevent
|
96
|
+
post_install_message:
|
97
97
|
rdoc_options: []
|
98
98
|
require_paths:
|
99
99
|
- lib
|
100
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
101
|
requirements:
|
103
|
-
- -
|
102
|
+
- - ">="
|
104
103
|
- !ruby/object:Gem::Version
|
105
104
|
version: '0'
|
106
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
106
|
requirements:
|
109
|
-
- -
|
107
|
+
- - ">="
|
110
108
|
- !ruby/object:Gem::Version
|
111
109
|
version: '0'
|
112
110
|
requirements: []
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
specification_version: 3
|
111
|
+
rubygems_version: 3.2.22
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
117
114
|
summary: Very simple & usable FSEvents API
|
118
115
|
test_files: []
|