An open API service providing repository metadata for many open source software ecosystems.

Package Usage: rubygems: sysexits

Have you ever wanted to call <code>exit()</code> with an error condition, but weren't sure what exit status to use? No? Maybe it's just me, then. Anyway, I was reading manpages late one evening before retiring to bed in my palatial estate in rural Oregon, and I stumbled across <code>sysexits(3)</code>. Much to my chagrin, I couldn't find a +sysexits+ for Ruby! Well, for the other 2 people that actually care about <code>style(9)</code> as it applies to Ruby code, now there is one! Sysexits is a *completely* *awesome* collection of human-readable constants for the standard (BSDish) exit codes, used as arguments to +exit+ to indicate a specific error condition to the parent process. It's so fantastically fabulous that you'll want to fork it right away to avoid being thought of as that guy that's still using Webrick for his blog. I mean, <code>exit(1)</code> is so passé! This is like the 14-point font of Systems Programming. Like the C header file from which this was derived (I mean forked, naturally), error numbers begin at <code>Sysexits::EX__BASE</code> (which is way more cool than plain old +64+) to reduce the possibility of clashing with other exit statuses that other programs may already return. The codes are available in two forms: as constants which can be imported into your own namespace via <code>include Sysexits</code>, or as <code>Sysexits::STATUS_CODES</code>, a Hash keyed by Symbols derived from the constant names. Allow me to demonstrate. First, the old way: exit( 69 ) Whaaa...? Is that a euphemism? What's going on? See how unattractive and... well, 1970 that is? We're not changing vaccuum tubes here, people, we're <em>building a totally-awesome future in the Cloud™!</em> include Sysexits exit EX_UNAVAILABLE Okay, at least this is readable to people who have used <code>fork()</code> more than twice, but you could do so much better! include Sysexits exit :unavailable Holy Toledo! It's like we're writing Ruby, but our own made-up dialect in which variable++ is possible! Well, okay, it's not quite that cool. But it does look more Rubyish. And no monkeys were patched in the filming of this episode! All the simpletons still exiting with icky _numbers_ can still continue blithely along, none the wiser.
5 versions
Latest release: almost 11 years ago
16 dependent packages
33,471,673 downloads total

View more package details: https://packages.ecosystem.code.gouv.fr/registries/rubygems.org/packages/sysexits

Dependent Repos 8

Projets-INFO4/19-20/20/nixpkgs_swh

Last synced: 9 months ago - Pushed: about 1 year ago

betagouv/boussole
Accède au conseil qualifié d'un·e professionnel·le, près de chez toi, pour t'aider dans tes projets de formation, de logement, d'activité et de santé

Size: 2.17 MB - Last synced: 7 days ago - Pushed: almost 8 years ago

betagouv/dsfr-view-components
Composants Rails pour le DSFR

Size: 4.35 MB - Last synced: 7 days ago - Pushed: 18 days ago

demarches-simplifiees/demarches-simplifiees.fr
Dématérialiser et simplifier les démarches administratives

Size: 75.1 MB - Last synced: 2 days ago - Pushed: 2 days ago

sipf/tps Fork of govpf/mes-demarches
Dématérialiser et simplifier les démarches administratives

Size: 24.5 MB - Last synced: 8 days ago - Pushed: over 6 years ago

betagouv/conseillers-entreprises
Le service d’accompagnement des entreprises

Size: 72.8 MB - Last synced: 7 days ago - Pushed: 9 days ago

EOLE/eole-3/services/mastodon/mastodon-sources
Code source for Mastodon

Last synced: about 2 months ago

SocialGouv/tps Fork of demarches-simplifiees/demarches-simplifiees.fr
demarches-simplifiees.fr

Size: 19.8 MB - Last synced: 7 days ago - Pushed: about 1 year ago