DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Vendor_gem_source_index.rb Bug Fix

04.08.2010
| 3714 views |
  • submit to reddit
        // This fixes improper handling gems with -win32 postfix in names

def version_for_dir(d)
  matches = /-(\d+\.\d+\.\d+)/.match(d) #matches = /-([^-]+)$/.match(d) #Zhoran
  Gem::Version.new(matches[1]) if matches
end