Permalink
Browse files

Merge pull request #9 from sosedoff/master

Added JSON to runtime requirements and added timeouts to the requests
  • Loading branch information...
2 parents 9a9d02e + a7c4f09 commit f9f056aadba49b6056af191afc63b382736a68e1 @dewski committed Apr 18, 2012
Showing with 8 additions and 1 deletion.
  1. +2 −1 itunes.gemspec
  2. +6 −0 lib/itunes/request.rb
View
@@ -26,11 +26,12 @@ Gem::Specification.new do |s|
s.add_development_dependency('simplecov', '~> 0.4.2')
s.add_development_dependency('webmock', '~> 1.7')
s.add_development_dependency('vcr', '~> 1.11')
+ s.add_development_dependency('json', '~> 1.6')
s.add_runtime_dependency('rash', '~> 0.3')
s.add_runtime_dependency('faraday_middleware', '~> 0.7')
s.add_runtime_dependency('multi_json', '~> 1.0')
-
+
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
View
@@ -1,5 +1,10 @@
module ITunes
module Request
+ REQUEST_OPTIONS = {
+ :timeout => 5,
+ :open_timeout => 5
+ }
+
# @private
private
@@ -9,6 +14,7 @@ def request(request_type, params)
response = connection.get do |req|
req.url url, params
+ req.options = REQUEST_OPTIONS
end
response.body
end

0 comments on commit f9f056a

Please sign in to comment.