
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
A decorator.
Add this line to your application's Gemfile:
gem 'plastic_wrap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install plastic_wrap
PlasticWrap is easy to use. There are 2 variants of wrapping.
The easiest and most maleable is Light. This uses SimpleDelegator under the covers to do all the heavy lifting.
class Leftovers
def best_before
@best_before ||= Time.now
end
end
class ReadableBestBefore < PlasticWrap::Light
def best_before
super.strftime('%m-%y')
end
end
ReadableBestBefore.wrap(Leftovers.new).best_before #=> 1-2001
The other variant is Heavy. This uses Delegator under the covers for its lifting. You may want to use this is you don't want to deal with tracing through method_missing calls.
class Leftovers
def best_before
@best_before ||= Time.now
end
end
class ReadableBestBefore < PlasticWrap.create_wrap(Leftovers)
def best_before
super.strftime('%m-%y')
end
end
ReadableBestBefore.wrap(Leftovers.new).best_before #=> 1-2001
No matter which variant you decide to use; the wrap method accepts Enumerables and will return an array of nicely wrapped models. You also get the benefit of all the built-in Rails helpers in your decorators.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that plastic_wrap 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
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.