lib/import/pftrack.rb in tracksperanto-4.1.3 vs lib/import/pftrack.rb in tracksperanto-4.2.0
- old
+ new
@@ -17,25 +17,25 @@
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
INTS = /^\d+$/
- def each
+ def each(&blk)
until @io.eof?
line = @io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
name = unquote(line.strip)
report_progress("Reading tracker #{name}")
- parse_trackers(name, @io, &Proc.new)
+ parse_trackers(name, @io, &blk)
end
end
end
private
- def parse_trackers(name, io)
+ def parse_trackers(name, io, &blk)
first_tracker_line = io.gets.chomp
# We will be reading one line too many possibly, so we need to know
# where to return to in case we do
first_data_offset = io.pos
@@ -55,10 +55,10 @@
cur_pos = io.pos
next_line = io.gets
io.seek(cur_pos)
return if !next_line || next_line.strip.empty?
- parse_trackers(name, io, &Proc.new)
+ parse_trackers(name, io, &blk)
else
num_of_keyframes = first_tracker_line.to_i
# Backtrack to where we were on this IO so that the first line read will be the tracker
report_progress("Backtracking to the beginning of data block")
io.seek(first_data_offset)