--- title: Webgen::ContentProcessor::Erubis --- ## Description This processor uses the [Erubis][1] library to process embedded Ruby statements. Erubis is quite a bit faster than the standard ERB library that is shipped with Ruby and provides many other useful options. > This extension is only available if you have installed the [erubis][1] library. The preferred > way to do this is via Rubygems: > > gem install erubis {.warning} [1]: http://www.kuwata-lab.com/erubis/ "Erubis Homepage" You can use some special objects provided by webgen in your embedded Ruby code. These are the same objects that are available to the `erb` processor, have a look at its [documentation page]({relocatable: erb.html}). The default mode of Erubis works like ERB. So everyting said on the [erb page]({relocatable: erb.html}) is also true for Erubis. However, you can customize how this processor works by using the following configuration options: * `contentprocessor.erubis.use_pi`: Use processing instructions instead of ERB like instructions. Normally you use statements like `<%% result = some_method_call(opts) %>` or `<%%= context.content_node.absolute_lcn %>` in your content. When setting this option to `true`, you can use XML processing instructions instead, like this: `` or `@{context.content_node.absolute_lcn}@`. * `contentprocessor.erubis.options`: This is hash which is passed to the Erubis interpreter and which can be used to set additional options. For more information on the additional options or on how to use the processing instructions mode of Erubis, have a look at the [Erubis User Guide](http://www.kuwata-lab.com/erubis/users-guide.html)! You can also use block options to modify the behavior of Erubis. The block option `erubis_use_pi` is used instead of the configuration option `contentprocessor.erubis.use_pi` and all other block options starting with `erubis_` are added the options hash that is passed to the Erubis interpreter. For example, the following page tells the Erubis interpreter to use the processing instructions mode and to trim spaces: --- erubis_use_pi:true erubis_trim:true Here are the numbers from 1 to 5: @{i}@