X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/b8498f5c67d736e9724e124e85aa36a58648afef..ad84791b951f4ebdfae9c6bf0a54244a8b5c8f16:/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