File: README

package info (click to toggle)
libnet-netrc-ruby 0.2.1-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 124 kB
  • ctags: 228
  • sloc: ruby: 1,420; makefile: 22
file content (48 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
= Net::Netrc

A pure Ruby module providing ftp(1)-compatible .netrc file parsing.

Author: Bob Showalter (bshow@rubyforge.org)
Website: http://net-netrc.rubyforge.org

Copyright (c) 2005, 2008 Robert J. Showalter

This library is distributed under the terms of the Ruby license.
(see the accompanying LICENSE file.) You may freely distribute or
modify this library.

See Net::Netrc for usage.

== Installation

As a gem:

  $ su
  # gem install net-netrc

Using setup.rb:

  $ su
  # ruby setup.rb

== Example Usage

Standalone usage:

  require 'net/netrc'

  rc = Net::Netrc.locate('ftp.example.com') or
    raise ".netrc missing or no entry found"
  puts rc.login
  puts rc.password
  puts rc.name

Net::FTP auto-login:

  require 'net/ftp-netrc'

  ftp = Net::FTP.new('ftp.example.com')
  ftp.login(nil)          # nil username triggers Net::Netrc lookup
  puts ftp.last_response
  => 230 User myuser logged in.