Photo

Working on the fastest Omaha eval ever %) (at What Matters? HQ)
1 note
·
View note
Text
Liquor. Before a new release.
Started working on Liquor (https://github.com/evilmartians/liquor) again. Hope the new version will be released soon.
What will be done for the new version:
It will be Rails 3.2 compatible.
Since Liquor can't work outside rails a servlet example will be removed.
Also I think it is useless to use Liquor as a Rails template engine, so LiquorView will be removed and using it as a Rails template engine officially will not be supported anymore. If you need it you can do it yourself or send us a pull request, even now it is very clear how to set up your own rails template engine.
Drops syntax will be reviewed and new features will be added.
There will be a few config options added: a default file extension and an ability to define a handling errors strategy, like in a production environment you may want to show only Liquor syntax errors (so the user level ones) and not show any other but report about them to Airbrake.
More tests.
And of course it will be distributed as a gem and we will use Travis CI to be sure that we always have a working version.
And of course bug fixes.
Also I'm working on a templates compilation but this have planned to be released after the stable Rails 3.2 compatible version.
This version will be released ASAP, we also need it in our commercial projects.
Let's talk now about new drops syntax and options.
Don't tell me that the way scopes and attributes were defined wasn't creepy... all that <<, oh! So now it will be more clear:
and
:if and :unless options will be added to the has_one and belongs_to relations.
if an :if option is passed then a relation will be called only if the option evaliates to true.
if an :unless option is passed then a relatopn will be called only if the optopn evaliates to false.
You can pass a method name which will be called on the drop's source object or it could be called on the relation's object if a :remote option is a true, which by default is false. So if your pass a method name and a :remote => true option then a relation object will be fetched, then a method will be called on it (if it is not nil) and if it evaluates to true (for :if and false for :unless) a drop of the object will be returned.
Also you can pass a Proc or any other object which has a call method.
Example:
5 notes
·
View notes