
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.
= chess_data
Install from {RubyGems}[https://rubygems.org/gems/chess_data/]:
gem install chess_data
source:: https://notabug.org/peterlane/chess_data/
== Description
For searching/filtering datasets of chess games.
Features
== Position Definitions
Games are stored in an instance of +ChessData+::+Database+, and can be filtered using the +search+ method. The search method takes a block defining the numbers of pieces of each type and returns a new database containing just those games which match the definition. For example, the following filters for 5-4 rook endings:
rook_endings_database = database.search do exactly 1, "R", "r" exactly 5, "P" exactly 4, "p" end
Filters include:
== Example: Extracting all 5-4 R+P endings
require 'chess_data'
database = ChessData::Database.new
ARGV.each do |file| puts "Reading from #{file}" database.add_games_from file end
selected = database.search do exactly 1, "R", "r" exactly 5, "P" exactly 4, "p" end
puts "Found #{selected.size} games" selected.to_file "selected.pgn"
puts "Selected #{selected.size} out of #{database.size}"
== Example: Study a game move-by-move
The ChessData::Game#play_game method takes a block, which is passed the current board and next move after each half move. The following example prints out the board position and information to create a trace of the game:
$game.play_game do |board, next_move| puts board.to_s puts puts "Move #{board.fullmove_number}: #{if board.to_move == "w" then "" else "... " end}#{next_move}" end
Sample output:
Move 32: Rxd7+ ........ ..kR...p ....pb.Q ........ ..P..Pq. .Pn..... ......P. ......BK
Move 32: ... Kxd7 ........ ...k...p ....pb.Q ........ ..P..Pq. .Pn..... ......P. ......BK
Move 33: Qxf6 ........ ...k...p ....pQ.. ........ ..P..Pq. .Pn..... ......P. ......BK
Move 33: ... 1/2-1/2
FAQs
Unknown package
We found that chess_data 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.