spix_parser 1.7.9 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,10 +22,10 @@ class RedirectFollower
22
22
 
23
23
  protected
24
24
  def self.redirect_url(response)
25
- if response['location'].nil?
26
- response.body.match(/<a href=\"([^>]+)\">/i)[1]
27
- else
28
- response['location']
25
+ case response['location'].strip
26
+ when nil then response.body.match(/<a href=\"([^>]+)\">/i)[1]
27
+ when %r{^/} then URI::Generic.build(Hash[[:scheme, :host, :path].zip(URI.parse(response['location']).select(:scheme, :host) << "/")])
28
+ else response['location']
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -3,8 +3,8 @@ module Spix
3
3
  module Parser
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 7
7
- TINY = 9
6
+ MINOR = 8
7
+ TINY = 0
8
8
 
9
9
  def self.current_version
10
10
  "#{MAJOR}.#{MINOR}.#{TINY}"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: spix_parser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.7.9
5
+ version: 1.8.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marcio Lopes de Faria
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-08-29 00:00:00 -03:00
14
+ date: 2012-01-19 00:00:00 -02:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency