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