# ruby-trace

> A Frida-based tracer, for Ruby

Latest version **1.1.0** (published 2021-12-31) · BSD-2-Clause/Ruby license · 0 weekly downloads

## Install

```sh
npm install ruby-trace
pnpm add ruby-trace
yarn add ruby-trace
bun add ruby-trace
```

Provides the command `ruby-trace`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-12-31 |
| First published | 2021-08-08 |
| Weekly downloads | 0 |
| License | BSD-2-Clause/Ruby |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 286.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jeff Dileo |
| Maintainers | chaosdata |

## Links

- npm: https://www.npmjs.com/package/ruby-trace
- npm.io page: https://npm.io/package/ruby-trace

## Dependencies (3)

- [frida](https://npm.io/package/frida.md) ^15.1.14
- [mustache](https://npm.io/package/mustache.md) ^4.2.0
- [commander](https://npm.io/package/commander.md) ^6.2.1

## Recent versions

- 1.1.0 (latest) — 2021-12-31
- 1.0.0 — 2021-08-08

## README

# ruby-trace

ruby-trace is a frida-based tracer for (c)[ruby](https://github.com/ruby/ruby).
It currently supports ruby 2.6-3.1.

# Install

```
$ sudo npm install -g ruby-trace
```

***Note:*** `--unsafe-perm` may be needed when installing as root with older
            versions of npm due to how the `frida` depdendency builds during install.

# Building from Source

```
$ git clone https://github.com/nccgroup/ruby-trace
$ cd ruby-trace
$ npm install
$ npm run compile-agent
$ sudo npm install -g
```

# Usage

ruby-trace uses Ruby's tracing infrastructure to enable/disable its own
tracing. If you want to trace against an entire program, you can do something
like the following:

```
$ ruby-trace -- ruby -e 'TracePoint.new(:call) { |tp| }.enable' -e "$(cat test/misc/readme.rb)"
```

Alternatively, for more fine-grained tracing, you would write something like
the following:

```
def ruby_trace
  t = TracePoint.new(:call) { |tp| }
  t.enable
  yield
ensure
  t.disable
end

...

ruby_trace {
  ...
}

...
```

```
$ ruby-trace -- ruby /path/to/file.rb
```

# License

ruby-trace is licensed under the 2-clause BSD License and the Ruby License.

---
_Source: https://npm.io/package/ruby-trace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
