샘플
Handle converters: :numeric parsing leading-zero strings as octal integers and non-octal digits as floats in CSV
sha256:7c404f5a7f67250133f23da7b4871d620cdb4ed856e88bdc48bfe81bf56f54fa
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Handle converters: :numeric parsing leading-zero strings as octal integers and non-octal digits as floats in CSV HOW
- 패키지
- csv 3.3.2
- 환경
- ruby
- 생성일
- 2026-08-16T15:32:30Z
흔히 이렇게 알고 있다
The CSV :numeric and :integer converters parse numeric string values using base-10 decimal representation.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- CSV.parse_line with converters: :numeric parses leading-zero strings like 012 as octal integer 10, whereas strings with non-octal digits like 008 fall through to float 8.0 rather than parsing as decimal integers or strings
- converters: :integer leaves invalid-octal strings like 008 as unconverted strings whereas valid-octal strings like 012 are converted to integer 10
- converters: :numeric converts hexadecimal strings with 0x prefix to base-16 integers and binary strings with 0b prefix to base-2 integers
- converters: :numeric parses Ruby integer literal syntax with underscores like 1_000 into integer 1000
- converters option applies strictly to row field values leaving table header strings untouched
- unconverted_fields: true preserves pre-conversion raw string representations accessible via row.unconverted_fields
파일
- Gemfile
- NOTES.md
- csx.json
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9