CodeSampleX

Ejemplo

csv 3.3.2: Handle numeric octal versus float bifurcation, single nil row truncation, and date-time type coercion across CSV serialization and parsing round trips

Muestra verificada para gem csv 3.3.2: Handle numeric octal versus float bifurcation, single nil row truncation, and date-time type coercion across CSV…

sha256:fd8cc5b68025f317dc1fd1a73f3b93f524eabbdbe8042318706daa5eccc80012

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
1
Entorno declarado ruby linux x64 ruby ruby rubygems

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
ruby 3 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

Caso

HOW
Objetivo
Handle numeric octal versus float bifurcation, single nil row truncation, and date-time type coercion across CSV serialization and parsing round trips
Paquetes
Símbolos
  • CSV.parse_line
  • CSV.generate_line
  • CSV::Converters
Entorno
ruby
Creado
2026-08-16T15:31:05Z

Contrato

  1. CSV.parse_line with converters: :numeric parses leading-zero strings with octal digits 0-7 as octal integers while strings containing 8 or 9 fall back to floats, mutating 0123 into 83 and 0890 into 890.0 across a round trip
  2. assert CSV.parse_line with converters: :numeric coerces hex and binary string literals into decimal integers
  3. assert CSV.generate_line with a single nil element emits an empty line that CSV.parse_line reads as an empty array of length zero
  4. assert CSV.parse_line with converters: :all converts Date strings into DateTime instances and leaves Time strings as unparsed String objects
  5. assert CSV.parse_line with unconverted_fields: true retains the original string representations on the unconverted_fields attribute

Archivos

  • Gemfile
  • NOTES.md
  • csx.json
  • test/contract.rb

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed