X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/b8498f5c67d736e9724e124e85aa36a58648afef..b9f550e97a60c4953fd1ae9374045110836764bd:/lib/lyricli/util.rb diff --git a/lib/lyricli/util.rb b/lib/lyricli/util.rb index 9ae9f6c..e7dcfc7 100644 --- a/lib/lyricli/util.rb +++ b/lib/lyricli/util.rb @@ -5,10 +5,16 @@ module Lyricli end def parse_class(class_name) - klass = Module.const_get(class_name) - return klass if klass.is_a?(Class) + begin + path = "Sources::#{class_name}" + return eval(path) rescue NameError - return nil + return nil + end + end + + def sanitize_param(p) + URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+") end end end