<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby/test/cepis_test.rb, branch v0.2.0</title>
<subtitle>Ruby client for the public CEP API
</subtitle>
<id>http://git.cep.is/ruby/atom?h=v0.2.0</id>
<link rel='self' href='http://git.cep.is/ruby/atom?h=v0.2.0'/>
<link rel='alternate' type='text/html' href='http://git.cep.is/ruby/'/>
<updated>2026-07-27T23:32:01Z</updated>
<entry>
<title>Expose the band of a CEP that does not exist</title>
<updated>2026-07-27T23:32:01Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-27T23:32:01Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/ruby/commit/?id=b402de683eecef4c890081dd72edbcaf57f375e0'/>
<id>urn:sha1:b402de683eecef4c890081dd72edbcaf57f375e0</id>
<content type='text'>
A CEP that fails a lookup is rarely a random number: it is someone who
knows the city and guessed the digits, most often the -000 that 957
municipalities never received. The API now answers that 404 with an
optional faixa naming the municipality those numbers belong to, so the
caller can say "not found, but you seem to be looking at Areal/RJ"
instead of just "not found".

It stays an error. Faixa hangs off CEPNotFound and nothing about it
promotes a nonexistent CEP into an address. Its cep_ini/cep_fim are the
smallest and largest CEP that really exist there, not the published
bounds — the DNE's own start for Areal is the CEP that just failed — and
the band is sparse, which is what ceps is for; both facts are spelled
out in the docs so nobody iterates the pair.

Parsing is deliberately toothless: a missing, empty or malformed faixa,
or a 404 body that is not JSON at all, all yield nil. Losing the
consolation prize must never replace a clean not-found with a parse
failure.
</content>
</entry>
<entry>
<title>Initial import</title>
<updated>2026-07-26T15:32:15Z</updated>
<author>
<name>Murilo Ijanc</name>
<email>murilo@ijanc.org</email>
</author>
<published>2026-07-26T15:32:15Z</published>
<link rel='alternate' type='text/html' href='http://git.cep.is/ruby/commit/?id=36a0ddb01a4fcb8fb2fefd7c407ecca0e3e56e7c'/>
<id>urn:sha1:36a0ddb01a4fcb8fb2fefd7c407ecca0e3e56e7c</id>
<content type='text'>
</content>
</entry>
</feed>
