Class: Audition::Dynamic::Prober
- Inherits:
-
Object
- Object
- Audition::Dynamic::Prober
- Defined in:
- lib/audition/dynamic/prober.rb
Overview
Spawns the harness subprocess per probe mode, parses its JSON, and converts observations into findings.
Constant Summary collapse
- HARNESS =
File.("harness.rb", __dir__)
- RUNTIME_WHY =
"Observed on the live object graph after loading the " \ "target; this is ground truth, not a static guess."
Instance Method Summary collapse
-
#initialize(ruby: RbConfig.ruby, timeout: 30) ⇒ Prober
constructor
A new instance of Prober.
-
#probe(entry) ⇒ Result
Runs the probe described by a Target#entry hash.
Constructor Details
#initialize(ruby: RbConfig.ruby, timeout: 30) ⇒ Prober
Returns a new instance of Prober.
34 35 36 37 |
# File 'lib/audition/dynamic/prober.rb', line 34 def initialize(ruby: RbConfig.ruby, timeout: 30) @ruby = ruby @timeout = timeout end |
Instance Method Details
#probe(entry) ⇒ Result
Runs the probe described by a Target#entry hash.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/audition/dynamic/prober.rb', line 44 def probe(entry) case (entry[:mode] || entry["mode"]).to_sym when :script then probe_script(entry) when :require then probe_require(entry) when :rack then probe_rack(entry) when :rails then probe_rails(entry) when :capabilities then probe_capabilities else raise Error, "unknown dynamic probe mode in #{entry}" end end |