Add RBS for rubyXL 3.4#1006
Merged
github-actions[bot] merged 2 commits intoruby:mainfrom Feb 22, 2026
Merged
Conversation
rubyXL is a gem for reading and writing Excel (.xlsx) files. This commit adds type definitions for the most commonly used APIs described in the README. Defined classes: - RubyXL::SheetData — sparse array of rows with index access - RubyXL::Row — sparse array of cells with index access - RubyXL::Cell — cell value accessor and style-change methods - RubyXL::Worksheet — sheet name, cell creation, row/column styling - RubyXL::Workbook — workbook construction, worksheet access, I/O - RubyXL::Parser — parsing .xlsx files from path or buffer Notable design decisions: - Cell#value returns String | Integer | Float | DateTime | nil. The implementation (num_to_date) returns DateTime, not Date. - manifest.yaml declares `date` stdlib dependency because rubyXL's gemspec does not list it, yet DateTime is used in the RBS. - Workbook#write is included as it is a documented public API (alias of save), even though it is defined via alias_method.
|
@RYOTA-KOBA Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|
Contributor
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds RBS type definitions for rubyXL 3.4, a gem for reading and writing Excel (.xlsx) files.
Defined classes
RubyXL::SheetDatarows,[],sizeRubyXL::Rowcells,[],sizeRubyXL::Cellchange_fill,change_font_bold, etc.)RubyXL::Worksheetsheet_data, cell creation (add_cell), row/column stylingRubyXL::Workbookstream,writeRubyXL::Parser.xlsxfrom file path or IO/String bufferDesign decisions
Cell#valuereturnsDateTime, notDateThe internal
num_to_datemethod adds toDateTime.new(1904, 1, 1)orDateTime.new(1899, 12, 31), so the return type is::DateTime, not::Date.manifest.yamldeclaresdatestdlib dependencyrubyXL's gemspec only lists
nokogiriandrubyzipas runtime dependencies.::DateTime(used inCell#value) lives in thedatestdlib, which must be declared explicitly inmanifest.yaml.Workbook#writeis includedDocumented in the README as a public API (
workbook.write("path/to/file.xlsx")). Implemented asalias_method :write, :savein the source.