Skip to content

Instantly share code, notes, and snippets.

@jakenotjacob
Created January 21, 2014 05:27
Show Gist options
  • Save jakenotjacob/8534855 to your computer and use it in GitHub Desktop.
Save jakenotjacob/8534855 to your computer and use it in GitHub Desktop.
Testing block precedence in TagLib
require 'taglib'
arr = ["examples/toons/toki/wrongdirname/4. Cigarette Lust.mp3",
"examples/toons/toki/wrongdirname/wrongartistlocation/07 - Towers (Ft. Szjerdene).mp3",
"examples/toons/04-caspa-i_beat_my_robot-jah.mp3",
"TuneSort.rb"]
arr.each do |ele|
TagLib::FileRef.open ele { |e|
puts e
}
end
#=> NoMethodError: undefined method `ele' for main:Object
arr.each { |ele|
TagLib::FileRef.open ele do |e|
puts e
end
}
##<TagLib::FileRef:0x00000002ae9ed8>
##<TagLib::FileRef:0x00000002ae9de8>
##<TagLib::FileRef:0x00000002ae9cf8>
##<TagLib::FileRef:0x00000002ae9c08>
#=> ["examples/toons/toki/wrongdirname/4. Cigarette Lust.mp3",
# "examples/toons/toki/wrongdirname/wrongartistlocation/07 - Towers (Ft. Szjerdene).mp3",
# "examples/toons/04-caspa-i_beat_my_robot-jah.mp3",
# "TuneSort.rb"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment