lib/import/nuke_script.rb in tracksperanto-1.9.8 vs lib/import/nuke_script.rb in tracksperanto-1.9.9

- old
+ new

@@ -8,26 +8,25 @@ def self.distinct_file_ext ".nk" end - def parse(io) - scan_for_tracker3_nodes(Tracksperanto::ExtIO.new(io)) + def stream_parse(in_io) + io = Tracksperanto::ExtIO.new(in_io) + while line = io.gets_and_strip + if line =~ TRACKER_3_PATTERN + scan_tracker_node(io).each { |t| send_tracker(t) } + end + end + end private TRACKER_3_PATTERN = /^Tracker3 \{/ TRACK_PATTERN = /^track(\d) \{/ NODENAME = /^name ([^\n]+)/ - def scan_for_tracker3_nodes(io) - tracks = [] - while line = io.gets_and_strip - tracks += scan_tracker_node(io) if line =~ TRACKER_3_PATTERN - end - tracks - end def scan_tracker_node(io) tracks_in_tracker = [] while line = io.gets_and_strip if line =~ TRACK_PATTERN \ No newline at end of file