Skip to content

Instantly share code, notes, and snippets.

@andycamp
Created September 14, 2012 12:18
Show Gist options
  • Select an option

  • Save andycamp/3721600 to your computer and use it in GitHub Desktop.

Select an option

Save andycamp/3721600 to your computer and use it in GitHub Desktop.
Same File Name but Different Extensions
def same_name_diff_extensions(search_val,arr)
arr.map{ |i| i unless i.match(%r{^#{search_val}\..*}).nil? }.compact
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment