I am using ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] where I am trying to test a script. The following does not work as expected
CSV.foreach(tscm_hosts_file, headers: tscm_hosts_file_col_headers) do |row|
catch :bad_data do
tscm_hosts_file_col_headers.each do |header|
throw :bad_data if row[header].nil?
end
.
.....
And error received is
[root@fmsprdchef001 ~]# ./generate_autoreg_output.rb
./generate_autoreg_output.rb:75: syntax error, unexpected ':', expecting ')'
...each(tscm_hosts_file, headers: tscm_hosts_file_col_headers) ...
I think this is the because of the ruby version I am using. Can someone tell which RUby version supports this syntax?