opnsense-ports/devel/rubygem-polyglot/pkg-descr
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

15 lines
663 B
Text

Polyglot provides a registry of file types that can be loaded by
calling its improved version of 'require'. Each file extension
that can be handled by a custom loader is registered by calling
Polyglot.register('ext', <class>), and then you can simply
require 'somefile', which will find and load 'somefile.ext'
using your custom loader.
This supports the creation of DSLs having a syntax that is most
appropriate to their purpose, instead of abusing the Ruby syntax.
Required files are attempted first using the normal Ruby loader,
and if that fails, Polyglot conducts a search for a file having
a supported extension.
WWW: https://github.com/cjheath/polyglot