Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails Archeology

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Rails Archeology

Avatar for pete higgins

pete higgins

March 04, 2014
Tweet

More Decks by pete higgins

Other Decks in Technology

Transcript

  1. for i in app/models/*.rb ; do sed "s/\s\+def \(self\.\)\?\ ([^(

    ]*\).*\|\s\+scope :\ ([^,]*\).*/\2\3/;tx;d;:x" $i | while read j ; do echo $ (grep -R $j app/ lib/ config/ | wc -l) $j ; done ; done | sort -rn
  2. for i in app/models/*.rb ; do sed "s/\s\+def \(self\.\)\?\ ([^(

    ]*\).*\|\s\+scope :\ ([^,]*\).*/\2\3/;tx;d;:x" $i | while read j ; do echo $ (grep -R $j app/ lib/ config/ | wc -l) $j ; done ; done | sort -rn
  3. for i in app/models/*.rb ; do sed "s/\s\+def \(self\.\)\?\ ([^(

    ]*\).*\|\s\+scope :\ ([^,]*\).*/\2\3/;tx;d;:x" $i | while read j ; do echo $ (grep -R $j app/ lib/ config/ | wc -l) $j ; done ; done | sort -rn
  4. for i in app/models/*.rb ; do sed "s/\s\+def \(self\.\)\?\ ([^(

    ]*\).*\|\s\+scope :\ ([^,]*\).*/\2\3/;tx;d;:x" $i | while read j ; do echo $ (grep -R $j app/ lib/ config/ | wc -l) $j ; done ; done | sort -rn
  5. for i in $(find app/views/ -type f) ; do echo

    $(grep -R $(echo $i | sed "s/.*\/_\?\ ([^.]*\).*/\1/") app/ | wc -l) $i ; done | sort -rn