-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,33 +3,38 @@ mixItRuby | |
|
||
What is mixItRuby ? | ||
------------- | ||
Mix is a gem for mixing data with templatefiles. | ||
MixItRuby is a gem for mixing data (in form of a nested Hash) with templatefiles. | ||
|
||
Example Use Case | ||
---------------- | ||
You have to print bills for a list of items/products. | ||
What you do : | ||
Transform the data to a hash which lasts a specific form | ||
Run mix with a erb template. Viola the output is (depending on the template) | ||
ready to be formatted in latex of whatever. | ||
Transform the data to a hash which lasts a specific form | ||
Run mixit with an erb template. The output is (depending on the template) | ||
ready to be formatted in latex of whatever. | ||
|
||
|
||
Install | ||
------- | ||
gem install mixItRuby | ||
|
||
run (form commandline) | ||
run (from commandline) | ||
----------------------- | ||
mixit -i inputfile < -t templateDir -o outputfile > | ||
|
||
|
||
run withing a programm | ||
---------------------- | ||
|
||
require "mixer" | ||
mixer = MIX::Mixer.new | ||
mixer.mixItRuby(inputdata_hash) | ||
mixer.writeResult2File(outputfile) | ||
|
||
|
||
current project status | ||
---------------------- | ||
Work in progress just started | ||
Work in progress just started | ||
|
||
|
||
You want to contributes ? | ||
|
@@ -42,7 +47,7 @@ Contact [email protected] | |
Structure of the data | ||
===================== | ||
|
||
json Format recursive, selfcontained. | ||
json, recursive, selfcontained. | ||
|
||
recursive : substructures possible (nodes) | ||
selfcontained : The name of the erb (id, for DB or File or whatever) is within the data | ||
|
@@ -57,7 +62,7 @@ Here an example: | |
] | ||
} | ||
|
||
A building block consists of an id and other key value pair. | ||
A building block consists of an id and other key value pairs. | ||
|
||
id: is a must. It represents the identifier under which the template is accesible. | ||
At the moment it is a filename. The other attributes on the same level, which are no array or hash are | ||
|
@@ -69,13 +74,14 @@ Then an array follow. An Array must be build of hashes, which can have subarrays | |
|
||
What is mixItRuby needed for ? | ||
============================== | ||
With that little gem you can build up personalized letters or emails or html pages. | ||
With that little gem you can build up personalized letters or emails or html pages, with nested data. | ||
Just imagine the erb file are tex files or xml-fo or html files or they are files with are ruby file again, which produce some output. | ||
|
||
Another possibility is create other json files. Imagine the template erbs are templates for json. Then for example in SOA business objects can be chained and enriched from services. | ||
|
||
There are a lot of posibilities. | ||
|
||
Post some it would be nice to hear what is possible. | ||
|
||
|
||
|
||
|
||
|