X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/b8498f5c67d736e9724e124e85aa36a58648afef..1be0eee39d325c1a180dbf992bc6fd256f828008:/lib/lyricli/util.rb?ds=inline 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