
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.
SortedSet implements a Set whose elements are sorted in ascending
order (according to the return values of their <=>
methods) when
iterating over them.
Every element in SortedSet must be mutually comparable to every
other: comparison with <=>
must not return nil for any pair of
elements. Otherwise ArgumentError will be raised.
Currently this library does nothing for JRuby, as it has its own version of Set and SortedSet.
Add this line to your application's Gemfile:
gem 'sorted_set'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install sorted_set
require "sorted_set"
set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3])
ary = []
set.each do |obj|
ary << obj
end
p ary # => [1, 2, 3, 4, 5, 6]
set2 = SortedSet.new([1, 2, "3"])
set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/knu/sorted_set.
The gem is available as open source under either the terms of the 2-Clause BSD License.
FAQs
Unknown package
We found that sorted_set 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
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.