[macruby-changes] [1372] MacRuby/branches/experimental/rakelib/execute.rake

source_changes at macosforge.org source_changes at macosforge.org
Sun Apr 5 10:40:09 PDT 2009


Revision: 1372
          http://trac.macosforge.org/projects/ruby/changeset/1372
Author:   eloy.de.enige at gmail.com
Date:     2009-04-05 10:40:09 -0700 (Sun, 05 Apr 2009)
Log Message:
-----------
Reraise NoCommandError exceptions.

Modified Paths:
--------------
    MacRuby/branches/experimental/rakelib/execute.rake

Modified: MacRuby/branches/experimental/rakelib/execute.rake
===================================================================
--- MacRuby/branches/experimental/rakelib/execute.rake	2009-04-05 17:26:16 UTC (rev 1371)
+++ MacRuby/branches/experimental/rakelib/execute.rake	2009-04-05 17:40:09 UTC (rev 1372)
@@ -1,14 +1,18 @@
 namespace :execute do
+  class NoCommandError < StandardError; end
+  
   def command
     if ENV['e']
       ENV['e']
     else
-      raise ArgumentError, 'To execute a command do: rake execute:all e="p :foo"'
+      raise NoCommandError, 'To execute a command do: rake execute:all e="p :foo"'
     end
   end
   
   def run(bin)
-    sh "#{bin} -e '#{command}'" rescue nil
+    sh "#{bin} -e '#{command}'"
+  rescue Exception => e
+    raise e if e.is_a?(NoCommandError)
   end
   
   desc "Run command (ENV['e']) with miniruby (MacRuby)"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090405/7748d5cb/attachment-0001.html>


More information about the macruby-changes mailing list