Skip to content

Instantly share code, notes, and snippets.

@jakedouglas
Created July 19, 2010 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakedouglas/481814 to your computer and use it in GitHub Desktop.
Save jakedouglas/481814 to your computer and use it in GitHub Desktop.
~$ ls /Users/jake/development/rnkfoods/test/fixtures/
contact_mailer orderitems.yml orders.yml products.yml users.yml
fixture_path = "/Users/jake/development/rnkfoods/test/fixtures/"
table_names = Dir["#{fixture_path}/**/*.{yml,csv}"]
table_names.map! { |f| f[(fixture_path.size + 1)..-5] }
p table_names
~/development/rnkfoods[master*]$ ruby example.rb
["orderitems", "orders", "products", "users"]
~/development/rnkfoods[master*]$ ruby example.rb
["rderitems", "rders", "roducts", "sers"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment