diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-09 02:19:05 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-09 02:19:05 -0700 |
commit | cc07150a5d5bac23890afc261ffe2ce837460dcf (patch) | |
tree | 76275c0119c39016bd39136bee48f487eecef08a | |
parent | c3a2953198d3668df6b64f40b823603eb6c3fcb1 (diff) | |
download | omptagger-cc07150a5d5bac23890afc261ffe2ce837460dcf.tar.gz omptagger-cc07150a5d5bac23890afc261ffe2ce837460dcf.tar.xz |
Use throw/catch statements.
-rwxr-xr-x | omptagger | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 + ':' |