bin/wu-local in wukong-3.0.0.pre2 vs bin/wu-local in wukong-3.0.0.pre3
- old
+ new
@@ -40,12 +40,12 @@
$ echo 'UNIX is clever and fun...' | wu-local tokenize_and_downcase_big_words.rb
unix
clever
EOF
-settings.define :run, description: "Name of the processor or dataflow to use. Defaults to basename of the given path.", flag: 'r'
-
+settings.define :run, description: "Name of the processor or dataflow to use. Defaults to basename of the given path.", flag: 'r'
+# settings.define :tcp_server, description: "Run locally as a tcp server on a specified port", default: false, flag: 't'
require 'wukong/boot' ; Wukong.boot!(settings)
thing = settings.rest.first
case
when thing.nil?
@@ -58,12 +58,20 @@
processor = settings.run || File.basename(thing, '.rb')
else
settings.dump_help
exit(2)
end
-# p settings
+
+
+
begin
- Wukong::LocalDriver.run(processor.to_sym, settings)
-rescue Wukong::Error => e
+ # EM.run do
+ # settings.tcp_server ? Wu::TCPServer.start(processor.to_sym, settings) : Wu::StdioServer.start(processor.to_sym, settings)
+ # end
+ StupidServer.new(processor.to_sym, settings).run!
+rescue Wu::Error => e
$stderr.puts e.message
exit(3)
end
+
+# One day, it will be this easy...
+# Wukong::LocalRunner.run!