Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
An experimental gem to add a more flexible grouping option to the excellent prawn gem.
Add this line to your application's Gemfile:
gem 'prawn-grouping'
And then execute:
$ bundle
Or install it yourself as:
$ gem install prawn-grouping
Prawn::Document.new do
20.times { text "Regular text" }
group do |g|
20.times { g.text "Paragraphs not separated unless necessary" }
end
end
Prawn::Document.new do
5.times { text "Regular text" }
group do |g|
15.times { g.text "Paragraphs not separated unless necessary" }
group do |g|
30.times { g.text "Subparagraphs not separated unless necessary" }
end
end
end
Do not overuse nesting because a every combination has to be tested recursively in a temporary document
Currently three callbacks are supported:
:fits_current_context
A proc called before the content is rendered and does fit context.:fits_new_context
A proc called before the content is rendered and does fit a single context.:too_tall
A proc called before the content is rendered and does not fit a single context.Prawn::Document.new do
5.times { text "Regular text" }
group :too_tall => lambda { start_new_page } do |g|
15.times { g.text "Paragraphs not separated unless necessary" }
end
end
The example above starts a new page if the content is too tall for a single page. Default behavior would be to just append the content.
Prawn::Document.new do
5.times { text "Regular text" }
group do |g|
15.times { g.text "Paragraphs not separated unless necessary" }
end
end
The grouping internally works by executing the block one or multiple times and checking the results, because deep copy did not work well for the original implementation in many cases. As a result you should not manipulate your data objects within the block. See issue #7 for details.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that prawn-grouping 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.