gem_path

in lib/omnibus/packagers/msi.rb [290:307]


    def gem_path(glob = NULL)
      unless glob.is_a?(String) || null?(glob)
        raise InvalidValue.new(:glob, "be an String")
      end

      install_path = Pathname.new(project.install_dir)

      
      search_pattern = install_path.join("**", "gems")
      search_pattern = search_pattern.join(glob) unless null?(glob)
      file_paths = Pathname.glob(search_pattern).find

      raise "Could not find `#{search_pattern}'!" if file_paths.none?
      raise "Multiple possible matches of `#{search_pattern}'! : #{file_paths}" if file_paths.count > 1

      file_paths.first.relative_path_from(install_path).to_s
    end