11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/super_mega_ultra_capistrano_extensions.rb', line 11
def environment
return if options[:env].nil? || options[:env].empty?
@environment ||= if String === options[:env]
"env #{options[:env]}"
else
options[:env][:environment] ? ". #{options[:env][:environment]}; " : '' +
options[:env].reject do |key, value|
key == :environment
end.inject("env") do |string, (name, value)|
value = value.to_s.gsub(/[ "]/) { |m| "\\#{m}" }
string << " #{name}=#{value}"
end
end
end
|