]> git.r.bdr.sh - rbdr/lyricli.rb/blob - lib/lyricli/util.rb
Basic Version Working
[rbdr/lyricli.rb] / lib / lyricli / util.rb
1 module Lyricli
2 module Util
3 def camelize(str)
4 str.split('_').map {|w| w.capitalize}.join
5 end
6
7 def parse_class(class_name)
8 begin
9 path = "Sources::#{class_name}"
10 return eval(path)
11 rescue NameError
12 return nil
13 end
14 end
15
16 def sanitize_param(p)
17 URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+")
18 end
19 end
20 end