dyntask-ruby 0.2.1 → 0.3.0
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 +4 -4
- data/bin/dyntask-server +28 -26
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eb88661e88725a6470587e2e1df8041676ce490
|
4
|
+
data.tar.gz: f04ff49f551959b2495fe9d90824c947ddc3f6bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66ba063704574fa0347160198ffef3731d959e67813c02ff1642ca43617bb46df9233842fd630b031a7b9fe5dd72efd5749a7c104bc24a7226fa15bf9ca6bc4
|
7
|
+
data.tar.gz: 46449e38ffa2edcaa57a390e714bc5cd7c5d8d08f3a3e4ea310c6364cf4b0495aff0f990507c06a05c8a7e28a13ce5d903ae6a31fc6baa7608a9c02c47bed9ba
|
data/bin/dyntask-server
CHANGED
@@ -83,34 +83,36 @@ puts "Tasks watched: #{files_to_watch}"
|
|
83
83
|
# child_pid = nil
|
84
84
|
# end
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
86
|
+
if RUBY_PLATFORM =~ /mingw/
|
87
|
+
begin
|
88
|
+
require 'win32/dirmonitor'
|
89
|
+
include Win32
|
90
|
+
|
91
|
+
# Wait for a change in your home directory and report any changes.
|
92
|
+
|
93
|
+
monitor = Win32::DirMonitor.new(DynTask.cfg_dir[:run])
|
94
|
+
|
95
|
+
monitor.wait(){ |struct|
|
96
|
+
path = Pathname.new(struct.file).realpath.to_s
|
94
97
|
DynTask.read_tasks path
|
98
|
+
}
|
99
|
+
rescue SystemExit, Interrupt
|
100
|
+
puts "leaving win32-dirmonitor"
|
101
|
+
end
|
102
|
+
else
|
103
|
+
begin
|
104
|
+
|
105
|
+
##p files
|
106
|
+
fw = FileWatcher.new(files_to_watch, options[:list], options[:dontwait], options[:spinner])
|
95
107
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
# child_id = restart(child_pid, {}, cmd)
|
102
|
-
# end
|
103
|
-
# else
|
104
|
-
# begin
|
105
|
-
# p "cmd: <#{cmd}>"
|
106
|
-
# pid = Process.spawn({}, cmd)
|
107
|
-
# Process.wait()
|
108
|
-
# rescue SystemExit, Interrupt
|
109
|
-
# exit(0)
|
110
|
-
# end
|
111
|
-
# end
|
108
|
+
fw.watch(options[:interval]) do |filename, event|
|
109
|
+
if([:changed,:new].include? event)
|
110
|
+
path = Pathname.new(filename).realpath.to_s
|
111
|
+
DynTask.read_tasks path
|
112
|
+
end
|
112
113
|
end
|
114
|
+
|
115
|
+
rescue SystemExit, Interrupt
|
116
|
+
fw.finalize
|
113
117
|
end
|
114
|
-
rescue SystemExit, Interrupt
|
115
|
-
fw.finalize
|
116
118
|
end
|