Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4085

Threading Loops

From "Bobby S." <kajisakka@gmail.com>
Newsgroups comp.lang.ruby
Subject Threading Loops
Date 2011-05-07 18:20 -0500
Organization Service de news de lacave.net
Message-ID <670f5be69524ccbfc188e9062e65f645@ruby-forum.com> (permalink)

Show all headers | View raw


I understood how to thread functions, but I don't understand how to
implement it outside of that. I am trying to make a picture re-namer and
I want to thread the renaming part to speed it up.


pic_names = Dir["{E://**/*.{JPG, jpg}"]
pic_numb = 1;
batch_name = "test"

#Want to thread this part.
pic_names.each do |name|
  print ' . '
  new_name = batch_name + pic_numb.to_s + ' .jpg'
  File.rename name, new_name
  pic_numb += 1
end

Thanks in advance.

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

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 18:20 -0500
  Re: Threading Loops Roy Zuo <roylzuo@gmail.com> - 2011-05-07 18:42 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 19:03 -0500
    Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 21:54 -0500
      Re: Threading Loops Robert Klemme <shortcutter@googlemail.com> - 2011-05-08 12:53 +0200
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 20:04 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 20:48 -0500
    Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 21:16 -0500
      Re: Threading Loops Robert Klemme <shortcutter@googlemail.com> - 2011-05-08 12:56 +0200
  Re: Threading Loops 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-07 20:56 -0500
    Re: Threading Loops Christopher Dicely <cmdicely@gmail.com> - 2011-05-07 22:36 -0500
  Re: Threading Loops Kevin Bullock <kbullock+rubyforum@ringworld.org> - 2011-05-07 21:27 -0500
  Re: Threading Loops "Bobby S." <kajisakka@gmail.com> - 2011-05-07 22:12 -0500
  Re: Threading Loops Brian Candler <b.candler@pobox.com> - 2011-05-08 09:07 -0500

csiph-web