dl 0.0.2 → 0.0.3

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 (4) hide show
  1. data/README.md +1 -1
  2. data/lib/dl/dl.rb +3 -1
  3. data/lib/dl.rb +1 -1
  4. metadata +2 -2
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  Dl is a super-simple file downloading utility, similar to wget/curl.
2
2
 
3
- It doesn't do anything, yet. But you can still install it like this:
3
+ It will download the given url to a file.
4
4
 
5
5
  gem install dl
data/lib/dl/dl.rb CHANGED
@@ -3,6 +3,8 @@ module Dl
3
3
  session = Patron::Session.new
4
4
 
5
5
  response = session.get url
6
- puts response.body
6
+ filename = response.url.split('/').pop
7
+
8
+ File.new(filename, 'w').write(response.body)
7
9
  end
8
10
  end
data/lib/dl.rb CHANGED
@@ -3,5 +3,5 @@ require 'patron'
3
3
  require 'dl/dl'
4
4
 
5
5
  module Dl
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dl
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
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-12 00:00:00 Z
13
+ date: 2011-04-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: patron