Parent

Included Modules

Class Index [+]

Quicksearch

Capistrano::ServerDefinition

Attributes

host[R]
user[R]
port[R]
options[R]

Public Class Methods

default_user() click to toggle source

The default user name to use when a user name is not explicitly provided

    # File lib/capistrano/server_definition.rb, line 11
11:     def self.default_user
12:       ENV['USER'] || ENV['USERNAME'] || "not-specified"
13:     end
new(string, options={}) click to toggle source
    # File lib/capistrano/server_definition.rb, line 15
15:     def initialize(string, options={})
16:       @user, @host, @port = string.match(/^(?:([^;,:=]+)@|)(.*?)(?::(\d+)|)$/)[1,3]
17: 
18:       @options = options.dup
19:       user_opt, port_opt = @options.delete(:user), @options.delete(:port)
20: 
21:       @user ||= user_opt
22:       @port ||= port_opt
23: 
24:       @port = @port.to_i if @port
25:     end

Public Instance Methods

<=>(server) click to toggle source
    # File lib/capistrano/server_definition.rb, line 27
27:     def <=>(server)
28:       [host, port, user] <=> [server.host, server.port, server.user]
29:     end
==(server) click to toggle source
Alias for: eql?
eql?(server) click to toggle source

Redefined, so that Array#uniq will work to remove duplicate server definitions, based solely on their host names.

    # File lib/capistrano/server_definition.rb, line 33
33:     def eql?(server)
34:       host == server.host &&
35:         user == server.user &&
36:         port == server.port
37:     end
Also aliased as: ==
hash() click to toggle source

Redefined, so that Array#uniq will work to remove duplicate server definitions, based on their connection information.

    # File lib/capistrano/server_definition.rb, line 43
43:     def hash
44:       @hash ||= [host, user, port].hash
45:     end
to_s() click to toggle source
    # File lib/capistrano/server_definition.rb, line 47
47:     def to_s
48:       @to_s ||= begin
49:         s = host
50:         s = "#{user}@#{s}" if user
51:         s = "#{s}:#{port}" if port && port != 22
52:         s
53:       end
54:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.