Top Level Namespace
Constant Summary collapse
- SW_VERSION =
'0.3.1'
Instance Method Summary collapse
Instance Method Details
#abort!(message = $!) ⇒ Object
9 10 11 |
# File 'lib/sw.rb', line 9 def abort!(=$!) abort("#$program_name: #{}") end |
#warn!(message, **kw) ⇒ Object
13 14 15 |
# File 'lib/sw.rb', line 13 def warn!(, **kw) warn("#$program_name: #{}", **kw) end |
#x!(cmd, chomp: true) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sw.rb', line 17 def x!(cmd, chomp: true) puts "running: #{cmd}" if $VERBOSE result = Kernel.`(cmd) #` result.chomp! if chomp if $?.success? result else raise RuntimeError, "Command failed with exit 1: #{cmd}", caller(1) end end |