cacho 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/cacho.rb +4 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5ca8cc9f078ae86e02bc6afb967b4e63596cbc6
4
- data.tar.gz: 2dfd696b59443bd1077ec5dd614838f057a4c526
3
+ metadata.gz: 971a2618311a53c598754c6ac93be13c3c035bc1
4
+ data.tar.gz: c908a98a87751c1b69018042a126f871d0780023
5
5
  SHA512:
6
- metadata.gz: 8f83a5f46beaf4a85ae194143f0c34e7c682f42b7d27e1a89a4837fbe554499ca0458ac1d01a6aa50ce82ebfd43e9a8fe8b3e7c35e012e3a0cf902dda5fb1d76
7
- data.tar.gz: 91be7e3b2db90c242bcdb54fd1788640c2d7a0d0130565a7cfac8aa2ad1d184b1909fb92c5608cc2483e7338b049bb35885e6eac9a29aa037fbc508b8973d3b0
6
+ metadata.gz: a2ffb8c7b0677f102b7174f5406027e612167490b85df8fc326ce6bf29729b8f29a7075b25f702b22765f5a885bd895cf47d8cf5c3dc1cb236e6fa3fa31fedf6
7
+ data.tar.gz: 3295d8ffff7648eba520a4fcdbcfd70fd041e9c76648c871b798c7b8558556b41b43b2019837975b9d1ada9bc3a99a3ce30a4a5e96d27ee908bdd28187cca1b2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.1.2 - 2014-11-02
2
+ ==================
3
+
4
+ * Fix relative redirects.
5
+
1
6
  0.1.1 - 2014-11-02
2
7
  ==================
3
8
 
data/lib/cacho.rb CHANGED
@@ -7,7 +7,7 @@ require "csv"
7
7
  require "fileutils"
8
8
 
9
9
  class Cacho
10
- VERSION = "0.1.1"
10
+ VERSION = "0.1.2"
11
11
 
12
12
  attr_accessor :hasher
13
13
 
@@ -126,12 +126,11 @@ class Cacho::Client
126
126
  return parsed
127
127
  when "303" , "302" , "301"
128
128
  if res["Location"].to_s.index(/^https?:\/\//)
129
- redirect_url = URI.escape(res["Location"])
129
+ uri = URI(res["Location"])
130
130
  else
131
- redirect_url = @base_url, res["Location"]
131
+ uri = URI.join(uri, res["Location"])
132
132
  end
133
- $stderr.write(" redirected to #{redirect_url}\n")
134
- uri = URI.join(redirect_url)
133
+ $stderr.puts("Redirected to #{res["Location"]} (#{uri})")
135
134
  when "404"
136
135
  return nil
137
136
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Janowski