A tool to run a Ruby script while showing the executed lines of code.
$ gem install rubyx
$ rubyx -h
Usage: rubyx [options] <file> -- [arguments]
Options:
-i PREFIX Set prefix for source code (default: "")
-o PREFIX Set prefix for standard output (default: "# => ")
-h Show this message
$ rubyx input.rb > output.rb
In input.rb
:
def say
puts 'Hello!'
end
say
puts 'Bye!'
In output.rb
:
def say
puts 'Hello!'
end
say
# => Hello!
puts 'Bye!'
# => Bye!