On Sat, Feb 23, 2013 at 4:23 AM, Henrik N <
hen...@nyh.se> wrote:
> We've evolved a mini-framework on top of Prawn in Rails to get a split into
> documents, templates and helpers:
https://github.com/barsoom/prawn_cocktail
>
> It's certainly not perfect but I find it helps maintainability to have some
> structure, as opposed to just putting it all in one big file.
This is awesome. I do have a lot of Prawn code out there that has
evolved "PHP 4 style", as you say, and this is definitely an
improvement.
My main architectural comment about this project is that it feels like
you have two orthogonal concerns coupled together:
1. A handy DSL for structuring data-driven PDFs;
2. Rails integration to simplify the common cases of web PDF rendering.
I think there are valid use cases for using either of the two
separately. Personally, I have a lot of non-Rails Ruby projects using
Prawn that would benefit by building on top of #1. And #2 would
provide a small stepping stone for eliminating boilerplate from
existing Rails projects without necessarily needing to rebuild views
the "PrawnCocktail way" at first. So I think if they could be
decoupled into two separate projects, it would be a net benefit.
It's always interesting to see what people are doing with Prawn, and
to start to develop some vocabulary and patterns for common Prawn use
cases. Thanks!
-be