ronin-ruby/ronin — Issue #14: Allow Console commands to embed Ruby expressions
Author: postmodern
Created: 2012-03-09 01:15:04+00:00
State: open

In order to breakdown the barrier between the Ruby Console and the in-line shell commands, we should allow embedding of Ruby expressions into the shell commands:

>> ip = "10.0.0.1"
>> ports = [80,135,137,443,8080,8081,9090]
...
>> !nmap -sT -P0 -v -p #{ports.join(',')} #{ip}

This could be done by using `String#gsub` to match `/\#\{[^\}]*\}/` with a block to evaluate the expression.