Sha256: e9f9467b6903831d6c1145b236aec90e6d28a2fe9ac992d14e2b4a7397a4cde8
Contents?: true
Size: 719 Bytes
Versions: 12
Compression:
Stored size: 719 Bytes
Contents
this.gts = this.gts || {}; this.gts.url = (function () { function path(url) { var pieces = url.split("/"); pieces.shift(); pieces.shift(); pieces.shift(); return "/" + pieces.join("/"); } function templatize(url, values) { var newUrl = path(url); for (var n in values) { newUrl = newUrl.replace(new RegExp(values[n], "g"), "#{" + n + "}"); } return newUrl; } function currentRef(url) { var refPath = url.split(/(blame|blob|tree|history|raw)\//)[2]; return refPath && refPath.split(":")[0] || null; } return { templatize: templatize, currentRef: currentRef }; }());
Version data entries
12 entries across 12 versions & 1 rubygems