
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.
List in Ruby.
List is a class of wrapped singly-linked list.
It's can use same as Array. But processing speed is different.
All interface is same with Array class.
> Array.methods - List.methods
=> []
> Array.new.methods - List.new.methods
=> []
List can use instead of Array.
require 'list'
list = List.new # or List[]
list.push 1,2,3
list.pop #=> 3
list[0,2] #=> List[1,2]
list[0,1] = 5
list.each do |i|
puts i #=> 5,2
end
puts List[1,2,3].map{|i| i * i}.inject(:+) #=> 14
+---------+ +->+---------+ +->+---------+
| value | | | value | | | value |
| next |--+ | next |--+ | next |
+---------+ +---------+ +---------+
But, List is not Array.
list = List[1,2,3]
list.ring.each do |i|
puts i # print infinitely 1,2,3,1,2,3,1,2...
end
+->+---------+ +->+---------+ +->+---------+
| | value | | | value | | | value |
| | next |--+ | next |--+ | next |--+
| +---------+ +---------+ +---------+ |
+-----------------------------------------------+
Enumeratable
List#ring
: experimental method for expressing the ring buffer.
List#ring!
: change self to ring buffer.
List#ring?
: check self to ring buffer.
Enumeratable#to_list
: all class of included Enumeratable, can convert to List instance
List#to_list
: return self.
List#to_a
: change from List to Array.
Add this line to your application's Gemfile:
gem 'list'
And then execute:
$ bundle
Or install it yourself as:
$ gem install list
This library is tested using Travis.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that list 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.