2008-09-29

Blogging while Sourceforge is down

I've uploaded Novelang-0.11.0.zip on Sourceforge but I'm stuck while their shell service is down — it's what I'm using to upload and unzip the Novelang website. So I'm refraining myself to advertise this new version is available, while it wouldn't appear on documentation available online. This release is not a shiny one: I just cleaned up some mess and added some tests. But now, both daemon and still-undocumented batch tool read command-line parameters the same way. These parameters follow the "--option=value" form. They supercede system properties that are no less than crappy global variables making automated tests hard to write. System properties also make troubleshooting more difficult, as badly-spelled system property fails silently. With the help of a command-line argument parsing tool, an unsupported options raises an exception at program startup, on a fail-fast basis. In order to make resulting configuration more understandable, the log shows how the value was set:
INFO  n.c.ConfigurationTools - Recognized user-defined 
  directory '/.../Novelang/samples/hyphenation' 
  (from option: --hyphenation-dir, Directory containing 
  hyphenation files).
INFO  n.configuration.ConfigurationTools - Creating 
  DaemonConfiguration from default value [8080] 
  (option not set: --port, TCP port for daemon).
A big temptation during this refactoring was to add new features. One frustrating moment was the handling of multiple font directories because of greater ambitions. But finally I managed to keep this development round short, the code got better, and having just one default /fonts directory works well in many cases. I've thought about a few potentially useful options:
  • --serve-shutdown (daemon only): by now this HTTP request shuts the daemon down: /~shutdown.html. This should be disabled by default, and enabled only with --serve-shutdown option.
  • --serve-remote (daemon only): by now any remote computer may access to the daemon (unless there is some firewall preventing it). The default behavior should be to restrict access to localhost, unless explicitely stated otherwise.
  • --flatten-output (batch only): by now the batch tool renders documents with the same path as source documents. This may cause annoying tricks to get generated files.
  • --sources-dir (batch and daemon): the directory to resolve document sources from.

No comments: