niftp 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -7
- data/lib/niftp/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -4,20 +4,30 @@ connections. Options include retrying your commands on flakey FTP servers, and
|
|
4
4
|
forced timeouts. FTP Secure (FTPS) is also supported.
|
5
5
|
|
6
6
|
## Usage
|
7
|
+
# Without NiFTP:
|
8
|
+
begin
|
9
|
+
client = Net::FTP.new("localhost")
|
10
|
+
client.list
|
11
|
+
ensure
|
12
|
+
client.try(:close)
|
13
|
+
end
|
14
|
+
|
15
|
+
# With NiFTP:
|
16
|
+
ftp("localhost") { |client| client.list }
|
17
|
+
|
18
|
+
# A more concrete example:
|
7
19
|
|
8
20
|
# Mixin the +NiFTP+ module, which provides the +ftp+ method.
|
9
21
|
class SomeObject
|
10
22
|
include NiFTP
|
11
23
|
|
12
24
|
def ftp_stuff
|
13
|
-
#
|
14
|
-
ftp("localhost") { |client| client.put("some_file.txt") }
|
15
|
-
|
16
|
-
# get a file on an FTP Secure (FTPS) server
|
25
|
+
# get a file from an FTP Secure (FTPS) server
|
17
26
|
ftp("ftp.secure.com", { username: "some_user", password: "FTP_FTL",
|
18
|
-
|
19
|
-
|
20
|
-
|
27
|
+
ftps: true }) do |client|
|
28
|
+
files = client.list('n*')
|
29
|
+
# ...
|
30
|
+
file = client.getbinaryfile('nif.rb-0.91.gz', 'nif.gz', 1024)
|
21
31
|
# ...
|
22
32
|
end
|
23
33
|
end
|
data/lib/niftp/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: niftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Christopher R. Murphy
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-21 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|