Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[ANN] polyglot 0.1.0 Released
Clifford Heath
10/24/2007 1:39:00 AM
Polyglot version 0.1.0 has been released!
* <
http://polyglot.rubyfor...
Allows custom language loaders for specified file extensions to be hooked into require.
For anyone who's ever needed to load non-Ruby file types, especially to implement
a fully-custom DSL (as opposed to a Ruby DSL), this gem allows you to simply require
the file-type handler, then require your file.
The file-type handler is a loader for files identified by your special filename extension.
It registers itself with polyglot, which aliases Kernel.require.
When you then require "myfile", polyglot will first attempt a normal Ruby 'require', and
if that fails, will search the Ruby load path for a filename matching any of the registered
extensions, and call the loader for that extension.
As an example, I'm building a query language called CQL. *.cql files can be loaded by a
parser which creates Ruby classes. All I have to do is:
require "cql"
require "myqueries"
and the CQL loader will load "myqueries.cql".
You might need to wait a few hours for the gem to populate into the mirrors.
Clifford Heath.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[ANN] polyglot 0.1.0 Released
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password