adding of newlines to the output. For example, to make sure that ERB does not output newlines after tag ends, we can create the ERB object as shown below renderer = ERB.new(template, 3, '>') To only provide the third parameter and ignore the second parameter, use 0 as the input for second parameter. ERB has many other methods exposed which can be used to render a template. For full list of APIs exposed by the ERB object, refer to the ERB documentation given in the reference section. Running ERB from Command-line As it has been already explained in the previous sections, the erb is used to generate templates. This is often used to generate web pages or other text files. Usually needs erb to push the output to his or her desired file. To achieve this, we can use the redirection ability provided in the command-line and redirect the output to a file rather than making it print on the standard output. erb sample1.erb.txt > my_view.html.erbIn the above example, output gets redirected to my_view.html.erb file. Linking of third party libraries is achievable by making use of the -r option and providing the name of the library. To remember this functionality, one can remember the Ruby key word require, which does the same functionality as the -r option. The below example uses the IPAddr library. erb -r IPAddr sample1.txt.erb > my_view.html.erb As we have mentioned about the safety levels in the previous section, one can specify the safety level as a command line argument using the -S option erb -S 4 sample1.erb.txt > my_view.html.erb erubis erubis is an implementation of eRuby implemented in Ruby and also in Java. According to its home page, it runs faster than eRuby and ERb and has several useful options, including alternate tags allowing for valid XML. ember ember is a pure Ruby implementation of eRuby for Linux. It allows debugging of eRuby templates, improves their composability, and provides powerful shorthand eRuby directives. Different implementation tags comparison The below table compares the tags available in each of the above implementations See also mod_ruby Phusion Passenger (mod_rails) Haml RDoc Markaby References External links ERB Library "Ruby and the web", a chapter from "The Pragmatic Programmer's Guide" "web-mode.el", emacs major mode for editing eRuby templates ERB – Ruby Templating Template engines Ruby (programming language) Free computer libraries