summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-09 02:19:05 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-09 02:19:05 -0700
commitcc07150a5d5bac23890afc261ffe2ce837460dcf (patch)
tree76275c0119c39016bd39136bee48f487eecef08a
parentc3a2953198d3668df6b64f40b823603eb6c3fcb1 (diff)
downloadomptagger-cc07150a5d5bac23890afc261ffe2ce837460dcf.tar.gz
omptagger-cc07150a5d5bac23890afc261ffe2ce837460dcf.tar.xz
Use throw/catch statements.
-rwxr-xr-xomptagger12
1 files 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 + ':'