s = <<DATA# code ENV['VAR_1'] = 'HELLO 1'ENV['VAR_2'] = 'HELLO 2'ENV['VAR_3'] = 'HELLO 3' # codeDATAputs s.scan(/^ENV\['(.*?)'\] *= *'(.*?)'$/).to_h
Standard input is empty
{"VAR_1"=>"HELLO 1", "VAR_2"=>"HELLO 2", "VAR_3"=>"HELLO 3"}
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!