Ruam
Ruam is a simple command line tool to inspect a byte code of Ruby script.
Installation
Add this line to your application's Gemfile:
gem 'ruam'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruam
Usage
$ cat hello.rb
puts 'hello world'
$ ruam hello.rb
== disasm: #<ISeq:<main>@hello.rb>======================================
0000 trace 1 ( 1)
0002 putself
0003 putstring "hello world"
0005 opt_send_without_block <callinfo!mid:puts, argc:1, FCALL|ARGS_SIMPLE>, <callcache>
0008 leave
If file name is not given, ruam
read from stdin:
$ echo "puts 'hello world'" | ruam
== disasm: #<ISeq:<compiled>@<compiled>>================================
0000 trace 1 ( 1)
0002 putself
0003 putstring "hello world"
0005 opt_send_without_block <callinfo!mid:puts, argc:1, FCALL|ARGS_SIMPLE>, <callcache>
0008 leave
You can enable/disable compile option which are defined in the VM:
$ ruam hello.rb --no-trace-instruction
== disasm: #<ISeq:<main>@hello.rb>======================================
0000 putself ( 1)
0001 putstring "hello world"
0003 opt_send_without_block <callinfo!mid:puts, argc:1, FCALL|ARGS_SIMPLE>, <callcache>
0006 leave
For more info, execute ruam -h
.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruam.
Lisence
Apache License 2.0
Author
@AuToPP