2
0

Use rake instead of guard for erb compilation

This commit is contained in:
Jack Christensen
2013-05-03 13:51:10 -05:00
parent 3fef18bf38
commit ec460173eb
9 changed files with 24 additions and 59 deletions
+4 -5
View File
@@ -14,17 +14,16 @@ Development
ERB Templating
--------------
Sometimes Go code can be repetitive especially with dealing with functions that only differ in the type (e.g. ReadInt16, ReadInt32, ReadInt64). Some of this repetition can be eliminated by using a template preprocessor. pgx uses Ruby erb templates. Files that end in .go.erb are used to produce the corresponding .go files. These files can be automatically processed with guard -- a Ruby file and directory watcher.
Sometimes Go code can be repetitive especially with dealing with functions that only differ in the type (e.g. ReadInt16, ReadInt32, ReadInt64). Some of this repetition can be eliminated by using a template preprocessor. pgx uses Ruby erb templates. Files that end in .go.erb are used to produce the corresponding .go files. These files are automatically automatically processed with [rake](https://github.com/jimweirich/rake).
Prerequisites:
* Ruby
* guard
* guard-tilt
* Rake
To automatically process .go.erb files open a shell in the pgx directory and run:
To automatically process .go.erb files and run the tests:
jack@hk-47~/dev/pgx$ guard
jack@hk-47~/dev/pgx$ rake test
Testing
-------