lib/music_sanitizer/processor.rb in music_sanitizer-1.0.0 vs lib/music_sanitizer/processor.rb in music_sanitizer-1.0.1
- old
+ new
@@ -1,5 +1,7 @@
+require "yaml"
+
module MusicSanitizer
class Processor
IGNORE = YAML.load_file(File.join(MusicSanitizer.root, "lists/ignore.yml"))
EXCLUDE = YAML.load_file(File.join(MusicSanitizer.root, "lists/exclude.yml"))
@@ -37,9 +39,11 @@
/[\s]+/m,
/\_/
].each do |reg|
string = string.gsub(reg, " ").strip
end
+
+ return if string.empty?
# Split
# A ft. B => A
string = string.split(/ft\.\s+/i).first
# A + B => A
\ No newline at end of file