Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A pure Ruby module providing ftp(1)-compatible .netrc file parsing.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/net
test
.gitignore
LICENSE
NEWS
README
Rakefile
TODO
git2cl
net-netrc.gemspec
setup.rb

README

= Net::Netrc

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

Author: Bob Showalter (showaltb@gmail.com)

Website: http://www.rubyforge.org/projects/net-netrc

Source: http://github.com/showaltb/net-netrc

Rdoc: http://net-netrc.rubyforge.org

Copyright (c) 2005-2009 Bob 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.

Something went wrong with that request. Please try again.