Class: Capistrano::Configuration::Server

### Home Classes Methods

### In Files

- lib/capistrano/configuration/server.rb

### Parent

SSHKit::Host

### Namespace

- CLASS Capistrano::Configuration::Server::Properties

### Methods

- ::[]
- #add_role
- #add_roles
- #has_role?
- #matches?
- #netssh_options
- #primary
- #properties
- #roles=
- #roles_array
- #select?
- #with

### Files

- Capfile
- Capfile

### Class/Module Index

Quicksearch

- Capistrano
- Capistrano::Application
- Capistrano::Configuration
- Capistrano::Configuration::Filter
- Capistrano::Configuration::Question
- Capistrano::Configuration::Server
- Capistrano::Configuration::Server::Properties
- Capistrano::Configuration::Servers
- Capistrano::DSL
- Capistrano::DSL::Env
- Capistrano::DSL::Paths
- Capistrano::DSL::Stages
- Capistrano::Git
- Capistrano::Git::DefaultStrategy
- Capistrano::Hg
- Capistrano::Hg::DefaultStrategy
- Capistrano::SCM
- Capistrano::Svn
- Capistrano::Svn::DefaultStrategy
- Capistrano::TaskEnhancements
- Capistrano::UploadTask
- Capistrano::VersionValidator
- Object

No matching classes.

# Capistrano::Configuration::Server

### Public Class Methods

[](host) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 8
    def self.[](host)
      host.is_a?(Server) ? host : new(host)
    end

### Public Instance Methods

add_role(role) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 18
    def add_role(role)
      roles.add role.to_sym
      self
    end

add_roles(roles) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 12
    def add_roles(roles)
      Array(roles).each { |role| add_role(role) }
      self
    end

Also aliased as: roles=
has_role?(role) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 23
    def has_role?(role)
      roles.include? role.to_sym
    end

matches?(other) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 64
    def matches?(other)
      hostname == other.hostname
    end

netssh_options() click to toggle source

    # File lib/capistrano/configuration/server.rb, line 56
    def netssh_options
      @netssh_options ||= super.merge( fetch(:ssh_options) || {} )
    end

primary() click to toggle source

    # File lib/capistrano/configuration/server.rb, line 43
    def primary
      self if fetch(:primary)
    end

properties() click to toggle source

    # File lib/capistrano/configuration/server.rb, line 52
    def properties
      @properties ||= Properties.new
    end

roles=(roles) click to toggle source
Alias for: add_roles
roles_array() click to toggle source

    # File lib/capistrano/configuration/server.rb, line 60
    def roles_array
      roles.to_a
    end

select?(options) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 27
    def select?(options)
      options.each do |k,v|
        callable = v.respond_to?(:call) ? v: ->(server){server.fetch(v)}
        result = case k
        when :filter, :select
          callable.call(self)
        when :exclude
          !callable.call(self)
        else
          self.fetch(k) == v
        end
        return false unless result
      end
      return true
    end

with(properties) click to toggle source

    # File lib/capistrano/configuration/server.rb, line 47
    def with(properties)
      properties.each { |key, value| add_property(key, value) }
      self
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.