Change 14644

jmistry
jmistry committed this change into //guest/perforce_software/p4ruby/main
Request Review
Download .zip
Generic each_* methods

Simple method to iterate over a particular type of spec
This is a convenient wrapper for the pattern:
    clients = p4.run_clients
    clients.each do
    |c|
        client = p4.fetch_client( c['client'] )
        <do something with spec>
    end

NOTE:    It's not possible to implicitly pass a block to a
delegate method, so I've implemented it here directly.  Could use
Proc.new.call, but it looks like there is a serious performance
impact with that method.

job056520 : spec iterator implementation
  • Files 2
  • Comments 0
1 edited 1 added 0 deleted
lib/P4.rb#18
Loading...
test/19_spec_iterator.rb#1
Loading...
Tip: Use n and p to cycle through the changes.