niftp 1.0.2 → 1.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 (3) hide show
  1. data/README.md +17 -7
  2. data/lib/niftp/version.rb +1 -1
  3. 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
- # put a file using no username, password or other options
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
- ftps: true }) do |client|
19
- client.resume = true
20
- file = client.get("some_file.txt")
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
@@ -1,3 +1,3 @@
1
1
  module NiFTP
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: niftp
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
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-19 00:00:00 -04:00
13
+ date: 2011-05-21 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency