lib/taketo/constructs/server.rb in taketo-0.0.10 vs lib/taketo/constructs/server.rb in taketo-0.1.0
- old
+ new
@@ -4,11 +4,11 @@
module Taketo
module Constructs
class Server < BaseConstruct
attr_reader :environment_variables
- attr_accessor :host, :port, :username, :default_location, :default_command, :environment, :global_alias, :identity_file
+ attr_accessor :host, :port, :username, :default_location, :default_command, :global_alias, :identity_file
has_nodes :commands, :command
def initialize(name)
super
@@ -17,13 +17,12 @@
def env(env_variables)
@environment_variables.merge!(env_variables)
end
- def parent=(environment)
- env(:RAILS_ENV => environment.name.to_s)
- @environment = environment
+ 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)