downspout 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/downspout/downloader.rb +1 -1
- data/test/unit/downloader_test.rb +7 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
data/lib/downspout/downloader.rb
CHANGED
@@ -326,7 +326,7 @@ module Downspout
|
|
326
326
|
disposition = @response_headers[cd_key]
|
327
327
|
if disposition then
|
328
328
|
# example : Content-Disposition: attachment; filename="iPad_User_Guide.pdf"
|
329
|
-
file_name = disposition.match("filename=\"?(
|
329
|
+
file_name = disposition.match("filename=\"?([^\"]+)\"?")[1]
|
330
330
|
end
|
331
331
|
end
|
332
332
|
|
@@ -227,9 +227,15 @@ class DownloaderTest < Test::Unit::TestCase
|
|
227
227
|
assert the_key
|
228
228
|
end
|
229
229
|
|
230
|
-
should "extract the
|
230
|
+
should "extract the expected file name" do
|
231
231
|
assert_equal "0123456789_X.pdf", @dlx.send("generate_file_name")
|
232
232
|
end
|
233
|
+
|
234
|
+
should "extract the expected file name (even when quoted)" do
|
235
|
+
@dlx.response_headers["Content-Disposition"].gsub!("0123456789_X.pdf", "\"0123456789_X.pdf\"")
|
236
|
+
assert_equal "0123456789_X.pdf", @dlx.send("generate_file_name")
|
237
|
+
end
|
238
|
+
|
233
239
|
end
|
234
240
|
|
235
241
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: downspout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Phi.Sanders
|