dl 1.2.1 → 1.2.2

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.
Files changed (3) hide show
  1. data/lib/dl.rb +1 -1
  2. data/lib/dl/dl.rb +3 -20
  3. metadata +2 -2
data/lib/dl.rb CHANGED
@@ -3,7 +3,7 @@ require 'patron'
3
3
  require 'dl/dl'
4
4
 
5
5
  module Dl
6
- VERSION = "1.2.1"
6
+ VERSION = "1.2.2"
7
7
 
8
8
  @@be_quiet = false
9
9
  @@file = ""
@@ -6,28 +6,11 @@ module Dl
6
6
 
7
7
  begin
8
8
  response = session.get url
9
- rescue Patron::HostResolutionError
10
- puts "Error resolving remote host."
11
- exit 1
12
- rescue Patron::PartialFileError
13
- puts "File size mismatch. (Host reported a file size, but the actual file is of different size)"
14
- exit 1
15
- rescue Patron::TimeoutError
16
- puts "Operation timed out."
17
- exit 1
18
- rescue Patron::TooManyRedirects
19
- puts "Tried redirecting too many times."
20
- exit 1
21
- rescue Patron::URLFormatError
22
- puts "Error with the URL format"
23
- exit 1
24
- rescue Patron::UnsupportedProtocol
25
- puts "This URL is using a protocol that we cannot handle."
26
- exit 1
27
- rescue Patron::ConnectionFailed
28
- puts "Error connecting to host. Check your internet connection."
9
+ rescue Patron::Error => e
10
+ $stderr.puts e.message
29
11
  exit 1
30
12
  end
13
+
31
14
  if raw == true
32
15
  puts response.body
33
16
  else
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dl
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.1
5
+ version: 1.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mark Szymanski
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-17 00:00:00 Z
13
+ date: 2011-04-24 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: patron