Module: FileUtils
- Defined in:
- toplevel/lib/sumi/binaries/rake.rb
Overview
Extends FileUtils with Sumi script helpers for Rake tasks.
Instance Method Summary collapse
-
#sumi(file, *args, **kwargs) ⇒ Sumi::Executor::Result
Thin DSL wrapper to call a script without spawning a shell.
Instance Method Details
#sumi(file, *args, **kwargs) ⇒ Sumi::Executor::Result
Thin DSL wrapper to call a script without spawning a shell.
The script receives positional arguments through ARGA and keyword arguments through ARGH.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'toplevel/lib/sumi/binaries/rake.rb', line 21 def sumi(file, *args, **kwargs) result = Sumi::Executor.__send__(:execute_file, Sumi::F.existing!(file, [Sumi::EXTENSION])) do extend(Sumi) const_set(:ARGA, args).freeze const_set(:ARGH, kwargs).freeze end raise result.error if result.error? result end |