=begin # elem_subs 指定した要素のテキストに対して正規表現による文字列置換を行う。 ## ダウンロード http://bmky.net/product/pragger/#elem_subs ## 使い方 title要素の空白文字を全て削除する - module: myplugin::RSS::elem_subs config: regex: "\s" to: "" element: title ## 更新履歴 2007/11/30 : リリース =end def elem_subs( config, data ) reg = Regexp.new( config["regex"] ) to = config["to"] element = config["element"] return data.each { |i| eval( "i." + element + ".gsub!( reg, to )" ) } end