Module: Leakferret
- Defined in:
- lib/leakferret.rb,
lib/leakferret/error.rb,
lib/leakferret/binary.rb,
lib/leakferret/client.rb,
lib/leakferret/version.rb,
lib/leakferret/platform.rb
Overview
Ruby wrapper around the native ‘leakferret` binary.
The binary is downloaded once per platform at gem install time (‘ext/leakferret/extconf.rb`) into `lib/leakferret/bin/`. Subsequent calls shell out to it and parse the JSON output.
Defined Under Namespace
Modules: Binary, Platform Classes: BinaryInvocationError, BinaryNotFoundError, Client, Error
Constant Summary collapse
- VERSION =
The gem’s own version.
'0.1.3'- BINARY_VERSION =
The native binary release this gem downloads. Tracks the leakferret core release, which may move independently of the gem’s own version (e.g. a gem-only bugfix).
'0.1.1'
Class Method Summary collapse
-
.binary_path ⇒ Object
Path to the bundled binary.
-
.binary_version ⇒ Object
Version reported by the bundled binary (Rust) — may differ from the gem version during pre-release.
-
.rewrite(path = '.', apply: false, **opts) ⇒ Object
Scan + classify + propose rewrites for REAL findings.
-
.scan(path = '.', **opts) ⇒ Object
Scan a directory; returns an array of finding hashes.
-
.verify(path = '.', **opts) ⇒ Object
Scan + verify + classify; returns findings with verification + verdict filled in.
Class Method Details
.binary_path ⇒ Object
Path to the bundled binary. Useful for tooling integration.
37 38 39 |
# File 'lib/leakferret.rb', line 37 def binary_path Binary.path end |
.binary_version ⇒ Object
Version reported by the bundled binary (Rust) — may differ from the gem version during pre-release.
43 44 45 46 |
# File 'lib/leakferret.rb', line 43 def binary_version out, _err, _status = Open3.capture3(binary_path, '--version') out.strip end |
.rewrite(path = '.', apply: false, **opts) ⇒ Object
Scan + classify + propose rewrites for REAL findings. Use apply: true to write the rewrites in place.
32 33 34 |
# File 'lib/leakferret.rb', line 32 def rewrite(path = '.', apply: false, **opts) Client.new.rewrite(path, apply: apply, **opts) end |