down 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/down.gemspec +1 -1
  4. data/lib/down.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d5f3b4d397d1d57d3caf236c97eb30802f76dc3
4
- data.tar.gz: f8d11e7ec8adf34013c319a91c3a4ca17d0bbc7a
3
+ metadata.gz: 595622550e0149614c790453bc98f4f2942cc2a7
4
+ data.tar.gz: f15b3f0295b7e7b5ca4f7e6e8378b756491c1f4d
5
5
  SHA512:
6
- metadata.gz: aa069b0e4b6626623e9d7beccb2aeaf52c947fc1eacdaedc961093590cf1fe920ef6ae76b1410e26e7109394310053d3ae62104c4c6766d7977f0d0b0e48a7ab
7
- data.tar.gz: d077a4afbca667fbe78b9d5563bb0bc0e356cc671c51e4d592d363c0a2f4e24abe1456bd17d130675755504b410b03cbbf644fc63fa286b31fbc48837b4157ed
6
+ metadata.gz: 1e8061c128db991dc07f8217053873a4dc8eba846c51ecd9c942f6019d3692a0e3c7b4e4e2b18ada1d6063ee3ce42782d4e9d1d19bcfa3ce44adfa5f087a3d65
7
+ data.tar.gz: 58567888d34a9147a297f295f7e558783fc9a449b37af8d62118003126ae42f1aac531c40c141b58262c1e3240b8bb88a2a846524554a7167817be0aaa4aad57
data/README.md CHANGED
@@ -15,13 +15,13 @@ enough to just use `open-uri`. However, if you're accepting URLs from your
15
15
  users (e.g. through `remote_<avatar>_url` in CarrierWave), then downloading is
16
16
  suddenly not as simple as it appears to be.
17
17
 
18
- ### `StringIO`
18
+ ### StringIO
19
19
 
20
20
  Firstly, you may think that `open-uri` always downloads a file to disk, but
21
21
  that's not true. If the downloaded file has 10 KB or less, `open-uri` actually
22
22
  returns a `StringIO`. In my application I needed that the file is always
23
- downloaded to disk. This is a wrong design decision, so Down patches this
24
- behaviour and always returns a `Tempfile`.
23
+ downloaded to disk. This was obviously a wrong design decision from the MRI
24
+ team, so Down patches this behaviour and always returns a `Tempfile`.
25
25
 
26
26
  ### Metadata
27
27
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "down"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.0.1"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko.marohnic@gmail.com"]
6
6
 
@@ -22,6 +22,7 @@ module Down
22
22
  options[:progress].call(current_size) if options[:progress]
23
23
  },
24
24
  open_timeout: options[:timeout],
25
+ redirect: false,
25
26
  )
26
27
 
27
28
  # open-uri will return a StringIO instead of a Tempfile if the filesize
@@ -36,7 +37,6 @@ module Down
36
37
  downloaded_file
37
38
 
38
39
  rescue => error
39
- raise if error.instance_of?(RuntimeError) && error.message !~ /redirection/
40
40
  raise if error.is_a?(Down::Error)
41
41
  raise Down::NotFound, error.message
42
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: down
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-25 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake