]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - lib/lyricli/util.rb
Add a README
[rbdr/lyricli.rb] / lib / lyricli / util.rb
index 9ae9f6c344f99c0b6766715b54319ed82a7d8f4c..e7dcfc776156ccb917efe460d2fac54713a1514d 100644 (file)
@@ -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