How you doing? I'm trying to make my life easier in translating some
configuration files from an old version to a new one, and I'm
stuck/frustrated since I'm new to Ruby. Basically i would need a script
to convert from this input:

route-map 6300-test-in permit 5
match as-path 1
set local-preference 90
set community 65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613
!
route-map 6300-test-in permit 10
match ip address prefix-list 6300-pref-low
set local-preference 90
set community 65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613
!
route-map 6300-test-in permit 5000
set local-preference 200
set community 65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613

to this output:
route-policy 6300-test-in
 apply bogons
 if as-path in aspath1 then
  set local-preference 90
  set community (65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613)
 elseif destination in 6300-pref-low then
  set local-preference 90
  set community (65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613)
 else
  set local-preference 200
  set community 65000:1 65000:3 65000:1000 65000:3000 65000:3500
65000:3613)
 endif
 end-policy

I tried with line.match but it doesn't really help since half the
configuration just repeats by section. Was trying to hash the input but
just
getting nowhere. Any help would be appreciated.

thanks