Permalink
Browse files

Added the ability to run the editor command as a background process.

* In order to be Windows compatible I have to spawn a new Thread
  and run the command via system. Why doesn't Windows support fork()?
  • Loading branch information...
1 parent 85c57cb commit 1a2eca450aead6ef6c41ff2717a8b8c642b7ba74 @postmodern committed May 29, 2009
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/sketches/sketch.rb
View
9 lib/sketches/sketch.rb
@@ -38,6 +38,9 @@ class Sketch
# Last modification time of the sketch
attr_reader :mtime
+
+ # command runner
+ RUNNER = Kernel.method(:system)
#
# Creates a new sketch object with the specified _id_ and the given
@@ -93,7 +96,11 @@ def edit
end
end
- system(cmd)
+ if Config.background
+ Thread.new(cmd,&RUNNER)
+ else
+ RUNNER.call(cmd)
+ end
end
#

0 comments on commit 1a2eca4

Please sign in to comment.