您可以在清单 6中看到如何使用 jruby 从 java 调用 ruby。
使用 ERB 非常简单 :D
require 'erb'
# `binding` returns all variables declared in
# this scope, so they can be used in templates
#
ERB.new(File.read('file/path')).result(binding)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2250 次 |
| 最近记录: |