From: Robert Klemme Date: 2011-11-06T21:08:44+09:00 Subject: Re: need spome help please :) On Sun, Nov 6, 2011 at 9:09 AM, marcin k. wrote: > well its only pice of the code .. everything is called before or after. > > The problem is > > i have 12 photos and i want to be able to select them in browse window > and than i want program to rename it according to specific rules where > we have 2 changables and are difined by user everytime when the > application starts > > where 1st one is PSD number and second it cityname > > so first 9 photos should looks like this > > xxx,xxxxxxxxxxxxxxx xxxxxxxxxxxx PSD , changable> > > and last 3 photosh should looks like this > > xxx, xxxxxxxxxxxxxx xxxxxxxxxxx PSD po migracji , > I am not sure I understand what you are trying to achieve. I do notice though a highly repetitive structure of your code which means you should be able to refactor a lot of this into much smaller code base with clearer structure. For example, you have sets of global variables (generally a bad idea btw.) which follow common naming conventions and are treated similarly. In that case it's better to have collections (either Hash or Array) store the stuff and manipulate it there. The code might also benefit from some class definitions of your own. Also not everybody here is able to read Polish. So it would be easier for us to help if you change the commenting and variable and method naming to English. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/