Ruby Macro
This is a XWiki macro, which isn't bundled with any XWiki product by default.
Macro developed by the XWiki Development Team.
This macro can be downloaded.
Macro developed by the XWiki Development Team.
This macro can be downloaded.
Ruby Macro
This is a shortcut for Script Macro equivalent to {{script language="ruby"}} for executing ruby scripts.Installation
To use ruby macro, you need to install following three libraries inside WEB-INF/lib directory of your XE installation: Once these libraries are in place, you need to restart your XE installation for the changes to take effect.Usage
{{ruby}}
require 'java'
include_class 'java.util.TreeSet'
set = TreeSet.new
set.add "foo"
set.add "Bar"
set.add "baz"
set.each do |v|
puts "value: #{v}"
end
{{/ruby}}Parameters definition
See the Script Macro for details.Example
{{ruby}}
if $xcontext.getUser() != "XWiki.XWikiGuest" then
puts "Hello #{$xwiki.getUser().getEmail()}!"
else
puts "You are not logged in!"
end
{{/ruby}}