dyntask-ruby 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dyntask-server +28 -26
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32f665b18af358424d761e7e264af5458587a35b
4
- data.tar.gz: 8e99114bd030612f15dc7a0cf454b6ef81276b4a
3
+ metadata.gz: 9eb88661e88725a6470587e2e1df8041676ce490
4
+ data.tar.gz: f04ff49f551959b2495fe9d90824c947ddc3f6bf
5
5
  SHA512:
6
- metadata.gz: 9b004c59f153f88e44ee795a928c4ac913a9b18b0b0495d30de640fd43ee79fa81b5816739c0e3f8bf513e0ae2093eef82db2d49d52a25bc2caadac9301cf3a6
7
- data.tar.gz: 08e7f8ab5fe6ce67fbe9fb6c9b6ed1b18096e12eb8f594ea925b680377b04dca3fe6eac7187528d65fb436046b8d93177158815ff5f82ec44dece0a16dda928d
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
- begin
87
- ##p files
88
- fw = FileWatcher.new(files_to_watch, options[:list], options[:dontwait], options[:spinner])
89
-
90
- fw.watch(options[:interval]) do |filename, event|
91
- cmd=nil
92
- if([:changed,:new].include? event)
93
- path = Pathname.new(filename).realpath.to_s
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
- # cmd = "dyntask-reader "+path
97
- # if(options[:restart])
98
- # if(child_pid == nil)
99
- # child_pid = Process.spawn({}, cmd)
100
- # else
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyntask-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS