Class: Utopia::Command::Server::Environment

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/utopia/command.rb

Instance Method Summary collapse

Instance Method Details

#invoke(parent) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/utopia/command.rb', line 124

def invoke(parent)
	return if variables.empty?
	
	destination_root = parent.root
	
	Setup::Server.environment(destination_root) do |store|
		variables.each do |variable|
			key, value = variable.split('=', 2)
			
			if value
				puts "ENV[#{key.inspect}] will default to #{value.inspect} unless otherwise specified."
				store[key] = value
			else
				puts "ENV[#{key.inspect}] will be unset unless otherwise specified."
				store.delete(key)
			end
		end
	end
end