diff --git a/Gemfile b/Gemfile index cd20a60..c7070d4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" group :extra do - gem "debugger", :platform => [:ruby_19, :ruby_20] + gem "debugger" end gem "rake" diff --git a/README.md b/README.md index f7b7f6d..6124397 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ Currently alexa will not work with `ox` gem * [rmoriz](https://github.com/rmoriz) * [jasongill](https://github.com/jasongill) +* [sporkmonger](https://github.com/sporkmonger) ## Continuous Integration diff --git a/alexa.gemspec b/alexa.gemspec index a683bda..4124672 100644 --- a/alexa.gemspec +++ b/alexa.gemspec @@ -16,12 +16,12 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.version = Alexa::VERSION + gem.required_ruby_version = ">= 1.9.3" + gem.add_dependency "multi_xml", ">= 0.5.0" gem.add_dependency "faraday", "~> 0.8" gem.add_development_dependency "minitest", ">= 5.0.0" gem.add_development_dependency "mocha" gem.add_development_dependency "webmock" - - gem.post_install_message = "Version 0.6.0 of alexa gem will require Ruby 1.9.3 or greater. If you still need 1.8.7 freeze gem version to ~> 0.5.1" end diff --git a/lib/alexa/api/category_browse.rb b/lib/alexa/api/category_browse.rb index 5ac828e..9858bf0 100644 --- a/lib/alexa/api/category_browse.rb +++ b/lib/alexa/api/category_browse.rb @@ -17,7 +17,6 @@ def fetch(arguments = {}) end # Response attributes - def categories @categories ||= safe_retrieve(parsed_body, "CategoryBrowseResponse", "Response", "CategoryBrowseResult", "Alexa", "CategoryBrowse", "Categories", "Category") end diff --git a/lib/alexa/connection.rb b/lib/alexa/connection.rb index f8a5b8c..6457174 100644 --- a/lib/alexa/connection.rb +++ b/lib/alexa/connection.rb @@ -21,7 +21,7 @@ def params def get(params = {}) self.params = params - encode handle_response(request).body + handle_response(request).body.force_encoding(Encoding::UTF_8) end def handle_response(response) @@ -74,13 +74,5 @@ def sign def query default_params.merge(params).map { |key, value| "#{key}=#{CGI::escape(value.to_s)}" }.sort.join("&") end - - def encode(string) - if "muflon".respond_to?(:force_encoding) - string.force_encoding(Encoding::UTF_8) - else - string - end - end end end