]> git.r.bdr.sh - rbdr/lyricli.rb/commitdiff
Fixes stuff for ruby 1.8 support
authorBen Beltran <redacted>
Sat, 6 Oct 2012 16:56:32 +0000 (11:56 -0500)
committerBen Beltran <redacted>
Sat, 6 Oct 2012 16:56:32 +0000 (11:56 -0500)
NOTE: Rdio doesn't work in 1.8 :(

lib/lyricli.rb
lib/lyricli/sources/arguments.rb
lib/lyricli/sources/itunes.rb
lib/lyricli/sources/rdio.rb
lib/lyricli/util.rb
lyricli-0.0.1.gem

index 82871441325c2a6aff7c44e967c2ca8e3a6cc0f2..31571c8b8ce034047c0b12f42a797f6406994fa0 100755 (executable)
@@ -1,4 +1,5 @@
 require 'uri'
 require 'uri'
+require 'cgi'
 require 'net/http'
 require 'multi_json'
 require 'nokogiri'
 require 'net/http'
 require 'multi_json'
 require 'nokogiri'
index 150c70a4adc4466f8cb996a381a7f2e298f57a17..e35aaec6472fabf8379442d02264601f5c177b8e 100644 (file)
@@ -27,7 +27,7 @@ module Lyricli
       def current_track
         artist = ARGV[0]
         song = ARGV[1]
       def current_track
         artist = ARGV[0]
         song = ARGV[1]
-        {artist: artist, song: song}
+        {:artist => artist, :song => song}
       end
 
       # The reset method resets any configurations it may have
       end
 
       # The reset method resets any configurations it may have
index 2bfe471f1c3e3ec291f9e29a35998b0f10e31f86..e9a3f4938c6f74f84c808a75b83aca0a90c97e04 100644 (file)
@@ -29,7 +29,7 @@ module Lyricli
         path = File.join(path_root, @script)
         current = `osascript #{path}`
         current = current.split("<-SEP->")
         path = File.join(path_root, @script)
         current = `osascript #{path}`
         current = current.split("<-SEP->")
-        {artist: current[0], song: current[1]}
+        {:artist => current[0], :song => current[1]}
       end
 
       # The reset method resets any configurations it may have
       end
 
       # The reset method resets any configurations it may have
index d34795f512876d04b9c92641a7228f7278cb4c70..76d0ed1fa60eef15b4150ce1fa0837c38e7670a4 100644 (file)
@@ -40,7 +40,7 @@ module Lyricli
         response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'})
         artist = response["result"]["lastSongPlayed"]["artist"]
         song = response["result"]["lastSongPlayed"]["name"]
         response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'})
         artist = response["result"]["lastSongPlayed"]["artist"]
         song = response["result"]["lastSongPlayed"]["name"]
-        {artist: artist, song: song}
+        {:artist => artist, :song => song}
       end
 
       # The reset method resets any configurations it may have
       end
 
       # The reset method resets any configurations it may have
index e7320d0d761f6be4e49b68699d2097a1177b240b..b8b0186638970378f65f356d5c2dc8ac3933df59 100644 (file)
@@ -30,7 +30,7 @@ module Lyricli
     # @param [String] p the parameter to be sanitized
     # @return [String] the sanitized parameter
     def sanitize_param(p)
     # @param [String] p the parameter to be sanitized
     # @return [String] the sanitized parameter
     def sanitize_param(p)
-      URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+")
+      CGI.escape(p.gsub(/ /, "+")).gsub("%2B", "+")
     end
   end
 end
     end
   end
 end
index f37ca3777ebbb1d0040a2e439eb205dde98403fa..3dc9459202107e6d5cf4ce1305449fd5b08a4165 100644 (file)
Binary files a/lyricli-0.0.1.gem and b/lyricli-0.0.1.gem differ