Boris Schulz wrote:
> Hi,
> 
> I often read something about code being "rubystyle" though I am not
> exactly sure what it means. Maybe someone can help me out and put the
> couple of lines below into a typical ruby style?
> ...
> entrys.each{|node|
>      file = node.elements["LOCATION"].attributes["DIR"] +
> node.elements["LOCATION"].attributes["FILE"]
>      if File.exists?(file)
>          tag = Tag.new(file)
>          if !node.attributes["ARTIST"]
>              node.add_element "ARTIST"
>          end
>          node.attributes["ARTIST"] = tag.artist
>      end
> }
>      out = File.new("test.xml", "w+")
>      doc.write out

Hi Boris,
Main thing would be to replace the entrys.each { } construct with
entrys.each do |node|
   stuff in here
end

Multi-line {} blocks are legal but not the "expected" way.  The rest of 
it looks ok to me.

jp

-- 
Posted via http://www.ruby-forum.com/.