simple-http 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45910b0d50187f5fcfb6ada7bd0b93718b2d9a74
4
- data.tar.gz: a3daf4073ade9170518cd3528f7fc60098626118
3
+ metadata.gz: 3711a46073b07c99d04ff55ed6cd0c1cc44f68f4
4
+ data.tar.gz: 79522eb93745b870aa0eb41ea28b917cbfdf7a53
5
5
  SHA512:
6
- metadata.gz: 83c053ef9e4d81b888cc545a4b074f4eedb7ee5ddebf3879a951cabcde0719b06fe5d195f527edbe41b0384715660c6fe70e2c539c5a5219141d84f75cfea316
7
- data.tar.gz: fdaeffe33eec00750bb1849de6affc72d462ce2a10c21fe811b926315a687d303cef8af56f2edd582d6b444719dbea1eb5f0c0dca5f8c0f0f0fd5e33c6726a43
6
+ metadata.gz: 638367ce95b61893708d7bd7ccdca66b9e90fbc8aa450dbbf0b1a1c6abcaf2fe3e78630fd5312e816a464c516772cf98ccf8408c03dc5b0068033230533b4471
7
+ data.tar.gz: 0713b7e593474e39825f84dab3d854460945d4cf4d2f3fec527c7bdc6c47248290f021eba8e8dc139ea32c19e446ef7a1e8c309ee0c10c2c39a8342ef7b60b06
@@ -5,5 +5,5 @@
5
5
 
6
6
  module Simple; end
7
7
  class Simple::HTTP
8
- VERSION = "0.1.3"
8
+ VERSION = "0.1.4"
9
9
  end
data/lib/simple/http.rb CHANGED
@@ -97,7 +97,7 @@ class Simple::HTTP
97
97
  # raise an error.
98
98
  def http_(method, url, body, headers, max_redirections = 10)
99
99
  if method == :GET && cache && result = cache.read(url)
100
- logger.debug "#{method} #{uri}: using cached result"
100
+ logger.debug "#{method} #{url}: using cached result"
101
101
  return result
102
102
  end
103
103
 
@@ -120,7 +120,7 @@ class Simple::HTTP
120
120
  # execute request
121
121
  started_at = Time.now
122
122
  response = http.request(request)
123
- logger.info "#{method} #{uri}: #{response.body.bytesize} byte, #{"%.3f secs" % (Time.now - started_at)}"
123
+ logger.info "#{method} #{url}: #{response.body.bytesize} byte, #{"%.3f secs" % (Time.now - started_at)}"
124
124
 
125
125
  #
126
126
  # Most of the times Net::HTTP#request returns a response with the :uri
@@ -134,9 +134,9 @@ class Simple::HTTP
134
134
  result = response.result
135
135
  if cache && method == :GET && expires_in = self.expires_in(response)
136
136
  if response.expires_in == expires_in
137
- logger.debug "#{method} #{uri}: store in cache, w/expiration of #{expires_in}"
137
+ logger.debug "#{method} #{url}: store in cache, w/expiration of #{expires_in}"
138
138
  else
139
- logger.debug "#{method} #{uri}: store in cache, w/custom expiration of #{expires_in} (instead #{response.expires_in.inspect})"
139
+ logger.debug "#{method} #{url}: store in cache, w/custom expiration of #{expires_in} (instead #{response.expires_in.inspect})"
140
140
  end
141
141
  cache.write(url, result, expires_in: expires_in)
142
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel