Created
December 31, 2014 00:04
-
-
Save GUI/b021428a3517e9dc518f to your computer and use it in GitHub Desktop.
Big ugly regex to convert Ruby hash object-ish text into Seed-Fu seed syntax (used to translate some custom db/seeds.rb into seed-fu compatible files)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -p -i -e 's/^ *:/ s./g;s/s\._id/s.id/g;s/ => / = /g;s/, *$//g;s/^ *} *$/end\n/g;s/^ *{ *$/ModelName.seed do |s|/g' seed_file.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment