snoopy 0.0.1 → 0.0.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.
- data/bin/snoopy +11 -4
- data/lib/ftp.rb +14 -14
- data/lib/http.rb +0 -2
- metadata +1 -1
data/bin/snoopy
CHANGED
@@ -9,10 +9,10 @@ require "snoopy"
|
|
9
9
|
##################################################################################
|
10
10
|
|
11
11
|
opts = Trollop::options do
|
12
|
-
version "snoopy 0.0.
|
12
|
+
version "snoopy 0.0.2 (c) Ari Brown"
|
13
13
|
banner <<-EOS
|
14
14
|
snoopy is a multithreaded golden retriever for the internet
|
15
|
-
--> handles http, ftp (single threaded), and torrent
|
15
|
+
--> handles http(s), ftp (single threaded), and torrent
|
16
16
|
|
17
17
|
Usage:
|
18
18
|
snoopy <URI of file> [options]
|
@@ -88,8 +88,15 @@ start_report(opts)
|
|
88
88
|
##################################################################################
|
89
89
|
$start_time = Time.now
|
90
90
|
##################################################################################
|
91
|
-
|
92
|
-
ball.roll
|
91
|
+
begin
|
92
|
+
ball.roll
|
93
|
+
rescue SocketError
|
94
|
+
puts 'File not found'
|
95
|
+
exit
|
96
|
+
rescue
|
97
|
+
puts 'Holy monkey! PLEASE send this in as a bug report: ari [at] aribrown.com'
|
98
|
+
exit
|
99
|
+
end
|
93
100
|
|
94
101
|
##################################################################################
|
95
102
|
$elapsed_time = Time.now - $start_time
|
data/lib/ftp.rb
CHANGED
@@ -4,19 +4,19 @@
|
|
4
4
|
# Copyright (c) 2007. All pwnage reserved.
|
5
5
|
|
6
6
|
module FTP
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
class << self
|
8
|
+
def setup(opts, uri)
|
9
|
+
@opts = opts
|
10
|
+
end
|
11
|
+
|
12
|
+
def prep
|
13
|
+
end
|
14
|
+
|
15
|
+
def fetch
|
16
|
+
Net::FTP.open(@opts[:in]) {|ftp| ftp.getbinaryfile(@opts[:in], @opts[:out]) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def clean
|
20
|
+
end
|
20
21
|
end
|
21
|
-
|
22
22
|
end
|
data/lib/http.rb
CHANGED