Sha256: df4d68404f39da00605bbe54626996bc69a2ddc22782e63bd60e576658f447a4

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

require 'taketo/constructs/base_construct'
require 'taketo/constructs/command'
require 'taketo/support'

module Taketo
  module Constructs
    class Server < BaseConstruct
      attr_reader :environment_variables
      attr_accessor :host, :port, :username, :default_location, :default_command, :global_alias, :identity_file

      has_nodes :commands, :command

      def initialize(name)
        super
        @environment_variables = {}
      end

      def env(env_variables)
        @environment_variables.merge!(env_variables)
      end

      def parent=(parent)
        super
        env(:RAILS_ENV => parent.name.to_s) if parent.is_a?(Environment)
      end

      def default_command
        if defined? @default_command
          find_command(@default_command) || Command.explicit_command(@default_command)
        else
          Command.default
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
taketo-0.1.1 lib/taketo/constructs/server.rb
taketo-0.1.0 lib/taketo/constructs/server.rb