From cc07150a5d5bac23890afc261ffe2ce837460dcf Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 9 Oct 2010 02:19:05 -0700 Subject: Use throw/catch statements. --- omptagger | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/omptagger b/omptagger index 7ec7c3a..56e48a9 100755 --- a/omptagger +++ b/omptagger @@ -40,7 +40,7 @@ class Metadata if @tags.empty? puts ' No tags set.' - return true + throw :next end end @@ -49,14 +49,14 @@ class Metadata unless @tags.has_key? tag puts ' Tag not set.' - return true + throw :next end end end class VorbisComment < Metadata def view - return if super + super @tags.sort.each do |tag, val| val.each do |val| @@ -66,7 +66,7 @@ class VorbisComment < Metadata end def viewtag(tag) - return if super + super @tags[tag].each do |val| output(tag, val) @@ -186,7 +186,9 @@ ARGV.each do |file| puts file + ':' actions.each do |action| - track.send(*action) + catch :next do + track.send(*action) + end end rescue RuntimeError => message $stderr.puts file + ':' -- cgit v1.2.3-70-g09d2