
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Provides a mixin and decorator to add a Hash#fetch
like interface to any object.
You must define a []
subscript method for raw access to the fetchable data.
Your []
method must return anything but nil in order for #fetch
to consider
a key successfully fetched. False
is considered sucessful.
Hash#Fetch
is one of my favourite Ruby methods and can be tricky to implement
its full behaviour so here it is extracted for you to add to whichever object
you choose.
If you're not familiar with Hash#fetch
it's a great way to help eliminate nils
as it raises an error when the desired key is not found. For more info consult
Ruby Hash documentation.
Add this line to your application's Gemfile:
gem 'fetchable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fetchable
[]
method
require "fetchable"
things = %w(zero one two).extend(Fetchable)
things.fetch(0)
=> "zero"
things.fetch(2)
=> "two"
things.fetch(3)
=> KeyError: key not found 3
things.fetch(3, "three")
=> "three"
things.fetch(3) { "Execute a block!" }
=> "Execute a block!"
things.fetch(3) { |key| "Do something based on missing key #{key}" }
=> "Do something based on missing key 3"
We got you covered! Use Fetchable::Decorator
instead.
require "fetchable/decorator"
things = %w(zero one two)
fetchable_things = Fetchable::Decorator.new(things)
fetchable_things.fetch(1)
=> "one"
Lambdas, procs and method objects can also be called with #[]
.
Why not make them fetchable?
It might be funny.
Dammit method, you better not return me a nil
, I'll be so mad.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that fetchable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.