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.
Files changed (4) hide show
  1. data/bin/snoopy +11 -4
  2. data/lib/ftp.rb +14 -14
  3. data/lib/http.rb +0 -2
  4. 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.4 (c) Ari Brown"
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
- 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
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
@@ -19,8 +19,6 @@ module HTTP
19
19
  @opts[:threads] = 1
20
20
  puts "--> Uhoh! Server isn't cooperating..."
21
21
  puts "--> Changing threadcount to 1"
22
- alias_method :fetch_multi, :fetch
23
- alias_method :fetch, :fetch_single
24
22
  end
25
23
  end
26
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snoopy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Brown