Skip to content

Instantly share code, notes, and snippets.

@finger-berlin
Created September 7, 2013 12:57
Show Gist options
  • Save finger-berlin/6475362 to your computer and use it in GitHub Desktop.
Save finger-berlin/6475362 to your computer and use it in GitHub Desktop.
sed / gsed script to convert PHP code into ruby: <?php echo $camelCase ?> into <%= snake_case %>
$ gsed -e 's|<?php echo \(.*\) ?>|<%= \1 %>|g' -e 's/$\([a-z]*\)\([A-Z]\)/\1_\l\2/g' old_php_view.php > new_rails_view.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment