# File lib/rudy/global.rb, line 62
62:     def apply_config(config)
63: 
64:       return unless config.is_a?(Rudy::Config)
65:       clear_system_defaults  # temporarily unapply default values
66:       
67:       if config.defaults?
68:         # Apply the "color" default before "nocolor" so nocolor has presedence
69:         @nocolor = !config.defaults.color unless config.defaults.color.nil?
70:         # WARNING: Don't add user to this list. The global value should return
71:         # the value specified on the command line or nil. If it is nil, we can
72:         # check the value from the machines config. If that is nil, we use the
73:         # value from the defaults config. 
74:         # WARNING: Don't add bucket either or any machines configuration param 
75:         # TODO: investigate removing this apply_config method
76:         %w[region zone environment role position bucket
77:            localhost nocolor quiet auto force parallel].each do |name|
78:           curval, defval = self.send(name), config.defaults.send(name)
79:           if curval.nil? && !defval.nil?
80:             # Don't use the accessors. These are defaults so no Region  magic. 
81:             self.instance_variable_set("@#{name}", defval) 
82:           end
83:         end
84:       end
85:       
86:       if config.accounts? && config.accounts.aws
87:         %w[accesskey secretkey accountnum cert pkey].each do |name|
88:           val = config.accounts.aws.send(name)
89:           self.send("#{name}=", val) unless val.nil?
90:         end
91:       end
92:       postprocess
93:     end