Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix internal use of deprecated
Excelx::Cell.new
Calling `Excelx#set` internally called `Excelx::Cell.new`, which is deprecated in favor of `Excelx::Cell.create_cell`. I tried using the recommended `Excelx::Cell.create_cell`, however it expects a `type` as the first argument. `#set` tries to infer the type via [`cell_type_by_value`](https://github.com/roo-rb/roo/blob/709464c77623be2bc09b2103405d90ded7604a75/lib/roo/base.rb#L175-L182), however it only returns `:float` or `:string`, but `Excelx::Cell.cell_class` doesn't support `:float`. Even if I add `:float` to map to `Cell::Number`, then there's a dilemma because `Excelx::Cell.create_cell` passes all the arguments except the first onto the specific cell class, but the arity of `Cell::String` is 5 whereas the arity of `Cell::Number` is 6, meaning `Excelx#set` would need to initialize each cell class individually to pass the appropriate arguments. Therefore I landed on simply using `Cell::Base`. It's probably not the most accurate, but given persisting the spreadsheet isn't an option, the uses for `Excelx#set` should be minimal. In my case, I simply use it in testing to avoid creating new files for every possible scenario, opting to manually set various cells to triggered assorted scenarios. Fixes #529.
- Loading branch information