detroit-erbside
- render inline source code templates
The DNote plug-in for Detroit utilize the Erbside command line tool to render inline templates in source code files.
The following options can be used in the Detroit toolchain file for defining an Erbside tool.
path
- File paths to render. Default is lib
.
exclude
- Exclude subpaths of path
.
ignore
- Ignore subpaths of path
based on basename of path.
resource
- Resource file(s) to gather metadata from.
prompt
- Prompt before writing each file.
A common use by the author of this plugin is for insertion of version
number into source code. Say we have the file, lib/myapp/version.rb
.
module MyApp
VERSION = "1.0.0" #:erb: VERSION = "<%= version %>"
end
Then in the toolchain file:
erbside:
path: lib/myapp/version.rb
resource: .index
Of course, by default the path is lib
and the resource is .index
if present. So a simple:
erbside:
active: true
Will likely do the trick.
For more information:
Copyright (c) 2011 Thomas Sawyer, Rubyworks
Detroit Erbside is distributable in accordance with the GPLv3 license.
detroit(1), erbside(1)