Skip to content

Instantly share code, notes, and snippets.

@yob
Forked from lachlanhardy/gist:110503
Created May 12, 2009 14:26
Show Gist options
  • Save yob/110517 to your computer and use it in GitHub Desktop.
Save yob/110517 to your computer and use it in GitHub Desktop.
# assume we're passing the values from the file below as arguments to the following:
# WTF is name always nil?
# I'm not sure off the top of my head, but maybe just avoid regexp's all together?
# - jh
def filtered_filenames(paths)
paths ||= []
paths.collect { |path|
File.basename(path)
}.reject { |name|
name == "index.haml"
}
end
# This is a Dir.glob of a folder.
"views/articles/74-twitter-adds-a-breakdown"
"views/articles/action-reaction"
"views/articles/ardent-about-arduino"
"views/articles/bitter-twitches"
"views/articles/gitjour-the-quickening"
"views/articles/index.haml"
"views/articles/internet-gurus"
"views/articles/joining-the-conversation"
"views/articles/local-government-open-web"
"views/articles/make-the-leap"
"views/articles/meraki-madness"
"views/articles/meshing-with-meraki"
"views/articles/nonscary-way-of-learning-openid"
"views/articles/phishing-fools"
"views/articles/pimping-your-github-commits-js"
"views/articles/podcast-for-your-pleasure"
"views/articles/remix-australia-rocked"
"views/articles/share-the-love"
"views/articles/sun-said-what"
"views/articles/test"
"views/articles/twitterific-troll-filter"
"views/articles/x-ua-compatible-past-thoughts-of-children"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment