From: Makoto Kuwata Date: 2004-03-31T07:00:02+09:00 Subject: Re: [ANN] Kwartz (2004-03-19) released Andreas Schwarz wrote: > yes, that looks good, however I think it would be better to return the > expanded string instead of printing it. It is not able to return string if you are using eruby. (This is not due to Kwartz nor mkmethod script.) You can do it only with ERB. Compile: ==================== bash$ ./mkmethod -p hoge.plogic -M Hoge -l erb hoge.html > hoge.rb ==================== Main program: -------------------- args = { :user => 'World', :list => ['aaa', 'bbb', 'ccc] } require 'hoge' str = Hoge.expand_hoge(args) -------------------- > bash$ ./mkmethod -p hoge.plogic -M Hoge -l erb hoge.html > module Hoge > include ERB::Util > def self.expand_hoge(_args) > user = _args[:user] > list = _args[:list] > _erbout = ''; _erbout.concat "Hello "; _erbout.concat(( user ).to_s); _erbout.concat "!\n" > for item in list do > _erbout.concat "\n" > end > _erbout > end > end -- regards, kwa