
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
= cheap_advice
Add/remove advice around, before or after methods in Ruby.
== Example
class MyClass def foo 42 end end
class MyOtherClass def bar 43 end end
a = MyClass.new b = MyOtherClass.new
trace_advice = CheapAdvice.new(:around) do | ar, body |
ar.advice[:log].puts "#{Time.now.iso8601(6)} #{ar.rcvr.class} #{ar.method} #{ar.rcvr.object_id}"
body.call
ar.advice[:log].puts "#{Time.now.iso8601(6)} #{ar.rcvr.class} #{ar.method} #{ar.rcvr.object_id} => #{ar.result.inspect}"
end
trace_advice[:log] = File.open("trace.log", "a+")
trace_advice.advise!(MyClass, :foo)
trace_advice.advise!(MyOtherClass, :bar)
a.foo b.bar
trace_advice.disable!
a.foo b.bar
trace.log will contain something like:
2011-01-17T16:33:27.882122-06:00 MyClass foo 69872883178280 2011-01-17T16:33:27.882262-06:00 MyClass foo 69872883178280 => 42 2011-01-17T16:33:27.882319-06:00 MyOtherClass bar 69872883178200 2011-01-17T16:33:27.882367-06:00 MyOtherClass bar 69872883178200 => 43
== Other Features
== Issues
== Contributing to cheap_advice
== Copyright
Copyright (c) 2008-2011 Kurt Stephens. See LICENSE.txt for further details.
FAQs
Unknown package
We found that cheap_advice demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.