README.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. = README
  2. release:: 2.7.0
  3. copyright:: copyright(c) 2006-2011 kuwata-lab.com all rights reserved.
  4. == About Erubis
  5. Erubis is an implementation of eRuby. It has the following features.
  6. * Very fast, almost three times faster than ERB and even 10% faster than eruby
  7. * Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
  8. * Auto escaping support
  9. * Auto trimming spaces around '<% %>'
  10. * Embedded pattern changeable (default '<% %>')
  11. * Enable to handle Processing Instructions (PI) as embedded pattern (ex. '<?rb ... ?>')
  12. * Context object available and easy to combine eRuby template with YAML datafile
  13. * Print statement available
  14. * Easy to extend and customize in subclass
  15. * Ruby on Rails support
  16. Erubis is implemented in pure Ruby. It requires Ruby 1.8 or higher.
  17. Erubis now supports Ruby 1.9.
  18. See doc/users-guide.html for details.
  19. == Installation
  20. * If you have installed RubyGems, just type <tt>gem install erubis</tt>.
  21. $ sudo gem install erubis
  22. * Else install abstract[http://rubyforge.org/projects/abstract/] at first,
  23. and download erubis_X.X.X.tar.bz2 and install it by setup.rb.
  24. $ tar xjf abstract_X.X.X.tar.bz2
  25. $ cd abstract_X.X.X/
  26. $ sudo ruby setup.rb
  27. $ cd ..
  28. $ tar xjf erubis_X.X.X.tar.bz2
  29. $ cd erubis_X.X.X/
  30. $ sudo ruby setup.rb
  31. * (Optional) It is able to merge 'lib/**/*.rb' into 'bin/erubis' by
  32. 'contrib/inline-require' script.
  33. $ tar xjf erubis_X.X.X.tar.bz2
  34. $ cd erubis_X.X.X/
  35. $ cp /tmp/abstract_X.X.X/lib/abstract.rb lib
  36. $ unset RUBYLIB
  37. $ contrib/inline-require -I lib bin/erubis > contrib/erubis
  38. == Ruby on Rails Support
  39. Erubis supports Ruby on Rails.
  40. All you have to do is to add the following code into your 'config/environment.rb'
  41. and restart web server.
  42. require 'erubis/helpers/rails_helper'
  43. #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby
  44. #Erubis::Helpers::RailsHelper.init_properties = {}
  45. #Erubis::Helpers::RailsHelper.show_src = nil
  46. If Erubis::Helpers::RailsHelper.show_src is ture, Erubis prints converted Ruby code
  47. into log file ('log/development.log' or so). It is useful for debug.
  48. == Exploring Guide
  49. If you are exploring Eruby, see the following class at first.
  50. * Erubis::TinyEruby (erubis/tiny.rb) --
  51. the most simple eRuby implementation.
  52. * Erubis::Engine (erubis/engine.rb) --
  53. base class of Eruby, Ephp, Ejava, and so on.
  54. * Erubis::Eruby (erubis/engine/eruby.rb) --
  55. engine class for eRuby.
  56. * Erubis::Converter (erubis/converter.rb) --
  57. convert eRuby script into Ruby code.
  58. == Benchmark
  59. 'benchmark/erubybenchmark.rb' is a benchmark script of Erubis.
  60. Try 'ruby erubybenchmark.rb' in benchmark directory.
  61. == License
  62. MIT License
  63. == Author
  64. makoto kuwata <kwa(at)kuwata-lab.com>