simplecov 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/simplecov/cli/annotations.rb +166 -0
- data/lib/simplecov/cli/patch/output.rb +16 -0
- data/lib/simplecov/cli/patch.rb +8 -2
- data/lib/simplecov/cli/uncovered/misses.rb +5 -9
- data/lib/simplecov/cli/uncovered.rb +6 -20
- data/lib/simplecov/cli/usage.rb +2 -1
- data/lib/simplecov/configuration/eval_coverage.rb +1 -1
- data/lib/simplecov/configuration/view_coverage.rb +2 -3
- data/lib/simplecov/coverage_violations.rb +4 -2
- data/lib/simplecov/directive/erb.rb +44 -0
- data/lib/simplecov/directive/haml.rb +33 -0
- data/lib/simplecov/directive/indented_template.rb +37 -0
- data/lib/simplecov/directive/slim.rb +35 -0
- data/lib/simplecov/directive/template.rb +29 -0
- data/lib/simplecov/directive.rb +1 -0
- data/lib/simplecov/formatter/html_formatter/public/index.html +12 -12
- data/lib/simplecov/production.rb +1 -1
- data/lib/simplecov/profiles/rails.rb +4 -4
- data/lib/simplecov/profiles/strict.rb +3 -3
- data/lib/simplecov/result.rb +6 -0
- data/lib/simplecov/result_processing.rb +20 -5
- data/lib/simplecov/simulate_coverage.rb +2 -2
- data/lib/simplecov/source_file/builder_context.rb +7 -0
- data/lib/simplecov/source_file/skip_chunks.rb +11 -2
- data/lib/simplecov/source_file/statistics.rb +16 -6
- data/lib/simplecov/static_coverage_extractor/condition_folding.rb +9 -42
- data/lib/simplecov/static_coverage_extractor/method_collector.rb +1 -5
- data/lib/simplecov/static_coverage_extractor/visitor.rb +4 -7
- data/lib/simplecov/static_coverage_extractor.rb +6 -22
- data/lib/simplecov/version.rb +1 -1
- data/man/simplecov.1 +8 -3
- data/sig/simplecov.rbs +5 -0
- metadata +10 -4
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
</dialog>
|
|
65
65
|
|
|
66
66
|
<!-- SIMPLECOV_COVERAGE_DATA -->
|
|
67
|
-
<script>"use strict";(()=>{var Jn=Object.create;var Lt=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty;var rr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var or=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of er(t))!nr.call(e,o)&&o!==n&&Lt(e,o,{get:()=>t[o],enumerable:!(r=Qn(t,o))||r.enumerable});return e};var sr=(e,t,n)=>(n=e!=null?Jn(tr(e)):{},or(t||!e||!e.__esModule?Lt(n,"default",{value:e,enumerable:!0}):n,e));var le=(e,t,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(d){o(d)}},s=a=>{try{c(n.throw(a))}catch(d){o(d)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,s);c((n=n.apply(e,t)).next())});var Jt=rr((os,Yt)=>{function Pt(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Pt(n)}),e}var ke=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let o in r)n[o]=r[o]}),n}var lr="</span>",Ot=e=>!!e.scope,ur=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${t}${e}`},Qe=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Ft(t)}openNode(t){if(!Ot(t))return;let n=ur(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Ot(t)&&(this.buffer+=lr)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},kt=(e={})=>{let t={children:[]};return Object.assign(t,e),t},et=class e{constructor(){this.rootNode=kt(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=kt({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},tt=class extends et{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Qe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Se(e){return e?typeof e=="string"?e:e.source:null}function qt(e){return re("(?=",e,")")}function dr(e){return re("(?:",e,")*")}function fr(e){return re("(?:",e,")?")}function re(...e){return e.map(n=>Se(n)).join("")}function gr(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function He(...e){return"("+(gr(e).capture?"":"?:")+e.map(r=>Se(r)).join("|")+")"}function Wt(e){return new RegExp(e.toString()+"|").exec("").length-1}function pr(e,t){let n=e&&e.exec(t);return n&&n.index===0}var mr=new RegExp(He(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function rt(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;let o=n,i=Se(r),s="";for(;i.length>0;){let c=mr.exec(i);if(!c){s+=i;break}s+=i.substring(0,c.index),i=i.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+o):(s+=c[0],(c[0]==="("||/^\(\?[<']/.test(c[0]))&&n++)}return s}).map(r=>`(${r})`).join(t)}var hr=/\b\B/,zt="[a-zA-Z]\\w*",ot="[a-zA-Z_]\\w*",Ut="\\b\\d+(\\.\\d+)?",jt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Gt="\\b(0b[01]+)",br="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",vr=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=re(t,/.*\b/,e.binary,/\b.*/)),V({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Me={begin:"\\\\[\\s\\S]",relevance:0},Er={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Me]},_r={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Me]},yr={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},De=function(e,t,n={}){let r=V({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let o=He("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:re(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Sr=De("//","$"),Mr=De("/\\*","\\*/"),wr=De("#","$"),xr={scope:"number",begin:Ut,relevance:0},Lr={scope:"number",begin:jt,relevance:0},Tr={scope:"number",begin:Gt,relevance:0},Cr={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Me,{begin:/\[/,end:/\]/,relevance:0,contains:[Me]}]},Ar={scope:"title",begin:zt,relevance:0},Nr={scope:"title",begin:ot,relevance:0},Rr={begin:"\\.\\s*"+ot,relevance:0},$r=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:Er,BACKSLASH_ESCAPE:Me,BINARY_NUMBER_MODE:Tr,BINARY_NUMBER_RE:Gt,COMMENT:De,C_BLOCK_COMMENT_MODE:Mr,C_LINE_COMMENT_MODE:Sr,C_NUMBER_MODE:Lr,C_NUMBER_RE:jt,END_SAME_AS_BEGIN:$r,HASH_COMMENT_MODE:wr,IDENT_RE:zt,MATCH_NOTHING_RE:hr,METHOD_GUARD:Rr,NUMBER_MODE:xr,NUMBER_RE:Ut,PHRASAL_WORDS_MODE:yr,QUOTE_STRING_MODE:_r,REGEXP_MODE:Cr,RE_STARTERS_RE:br,SHEBANG:vr,TITLE_MODE:Ar,UNDERSCORE_IDENT_RE:ot,UNDERSCORE_TITLE_MODE:Nr});function Or(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function kr(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Ir(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Or,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Hr(e,t){Array.isArray(e.illegal)&&(e.illegal=He(...e.illegal))}function Dr(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Br(e,t){e.relevance===void 0&&(e.relevance=1)}var Pr=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=re(n.beforeMatch,qt(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Fr=["of","and","for","in","not","or","if","then","parent","list","value"],qr="keyword";function Kt(e,t,n=qr){let r=Object.create(null);return typeof e=="string"?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(i){Object.assign(r,Kt(e[i],t,i))}),r;function o(i,s){t&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){let a=c.split("|");r[a[0]]=[i,Wr(a[0],a[1])]})}}function Wr(e,t){return t?Number(t):zr(e)?0:1}function zr(e){return Fr.includes(e.toLowerCase())}var It={},ne=e=>{console.error(e)},Ht=(e,...t)=>{console.log(`WARN: ${e}`,...t)},de=(e,t)=>{It[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),It[`${e}/${t}`]=!0)},Ie=new Error;function Zt(e,t,{key:n}){let r=0,o=e[n],i={},s={};for(let c=1;c<=t.length;c++)s[c+r]=o[c],i[c+r]=!0,r+=Wt(t[c-1]);e[n]=s,e[n]._emit=i,e[n]._multi=!0}function Ur(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ie;if(typeof e.beginScope!="object"||e.beginScope===null)throw ne("beginScope must be object"),Ie;Zt(e,e.begin,{key:"beginScope"}),e.begin=rt(e.begin,{joinWith:""})}}function jr(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ie;if(typeof e.endScope!="object"||e.endScope===null)throw ne("endScope must be object"),Ie;Zt(e,e.end,{key:"endScope"}),e.end=rt(e.end,{joinWith:""})}}function Gr(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Kr(e){Gr(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ur(e),jr(e)}function Zr(e){function t(s,c){return new RegExp(Se(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,c]),this.matchAt+=Wt(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let c=this.regexes.map(a=>a[1]);this.matcherRe=t(rt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;let a=this.matcherRe.exec(c);if(!a)return null;let d=a.findIndex((m,_)=>_>0&&m!==void 0),f=this.matchIndexes[d];return a.splice(0,d),Object.assign(a,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];let a=new n;return this.rules.slice(c).forEach(([d,f])=>a.addRule(d,f)),a.compile(),this.multiRegexes[c]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,a){this.rules.push([c,a]),a.type==="begin"&&this.count++}exec(c){let a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let d=a.exec(c);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(c)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function o(s){let c=new r;return s.contains.forEach(a=>c.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function i(s,c){let a=s;if(s.isCompiled)return a;[kr,Dr,Kr,Pr].forEach(f=>f(s,c)),e.compilerExtensions.forEach(f=>f(s,c)),s.__beforeBegin=null,[Ir,Hr,Br].forEach(f=>f(s,c)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=Kt(s.keywords,e.case_insensitive)),a.keywordPatternRe=t(d,!0),c&&(s.begin||(s.begin=/\B|\b/),a.beginRe=t(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=t(a.end)),a.terminatorEnd=Se(a.end)||"",s.endsWithParent&&c.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(a.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return Xr(f==="self"?s:f)})),s.contains.forEach(function(f){i(f,a)}),s.starts&&i(s.starts,c),a.matcher=o(a),a}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=V(e.classNameAliases||{}),i(e)}function Xt(e){return e?e.endsWithParent||Xt(e.starts):!1}function Xr(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return V(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Xt(e)?V(e,{starts:e.starts?V(e.starts):null}):Object.isFrozen(e)?V(e):e}var Vr="11.12.0",nt=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},Je=Ft,Dt=V,Bt=Symbol("nomatch"),Yr=7,Vt=function(e){let t=Object.create(null),n=Object.create(null),r=[],o=!0,i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:tt};function a(l){return c.noHighlightRe.test(l)}function d(l){let g=l.className+" ";g+=l.parentNode?l.parentNode.className:"";let E=c.languageDetectRe.exec(g);if(E){let M=N(E[1]);return M||(Ht(i.replace("{}",E[1])),Ht("Falling back to no-highlight mode for this block.",l)),M?E[1]:"no-highlight"}return g.split(/\s+/).find(M=>a(M)||N(M))}function f(l,g,E){let M="",C="";typeof g=="object"?(M=l,E=g.ignoreIllegals,C=g.language):(de("10.7.0","highlight(lang, code, ...args) has been deprecated."),de("10.7.0",`Please use highlight(code, options) instead.
|
|
68
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),C=l,M=g),E===void 0&&(E=!0);let P={code:M,language:C};ee("before:highlight",P);let X=P.result?P.result:m(P.language,P.code,E);return X.code=P.code,ee("after:highlight",X),X}function m(l,g,E,M){let C=Object.create(null);function P(u,p){return u.keywords[p]}function X(){if(!h.keywords){A.addText(
|
|
69
|
-
`),1;if(Xe>1e5&&Xe>p.index*3)throw new Error("potential infinite loop, way more iterations than matches");return w+=b,b.length}let z=N(l);if(!z)throw ne(i.replace("{}",l)),new Error('Unknown language: "'+l+'"');let Xn=Zr(z),Ze="",h=M||Xn,xt={},A=new c.__emitter(c);Zn();let w="",$e=0,te=0,Xe=0,Ve=!1;try{if(z.__emitTokens)z.__emitTokens(g,A);else{for(h.matcher.considerAll();;){Xe++,Ve?Ve=!1:h.matcher.considerAll(),h.matcher.lastIndex=te;let u=h.matcher.exec(g);if(!u)break;let p=g.substring(te,u.index),b=wt(p,u);te=u.index+b}wt(g.substring(te))}return A.finalize(),Ze=A.toHTML(),{language:l,value:Ze,relevance:$e,illegal:!1,_emitter:A,_top:h}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:l,value:Je(g),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:te,context:g.slice(te-100,te+100),mode:u.mode,resultSoFar:Ze},_emitter:A};if(o)return{language:l,value:Je(g),illegal:!1,relevance:0,errorRaised:u,_emitter:A,_top:h};throw u}}function _(l){let g={value:Je(l),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return g._emitter.addText(l),g}function L(l,g){g=g||c.languages||Object.keys(t);let E=_(l),M=g.filter(N).filter(Q).map(H=>m(H,l,!1));M.unshift(E);let C=M.sort((H,W)=>{if(H.relevance!==W.relevance)return W.relevance-H.relevance;if(H.language&&W.language){if(N(H.language).supersetOf===W.language)return 1;if(N(W.language).supersetOf===H.language)return-1}return 0}),[P,X]=C,Ne=P;return Ne.secondBest=X,Ne}function x(l,g,E){let M=g&&n[g]||E;l.classList.add("hljs"),l.classList.add(`language-${M}`)}function v(l){let g=null,E=d(l);if(a(E))return;if(ee("before:highlightElement",{el:l,language:E}),l.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",l);return}if(l.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(l)),c.throwUnescapedHTML))throw new nt("One of your code blocks includes unescaped HTML.",l.innerHTML);g=l;let M=g.textContent,C=E?f(M,{language:E,ignoreIllegals:!0}):L(M);l.innerHTML=C.value,l.dataset.highlighted="yes",x(l,E,C.language),l.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(l.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),ee("after:highlightElement",{el:l,result:C,text:M})}function k(l){c=Dt(c,l)}let J=()=>{j(),de("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ce(){j(),de("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Z=!1;function j(){function l(){j()}if(document.readyState==="loading"){Z||window.addEventListener("DOMContentLoaded",l,!1),Z=!0;return}document.querySelectorAll(c.cssSelector).forEach(v)}function Ee(l,g){let E=null;try{E=g(e)}catch(M){if(ne("Language definition for '{}' could not be registered.".replace("{}",l)),o)ne(M);else throw M;E=s}E.name||(E.name=l),t[l]=E,E.rawDefinition=g.bind(null,e),E.aliases&&ce(E.aliases,{languageName:l})}function q(l){delete t[l];for(let g of Object.keys(n))n[g]===l&&delete n[g]}function _e(){return Object.keys(t)}function N(l){return l=(l||"").toLowerCase(),t[l]||t[n[l]]}function ce(l,{languageName:g}){typeof l=="string"&&(l=[l]),l.forEach(E=>{n[E.toLowerCase()]=g})}function Q(l){let g=N(l);return g&&!g.disableAutodetect}function Ae(l){l["before:highlightBlock"]&&!l["before:highlightElement"]&&(l["before:highlightElement"]=g=>{l["before:highlightBlock"](Object.assign({block:g.el},g))}),l["after:highlightBlock"]&&!l["after:highlightElement"]&&(l["after:highlightElement"]=g=>{l["after:highlightBlock"](Object.assign({block:g.el},g))})}function I(l){Ae(l),r.push(l)}function ae(l){let g=r.indexOf(l);g!==-1&&r.splice(g,1)}function ee(l,g){let E=l;r.forEach(function(M){M[E]&&M[E](g)})}function ye(l){return de("10.7.0","highlightBlock will be removed entirely in v12.0"),de("10.7.0","Please use highlightElement now."),v(l)}Object.assign(e,{highlight:f,highlightAuto:L,highlightAll:j,highlightElement:v,highlightBlock:ye,configure:k,initHighlighting:J,initHighlightingOnLoad:Ce,registerLanguage:Ee,unregisterLanguage:q,listLanguages:_e,getLanguage:N,registerAliases:ce,autoDetection:Q,inherit:Dt,addPlugin:I,removePlugin:ae}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Vr,e.regex={concat:re,lookahead:qt,either:He,optional:fr,anyNumberOfTimes:dr};for(let l in Oe)typeof Oe[l]=="object"&&Pt(Oe[l]);return Object.assign(e,Oe),e},fe=Vt({});fe.newInstance=()=>Vt({});Yt.exports=fe;fe.HighlightJS=fe;fe.default=fe});function $(e,t){return(t||document).querySelector(e)}function y(e,t){return Array.from((t||document).querySelectorAll(e))}function U(e,t,n,r){typeof n=="function"?e.addEventListener(t,n):e.addEventListener(t,function(o){let i=o.target.closest(n);i&&e.contains(i)&&r&&r.call(i,o)})}var ir={"&":"&","<":"<",">":">",'"':""","'":"'"};function T(e){return e.replace(/[&<>"']/g,t=>ir[t])}function Tt(e){return le(this,null,function*(){let t=new TextEncoder().encode(e),n=yield crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(n,0,4),r=>r.toString(16).padStart(2,"0")).join("")})}var cr=90,ar=75;function F(e){return e>=cr?"green":e>=ar?"yellow":"red"}function O(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function D(e){return(Math.floor(e*100)/100).toFixed(2)}function Ct(e){return"g-"+e.replace(/[^a-zA-Z0-9-]/gu,t=>`_${t.codePointAt(0).toString(16)}_`)}var At=[[31536e3,"year"],[2592e3,"month"],[86400,"day"],[3600,"hour"],[60,"minute"],[1,"second"]];function Nt(e){let t=Math.floor((Date.now()-e.getTime())/1e3);for(let[n,r]of At){let o=Math.floor(t/n);if(o>=1)return o===1?`about 1 ${r} ago`:`${o} ${r}s ago`}return"just now"}function Rt(e){let t=(Date.now()-e.getTime())/1e3;for(let[n]of At){let r=Math.floor(t/n);if(r>=1){let o=(r+1)*n;return Math.max((o-t)*1e3+500,1e3)}}return 1e3}var Ye=new Map;function ue(e){let t=Ye.get(e);if(t===void 0)throw new Error(`File ID was not precomputed for ${e}`);return t}function $t(e){return le(this,null,function*(){Ye.clear();let t=[...new Set(e)],n=yield Promise.all(t.map(Tt)),r=new Map;t.forEach((o,i)=>{let s=n[i],c=r.get(s)||[];c.push(o),r.set(s,c)});for(let[o,i]of r)i.sort().forEach((s,c)=>{Ye.set(s,c===0?o:`${o}-${c}`)})})}var Qt=sr(Jt(),1);var ge=Qt.default;function en(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},d=[e.COMMENT("#","$",{contains:[c]}),e.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},m={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},_="[1-9](_?[0-9])*|0",L="[0-9](_?[0-9])*",x={className:"number",relevance:0,variants:[{begin:`\\b(${_})(\\.(${L}))?([eE][+-]?(${L})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},q=[m,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:s},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},x,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,d),relevance:0}].concat(a,d);f.contains=q,v.contains=q;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:q}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:q}}];return d.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(q)}}function tn(e){return{name:"HAML",case_insensitive:!0,contains:[{className:"meta",begin:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",relevance:10},e.COMMENT("^\\s*(!=#|=#|-#|/).*$",null,{relevance:0}),{begin:"^\\s*(-|=|!=)(?!#)",end:/$/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:"^\\s*%",contains:[{className:"selector-tag",begin:"\\w+"},{className:"selector-id",begin:"#[\\w-]+"},{className:"selector-class",begin:"\\.[\\w-]+"},{begin:/\{\s*/,end:/\s*\}/,contains:[{begin:":\\w+\\s*=>",end:",\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:":\\w+"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]},{begin:"\\(\\s*",end:"\\s*\\)",excludeEnd:!0,contains:[{begin:"\\w+\\s*=",end:"\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:"\\w+",relevance:0},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]}]},{begin:"^\\s*[=~]\\s*"},{begin:/#\{/,end:/\}/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0}]}}var Jr={endsWithParent:!0,relevance:0,contains:[{className:"attr",begin:/[A-Za-z_:][-A-Za-z0-9_:.]*/,relevance:0},{className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]}]};function st(e){return{name:"ERB",contains:[e.COMMENT("<%#","%>"),{begin:/<%[%=-]?/,end:/[%-]?%>/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:/<\/?(?=[A-Za-z])/,end:/\/?>/,contains:[{className:"name",begin:/[A-Za-z][^\s/>]*/,relevance:0,starts:Jr}]}]}}function it(e){return{name:"Slim",contains:[e.COMMENT(/^\s*\/!?/,/$/),{begin:/^\s*(?:-|={1,2})[<>']*/,end:/$/,subLanguage:"ruby",excludeBegin:!0,relevance:0},{className:"name",begin:/^\s*[A-Za-z][A-Za-z0-9_-]*/,relevance:0,starts:{end:/\s/,relevance:0,contains:[{className:"selector-class",begin:/\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}},{className:"selector-class",begin:/^\s*\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/^\s*#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}}function Qr(e){if(e==="oneshot_line")return"line";if(e==="line"||e==="branch"||e==="method")return e}function nn(e){let t=Qr(e.primary_coverage);return t==="branch"&&e.branch_coverage||t==="method"&&e.method_coverage?t:e.line_coverage?"line":e.branch_coverage?"branch":"method"}function eo(e,t){return t==="line"?e.lines:t==="branch"?e.branches:e.methods}function Be(e,t){return eo(e,t)||e.lines||e.branches||e.methods}function Pe(e,t){let n=Array.from({length:t},()=>[]);for(let[r,o]of Object.entries(e||{})){let i=Number(r);Array.from(o).reverse().forEach((s,c)=>{let a=parseInt(s,16);for(let d of[0,1,2,3]){if(!(a&1<<d))continue;let f=c*4+d;f<t&&n[f].push(i)}})}return{perLine:n}}function rn(e,t){if(!t)return 0;let n=[];for(let o of Object.values(e||{}))Array.from(o).reverse().forEach((i,s)=>{n[s]=(n[s]||0)|parseInt(i,16)});let r=0;return t.forEach((o,i)=>{typeof o!="number"||o<=0||(n[i>>2]||0)&1<<(i&3)||r++}),r}function on(e,t,n){let r=e.perLine[n-1];return r?r.map(o=>t[o]).sort():[]}function at(e,t){let n=F(e);return t?`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n} coverage-bar__fill--split" style="width: ${D(e-t)}%"></div><div class="coverage-bar__fill coverage-bar__fill--outside" style="width: ${D(t)}%"></div></div></div>`:`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n}" style="width: ${D(e)}%"></div></div></div>`}function oe(e,t,n,r,o,i){let s=F(e),c=D(e),a=i===void 0||n===0?void 0:i*100/n,d=`<div class="coverage-cell">${at(e,a)}<span class="coverage-pct">${c}%</span></div>`;if(o)return`<td class="cell--coverage strong t-totals__${r}-pct ${s}">${d}</td><td class="cell--numerator strong t-totals__${r}-num">${O(t)}/</td><td class="cell--denominator strong t-totals__${r}-den">${O(n)}</td>`;let f=a===void 0?"":` data-order-2="${D(e-a)}"`,m=` data-order="${D(e)}"${f}`;return`<td class="cell--coverage cell--${r}-pct ${s}"${m}>${d}</td><td class="cell--numerator" data-order="${t}">${O(t)}/</td><td class="cell--denominator" data-order="${n}">${O(n)}</td>`}function Fe(e,t,n,r){return`<th class="cell--coverage" data-sort-key="${t}-percent">
|
|
67
|
+
<script>"use strict";(()=>{var Qn=Object.create;var Lt=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,rr=Object.prototype.hasOwnProperty;var or=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ir=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tr(t))!rr.call(e,o)&&o!==n&&Lt(e,o,{get:()=>t[o],enumerable:!(r=er(t,o))||r.enumerable});return e};var sr=(e,t,n)=>(n=e!=null?Qn(nr(e)):{},ir(t||!e||!e.__esModule?Lt(n,"default",{value:e,enumerable:!0}):n,e));var le=(e,t,n)=>new Promise((r,o)=>{var s=a=>{try{c(n.next(a))}catch(d){o(d)}},i=a=>{try{c(n.throw(a))}catch(d){o(d)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(s,i);c((n=n.apply(e,t)).next())});var Jt=or((ii,Yt)=>{function Pt(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Pt(n)}),e}var ke=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let o in r)n[o]=r[o]}),n}var ur="</span>",Ot=e=>!!e.scope,dr=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${t}${e}`},Qe=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Ft(t)}openNode(t){if(!Ot(t))return;let n=dr(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Ot(t)&&(this.buffer+=ur)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},kt=(e={})=>{let t={children:[]};return Object.assign(t,e),t},et=class e{constructor(){this.rootNode=kt(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=kt({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},tt=class extends et{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Qe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Se(e){return e?typeof e=="string"?e:e.source:null}function qt(e){return re("(?=",e,")")}function fr(e){return re("(?:",e,")*")}function gr(e){return re("(?:",e,")?")}function re(...e){return e.map(n=>Se(n)).join("")}function pr(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function He(...e){return"("+(pr(e).capture?"":"?:")+e.map(r=>Se(r)).join("|")+")"}function Wt(e){return new RegExp(e.toString()+"|").exec("").length-1}function mr(e,t){let n=e&&e.exec(t);return n&&n.index===0}var hr=new RegExp(He(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function rt(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;let o=n,s=Se(r),i="";for(;s.length>0;){let c=hr.exec(s);if(!c){i+=s;break}i+=s.substring(0,c.index),s=s.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?i+="\\"+String(Number(c[1])+o):(i+=c[0],(c[0]==="("||/^\(\?[<']/.test(c[0]))&&n++)}return i}).map(r=>`(${r})`).join(t)}var br=/\b\B/,zt="[a-zA-Z]\\w*",ot="[a-zA-Z_]\\w*",Ut="\\b\\d+(\\.\\d+)?",jt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Gt="\\b(0b[01]+)",vr="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Er=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=re(t,/.*\b/,e.binary,/\b.*/)),V({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Me={begin:"\\\\[\\s\\S]",relevance:0},_r={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Me]},yr={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Me]},Sr={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},De=function(e,t,n={}){let r=V({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let o=He("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:re(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Mr=De("//","$"),xr=De("/\\*","\\*/"),wr=De("#","$"),Lr={scope:"number",begin:Ut,relevance:0},Tr={scope:"number",begin:jt,relevance:0},Cr={scope:"number",begin:Gt,relevance:0},Ar={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Me,{begin:/\[/,end:/\]/,relevance:0,contains:[Me]}]},Nr={scope:"title",begin:zt,relevance:0},Rr={scope:"title",begin:ot,relevance:0},$r={begin:"\\.\\s*"+ot,relevance:0},Or=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:_r,BACKSLASH_ESCAPE:Me,BINARY_NUMBER_MODE:Cr,BINARY_NUMBER_RE:Gt,COMMENT:De,C_BLOCK_COMMENT_MODE:xr,C_LINE_COMMENT_MODE:Mr,C_NUMBER_MODE:Tr,C_NUMBER_RE:jt,END_SAME_AS_BEGIN:Or,HASH_COMMENT_MODE:wr,IDENT_RE:zt,MATCH_NOTHING_RE:br,METHOD_GUARD:$r,NUMBER_MODE:Lr,NUMBER_RE:Ut,PHRASAL_WORDS_MODE:Sr,QUOTE_STRING_MODE:yr,REGEXP_MODE:Ar,RE_STARTERS_RE:vr,SHEBANG:Er,TITLE_MODE:Nr,UNDERSCORE_IDENT_RE:ot,UNDERSCORE_TITLE_MODE:Rr});function kr(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Ir(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Hr(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=kr,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Dr(e,t){Array.isArray(e.illegal)&&(e.illegal=He(...e.illegal))}function Br(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Pr(e,t){e.relevance===void 0&&(e.relevance=1)}var Fr=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=re(n.beforeMatch,qt(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},qr=["of","and","for","in","not","or","if","then","parent","list","value"],Wr="keyword";function Kt(e,t,n=Wr){let r=Object.create(null);return typeof e=="string"?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(s){Object.assign(r,Kt(e[s],t,s))}),r;function o(s,i){t&&(i=i.map(c=>c.toLowerCase())),i.forEach(function(c){let a=c.split("|");r[a[0]]=[s,zr(a[0],a[1])]})}}function zr(e,t){return t?Number(t):Ur(e)?0:1}function Ur(e){return qr.includes(e.toLowerCase())}var It={},ne=e=>{console.error(e)},Ht=(e,...t)=>{console.log(`WARN: ${e}`,...t)},de=(e,t)=>{It[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),It[`${e}/${t}`]=!0)},Ie=new Error;function Zt(e,t,{key:n}){let r=0,o=e[n],s={},i={};for(let c=1;c<=t.length;c++)i[c+r]=o[c],s[c+r]=!0,r+=Wt(t[c-1]);e[n]=i,e[n]._emit=s,e[n]._multi=!0}function jr(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ie;if(typeof e.beginScope!="object"||e.beginScope===null)throw ne("beginScope must be object"),Ie;Zt(e,e.begin,{key:"beginScope"}),e.begin=rt(e.begin,{joinWith:""})}}function Gr(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ie;if(typeof e.endScope!="object"||e.endScope===null)throw ne("endScope must be object"),Ie;Zt(e,e.end,{key:"endScope"}),e.end=rt(e.end,{joinWith:""})}}function Kr(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Zr(e){Kr(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),jr(e),Gr(e)}function Xr(e){function t(i,c){return new RegExp(Se(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,c]),this.matchAt+=Wt(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let c=this.regexes.map(a=>a[1]);this.matcherRe=t(rt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;let a=this.matcherRe.exec(c);if(!a)return null;let d=a.findIndex((m,_)=>_>0&&m!==void 0),f=this.matchIndexes[d];return a.splice(0,d),Object.assign(a,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];let a=new n;return this.rules.slice(c).forEach(([d,f])=>a.addRule(d,f)),a.compile(),this.multiRegexes[c]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,a){this.rules.push([c,a]),a.type==="begin"&&this.count++}exec(c){let a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let d=a.exec(c);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(c)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function o(i){let c=new r;return i.contains.forEach(a=>c.addRule(a.begin,{rule:a,type:"begin"})),i.terminatorEnd&&c.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&c.addRule(i.illegal,{type:"illegal"}),c}function s(i,c){let a=i;if(i.isCompiled)return a;[Ir,Br,Zr,Fr].forEach(f=>f(i,c)),e.compilerExtensions.forEach(f=>f(i,c)),i.__beforeBegin=null,[Hr,Dr,Pr].forEach(f=>f(i,c)),i.isCompiled=!0;let d=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),d=i.keywords.$pattern,delete i.keywords.$pattern),d=d||/\w+/,i.keywords&&(i.keywords=Kt(i.keywords,e.case_insensitive)),a.keywordPatternRe=t(d,!0),c&&(i.begin||(i.begin=/\B|\b/),a.beginRe=t(a.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(a.endRe=t(a.end)),a.terminatorEnd=Se(a.end)||"",i.endsWithParent&&c.terminatorEnd&&(a.terminatorEnd+=(i.end?"|":"")+c.terminatorEnd)),i.illegal&&(a.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(f){return Vr(f==="self"?i:f)})),i.contains.forEach(function(f){s(f,a)}),i.starts&&s(i.starts,c),a.matcher=o(a),a}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=V(e.classNameAliases||{}),s(e)}function Xt(e){return e?e.endsWithParent||Xt(e.starts):!1}function Vr(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return V(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Xt(e)?V(e,{starts:e.starts?V(e.starts):null}):Object.isFrozen(e)?V(e):e}var Yr="11.12.0",nt=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},Je=Ft,Dt=V,Bt=Symbol("nomatch"),Jr=7,Vt=function(e){let t=Object.create(null),n=Object.create(null),r=[],o=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:tt};function a(l){return c.noHighlightRe.test(l)}function d(l){let g=l.className+" ";g+=l.parentNode?l.parentNode.className:"";let E=c.languageDetectRe.exec(g);if(E){let M=N(E[1]);return M||(Ht(s.replace("{}",E[1])),Ht("Falling back to no-highlight mode for this block.",l)),M?E[1]:"no-highlight"}return g.split(/\s+/).find(M=>a(M)||N(M))}function f(l,g,E){let M="",C="";typeof g=="object"?(M=l,E=g.ignoreIllegals,C=g.language):(de("10.7.0","highlight(lang, code, ...args) has been deprecated."),de("10.7.0",`Please use highlight(code, options) instead.
|
|
68
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),C=l,M=g),E===void 0&&(E=!0);let P={code:M,language:C};ee("before:highlight",P);let X=P.result?P.result:m(P.language,P.code,E);return X.code=P.code,ee("after:highlight",X),X}function m(l,g,E,M){let C=Object.create(null);function P(u,p){return u.keywords[p]}function X(){if(!h.keywords){A.addText(x);return}let u=0;h.keywordPatternRe.lastIndex=0;let p=h.keywordPatternRe.exec(x),b="";for(;p;){b+=x.substring(u,p.index);let S=z.case_insensitive?p[0].toLowerCase():p[0],R=P(h,S);if(R){let[G,Yn]=R;if(A.addText(b),b="",C[S]=(C[S]||0)+1,C[S]<=Jr&&($e+=Yn),G.startsWith("_"))b+=p[0];else{let Jn=z.classNameAliases[G]||G;W(p[0],Jn)}}else b+=p[0];u=h.keywordPatternRe.lastIndex,p=h.keywordPatternRe.exec(x)}b+=x.substring(u),A.addText(b)}function Ne(){if(x==="")return;let u=null;if(typeof h.subLanguage=="string"){if(!t[h.subLanguage]){A.addText(x);return}u=m(h.subLanguage,x,!0,wt[h.subLanguage]),wt[h.subLanguage]=u._top}else u=L(x,h.subLanguage.length?h.subLanguage:null);h.relevance>0&&($e+=u.relevance),A.__addSublanguage(u._emitter,u.language)}function H(){h.subLanguage!=null?Ne():X(),x=""}function W(u,p){u!==""&&(A.startScope(p),A.addText(u),A.endScope())}function yt(u,p){let b=1,S=p.length-1;for(;b<=S;){if(!u._emit[b]){b++;continue}let R=z.classNameAliases[u[b]]||u[b],G=p[b];R?W(G,R):(x=G,X(),x=""),b++}}function St(u,p){return u.scope&&typeof u.scope=="string"&&A.openNode(z.classNameAliases[u.scope]||u.scope),u.beginScope&&(u.beginScope._wrap?(W(x,z.classNameAliases[u.beginScope._wrap]||u.beginScope._wrap),x=""):u.beginScope._multi&&(yt(u.beginScope,p),x="")),h=Object.create(u,{parent:{value:h}}),h}function Mt(u,p,b){let S=mr(u.endRe,b);if(S){if(u["on:end"]){let R=new ke(u);u["on:end"](p,R),R.isMatchIgnored&&(S=!1)}if(S){for(;u.endsParent&&u.parent;)u=u.parent;return u}}if(u.endsWithParent)return Mt(u.parent,p,b)}function Gn(u){return h.matcher.regexIndex===0?(x+=u[0],1):(Ve=!0,0)}function Kn(u){let p=u[0],b=u.rule,S=new ke(b),R=[b.__beforeBegin,b["on:begin"]];for(let G of R)if(G&&(G(u,S),S.isMatchIgnored))return Gn(p);return b.skip?x+=p:(b.excludeBegin&&(x+=p),H(),!b.returnBegin&&!b.excludeBegin&&(x=p)),St(b,u),b.returnBegin?0:p.length}function Zn(u){let p=u[0],b=g.substring(u.index),S=Mt(h,u,b);if(!S)return Bt;let R=h;h.endScope&&h.endScope._wrap?(H(),W(p,h.endScope._wrap)):h.endScope&&h.endScope._multi?(H(),yt(h.endScope,u)):R.skip?x+=p:(R.returnEnd||R.excludeEnd||(x+=p),H(),R.excludeEnd&&(x=p));do h.scope&&A.closeNode(),!h.skip&&!h.subLanguage&&($e+=h.relevance),h=h.parent;while(h!==S.parent);return S.starts&&St(S.starts,u),R.returnEnd?0:p.length}function Xn(){let u=[];for(let p=h;p!==z;p=p.parent)p.scope&&u.unshift(p.scope);u.forEach(p=>A.openNode(p))}let Re={};function xt(u,p){let b=p&&p[0];if(x+=u,b==null)return H(),0;if(Re.type==="begin"&&p.type==="end"&&Re.index===p.index&&b===""){if(x+=g.slice(p.index,p.index+1),!o){let S=new Error(`0 width match regex (${l})`);throw S.languageName=l,S.badRule=Re.rule,S}return 1}if(Re=p,p.type==="begin")return Kn(p);if(p.type==="illegal"&&!E){let S=new Error('Illegal lexeme "'+b+'" for mode "'+(h.scope||"<unnamed>")+'"');throw S.mode=h,S}else if(p.type==="end"){let S=Zn(p);if(S!==Bt)return S}if(p.type==="illegal"&&b==="")return p.index===g.length||(x+=`
|
|
69
|
+
`),1;if(Xe>1e5&&Xe>p.index*3)throw new Error("potential infinite loop, way more iterations than matches");return x+=b,b.length}let z=N(l);if(!z)throw ne(s.replace("{}",l)),new Error('Unknown language: "'+l+'"');let Vn=Xr(z),Ze="",h=M||Vn,wt={},A=new c.__emitter(c);Xn();let x="",$e=0,te=0,Xe=0,Ve=!1;try{if(z.__emitTokens)z.__emitTokens(g,A);else{for(h.matcher.considerAll();;){Xe++,Ve?Ve=!1:h.matcher.considerAll(),h.matcher.lastIndex=te;let u=h.matcher.exec(g);if(!u)break;let p=g.substring(te,u.index),b=xt(p,u);te=u.index+b}xt(g.substring(te))}return A.finalize(),Ze=A.toHTML(),{language:l,value:Ze,relevance:$e,illegal:!1,_emitter:A,_top:h}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:l,value:Je(g),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:te,context:g.slice(te-100,te+100),mode:u.mode,resultSoFar:Ze},_emitter:A};if(o)return{language:l,value:Je(g),illegal:!1,relevance:0,errorRaised:u,_emitter:A,_top:h};throw u}}function _(l){let g={value:Je(l),illegal:!1,relevance:0,_top:i,_emitter:new c.__emitter(c)};return g._emitter.addText(l),g}function L(l,g){g=g||c.languages||Object.keys(t);let E=_(l),M=g.filter(N).filter(Q).map(H=>m(H,l,!1));M.unshift(E);let C=M.sort((H,W)=>{if(H.relevance!==W.relevance)return W.relevance-H.relevance;if(H.language&&W.language){if(N(H.language).supersetOf===W.language)return 1;if(N(W.language).supersetOf===H.language)return-1}return 0}),[P,X]=C,Ne=P;return Ne.secondBest=X,Ne}function w(l,g,E){let M=g&&n[g]||E;l.classList.add("hljs"),l.classList.add(`language-${M}`)}function v(l){let g=null,E=d(l);if(a(E))return;if(ee("before:highlightElement",{el:l,language:E}),l.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",l);return}if(l.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(l)),c.throwUnescapedHTML))throw new nt("One of your code blocks includes unescaped HTML.",l.innerHTML);g=l;let M=g.textContent,C=E?f(M,{language:E,ignoreIllegals:!0}):L(M);l.innerHTML=C.value,l.dataset.highlighted="yes",w(l,E,C.language),l.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(l.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),ee("after:highlightElement",{el:l,result:C,text:M})}function k(l){c=Dt(c,l)}let J=()=>{j(),de("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ce(){j(),de("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Z=!1;function j(){function l(){j()}if(document.readyState==="loading"){Z||window.addEventListener("DOMContentLoaded",l,!1),Z=!0;return}document.querySelectorAll(c.cssSelector).forEach(v)}function Ee(l,g){let E=null;try{E=g(e)}catch(M){if(ne("Language definition for '{}' could not be registered.".replace("{}",l)),o)ne(M);else throw M;E=i}E.name||(E.name=l),t[l]=E,E.rawDefinition=g.bind(null,e),E.aliases&&ce(E.aliases,{languageName:l})}function q(l){delete t[l];for(let g of Object.keys(n))n[g]===l&&delete n[g]}function _e(){return Object.keys(t)}function N(l){return l=(l||"").toLowerCase(),t[l]||t[n[l]]}function ce(l,{languageName:g}){typeof l=="string"&&(l=[l]),l.forEach(E=>{n[E.toLowerCase()]=g})}function Q(l){let g=N(l);return g&&!g.disableAutodetect}function Ae(l){l["before:highlightBlock"]&&!l["before:highlightElement"]&&(l["before:highlightElement"]=g=>{l["before:highlightBlock"](Object.assign({block:g.el},g))}),l["after:highlightBlock"]&&!l["after:highlightElement"]&&(l["after:highlightElement"]=g=>{l["after:highlightBlock"](Object.assign({block:g.el},g))})}function I(l){Ae(l),r.push(l)}function ae(l){let g=r.indexOf(l);g!==-1&&r.splice(g,1)}function ee(l,g){let E=l;r.forEach(function(M){M[E]&&M[E](g)})}function ye(l){return de("10.7.0","highlightBlock will be removed entirely in v12.0"),de("10.7.0","Please use highlightElement now."),v(l)}Object.assign(e,{highlight:f,highlightAuto:L,highlightAll:j,highlightElement:v,highlightBlock:ye,configure:k,initHighlighting:J,initHighlightingOnLoad:Ce,registerLanguage:Ee,unregisterLanguage:q,listLanguages:_e,getLanguage:N,registerAliases:ce,autoDetection:Q,inherit:Dt,addPlugin:I,removePlugin:ae}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Yr,e.regex={concat:re,lookahead:qt,either:He,optional:gr,anyNumberOfTimes:fr};for(let l in Oe)typeof Oe[l]=="object"&&Pt(Oe[l]);return Object.assign(e,Oe),e},fe=Vt({});fe.newInstance=()=>Vt({});Yt.exports=fe;fe.HighlightJS=fe;fe.default=fe});function $(e,t){return(t||document).querySelector(e)}function y(e,t){return Array.from((t||document).querySelectorAll(e))}function U(e,t,n,r){typeof n=="function"?e.addEventListener(t,n):e.addEventListener(t,function(o){let s=o.target.closest(n);s&&e.contains(s)&&r&&r.call(s,o)})}var cr={"&":"&","<":"<",">":">",'"':""","'":"'"};function T(e){return e.replace(/[&<>"']/g,t=>cr[t])}function Tt(e){return le(this,null,function*(){let t=new TextEncoder().encode(e),n=yield crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(n,0,4),r=>r.toString(16).padStart(2,"0")).join("")})}var ar=90,lr=75;function F(e){return e>=ar?"green":e>=lr?"yellow":"red"}function O(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function D(e){return(Math.floor(e*100)/100).toFixed(2)}function Ct(e){return"g-"+e.replace(/[^a-zA-Z0-9-]/gu,t=>`_${t.codePointAt(0).toString(16)}_`)}var At=[[31536e3,"year"],[2592e3,"month"],[86400,"day"],[3600,"hour"],[60,"minute"],[1,"second"]];function Nt(e){let t=Math.floor((Date.now()-e.getTime())/1e3);for(let[n,r]of At){let o=Math.floor(t/n);if(o>=1)return o===1?`about 1 ${r} ago`:`${o} ${r}s ago`}return"just now"}function Rt(e){let t=(Date.now()-e.getTime())/1e3;for(let[n]of At){let r=Math.floor(t/n);if(r>=1){let o=(r+1)*n;return Math.max((o-t)*1e3+500,1e3)}}return 1e3}var Ye=new Map;function ue(e){let t=Ye.get(e);if(t===void 0)throw new Error(`File ID was not precomputed for ${e}`);return t}function $t(e){return le(this,null,function*(){Ye.clear();let t=[...new Set(e)],n=yield Promise.all(t.map(Tt)),r=new Map;t.forEach((o,s)=>{let i=n[s],c=r.get(i)||[];c.push(o),r.set(i,c)});for(let[o,s]of r)s.sort().forEach((i,c)=>{Ye.set(i,c===0?o:`${o}-${c}`)})})}var Qt=sr(Jt(),1);var ge=Qt.default;function en(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},d=[e.COMMENT("#","$",{contains:[c]}),e.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:i},m={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},_="[1-9](_?[0-9])*|0",L="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${_})(\\.(${L}))?([eE][+-]?(${L})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},q=[m,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:i},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,d),relevance:0}].concat(a,d);f.contains=q,v.contains=q;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:q}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:i,contains:q}}];return d.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(q)}}function tn(e){return{name:"HAML",case_insensitive:!0,contains:[{className:"meta",begin:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",relevance:10},e.COMMENT("^\\s*(!=#|=#|-#|/).*$",null,{relevance:0}),{begin:"^\\s*(-|=|!=)(?!#)",end:/$/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:"^\\s*%",contains:[{className:"selector-tag",begin:"\\w+"},{className:"selector-id",begin:"#[\\w-]+"},{className:"selector-class",begin:"\\.[\\w-]+"},{begin:/\{\s*/,end:/\s*\}/,contains:[{begin:":\\w+\\s*=>",end:",\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:":\\w+"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]},{begin:"\\(\\s*",end:"\\s*\\)",excludeEnd:!0,contains:[{begin:"\\w+\\s*=",end:"\\s+",returnBegin:!0,endsWithParent:!0,contains:[{className:"attr",begin:"\\w+",relevance:0},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{begin:"\\w+",relevance:0}]}]}]},{begin:"^\\s*[=~]\\s*"},{begin:/#\{/,end:/\}/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0}]}}var Qr={endsWithParent:!0,relevance:0,contains:[{className:"attr",begin:/[A-Za-z_:][-A-Za-z0-9_:.]*/,relevance:0},{className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]}]};function it(e){return{name:"ERB",contains:[e.COMMENT("<%#","%>"),{begin:/<%[%=-]?/,end:/[%-]?%>/,subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0},{className:"tag",begin:/<\/?(?=[A-Za-z])/,end:/\/?>/,contains:[{className:"name",begin:/[A-Za-z][^\s/>]*/,relevance:0,starts:Qr}]}]}}function st(e){return{name:"Slim",contains:[e.COMMENT(/^\s*\/!?/,/$/),{begin:/^\s*(?:-|={1,2})[<>']*/,end:/$/,subLanguage:"ruby",excludeBegin:!0,relevance:0},{className:"name",begin:/^\s*[A-Za-z][A-Za-z0-9_-]*/,relevance:0,starts:{end:/\s/,relevance:0,contains:[{className:"selector-class",begin:/\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}},{className:"selector-class",begin:/^\s*\.[A-Za-z][A-Za-z0-9_-]*/,relevance:0},{className:"selector-id",begin:/^\s*#[A-Za-z][A-Za-z0-9_-]*/,relevance:0}]}}function eo(e){if(e==="oneshot_line")return"line";if(e==="line"||e==="branch"||e==="method")return e}function nn(e){let t=eo(e.primary_coverage);return t==="branch"&&e.branch_coverage||t==="method"&&e.method_coverage?t:e.line_coverage?"line":e.branch_coverage?"branch":"method"}function to(e,t){return t==="line"?e.lines:t==="branch"?e.branches:e.methods}function Be(e,t){return to(e,t)||e.lines||e.branches||e.methods}function Pe(e,t){let n=Array.from({length:t},()=>[]);for(let[r,o]of Object.entries(e||{})){let s=Number(r);Array.from(o).reverse().forEach((i,c)=>{let a=parseInt(i,16);for(let d of[0,1,2,3]){if(!(a&1<<d))continue;let f=c*4+d;f<t&&n[f].push(s)}})}return{perLine:n}}function rn(e,t){if(!t)return 0;let n=[];for(let o of Object.values(e||{}))Array.from(o).reverse().forEach((s,i)=>{n[i]=(n[i]||0)|parseInt(s,16)});let r=0;return t.forEach((o,s)=>{typeof o!="number"||o<=0||(n[s>>2]||0)&1<<(s&3)||r++}),r}function on(e,t,n){let r=e.perLine[n-1];return r?r.map(o=>t[o]).sort():[]}function at(e,t){let n=F(e);return t?`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n} coverage-bar__fill--split" style="width: ${D(e-t)}%"></div><div class="coverage-bar__fill coverage-bar__fill--outside" style="width: ${D(t)}%"></div></div></div>`:`<div class="bar-sizer"><div class="coverage-bar"><div class="coverage-bar__fill coverage-bar__fill--${n}" style="width: ${D(e)}%"></div></div></div>`}function oe(e,t,n,r,o,s){let i=F(e),c=D(e),a=s===void 0||n===0?void 0:s*100/n,d=`<div class="coverage-cell">${at(e,a)}<span class="coverage-pct">${c}%</span></div>`;if(o)return`<td class="cell--coverage strong t-totals__${r}-pct ${i}">${d}</td><td class="cell--numerator strong t-totals__${r}-num">${O(t)}/</td><td class="cell--denominator strong t-totals__${r}-den">${O(n)}</td>`;let f=a===void 0?"":` data-order-2="${D(e-a)}"`,m=` data-order="${D(e)}"${f}`;return`<td class="cell--coverage cell--${r}-pct ${i}"${m}>${d}</td><td class="cell--numerator" data-order="${t}">${O(t)}/</td><td class="cell--denominator" data-order="${n}">${O(n)}</td>`}function Fe(e,t,n,r){return`<th class="cell--coverage" data-sort-key="${t}-percent">
|
|
70
70
|
<div class="th-with-filter">
|
|
71
71
|
<span class="th-label">${e}</span>
|
|
72
72
|
<div class="col-filter__coverage">
|
|
@@ -76,18 +76,18 @@ https://github.com/highlightjs/highlight.js/issues/2277`),C=l,M=g),E===void 0&&(
|
|
|
76
76
|
</div>
|
|
77
77
|
</th>
|
|
78
78
|
<th class="cell--numerator" data-sort-key="${t}-covered">${n}</th>
|
|
79
|
-
<th class="cell--denominator" data-sort-key="${t}-total">${r}</th>`}function ct(e){let{type:t,label:n,covered:r,total:o,enabled:
|
|
79
|
+
<th class="cell--denominator" data-sort-key="${t}-total">${r}</th>`}function sn(e,t,n){return n!==void 0?n:t>0?e*100/t:100}function ct(e){let{type:t,label:n,covered:r,total:o,enabled:s,toggle:i}=e;if(!s)return`<div class="t-${t}-summary">
|
|
80
80
|
${n}: <span class="coverage-disabled">disabled</span>
|
|
81
|
-
</div>`;let c=o-r,a=
|
|
82
|
-
${n}: <span class="${d}"><b>${D(a)}%</b></span><span class="coverage-cell__fraction"> ${r}/${o} ${f}</span>`;if(c>0){let L=
|
|
81
|
+
</div>`;let c=o-r,a=sn(r,o,e.percent),d=F(a),f=e.suffix||"covered",m=e.missedClass||"red",_=`<div class="t-${t}-summary">
|
|
82
|
+
${n}: <span class="${d}"><b>${D(a)}%</b></span><span class="coverage-cell__fraction"> ${r}/${o} ${f}</span>`;if(c>0){let L=i?`<a href="#" class="t-missed-method-toggle"><b>${c}</b> missed</a>`:`<span class="${m}"><b>${c}</b> missed</span>`;_+=`<span class="coverage-cell__fraction">,</span>
|
|
83
83
|
${L}`}return _+=`
|
|
84
|
-
</div>`,_}function
|
|
85
|
-
Line coverage: <span class="${F(
|
|
86
|
-
<span class="coverage-cell__fraction outside-tests-text">${r}/${t} relevant lines covered outside tests</span>`),i>0&&(
|
|
87
|
-
<span class="red"><b>${i}</b> missed</span>`),
|
|
88
|
-
</div>`}function
|
|
84
|
+
</div>`,_}function no(e,t,n,r,o){let s=sn(e,t,o),i=t-e,c=`<div class="t-line-summary">
|
|
85
|
+
Line coverage: <span class="${F(s)}"><b>${D(s)}%</b></span><span class="coverage-cell__fraction"> ${n}/${t} relevant lines covered by tests</span>`;return r>0&&(c+=`<span class="coverage-cell__fraction">,</span>
|
|
86
|
+
<span class="coverage-cell__fraction outside-tests-text">${r}/${t} relevant lines covered outside tests</span>`),i>0&&(c+=`<span class="coverage-cell__fraction">,</span>
|
|
87
|
+
<span class="red"><b>${i}</b> missed</span>`),c+`
|
|
88
|
+
</div>`}function cn(e){return'<div class="summary-stats">'+(e.coveredByTests===void 0||!e.lineCoverage?ct({type:"line",label:"Line coverage",covered:e.coveredLines,total:e.totalLines,enabled:e.lineCoverage,percent:e.linePercent,suffix:"relevant lines covered"}):no(e.coveredLines,e.totalLines,e.coveredByTests,e.coveredOutsideTests||0,e.linePercent))+ct({type:"branch",label:"Branch coverage",covered:e.coveredBranches,total:e.totalBranches,enabled:e.branchCoverage,percent:e.branchPercent,missedClass:"missed-branch-text"})+ct({type:"method",label:"Method coverage",covered:e.coveredMethods,total:e.totalMethods,enabled:e.methodCoverage,percent:e.methodPercent,missedClass:"missed-method-text-color",toggle:e.showMethodToggle})+"</div>"}function ro(e,t){let{containerId:n,title:r,filenames:o,stats:s,lineCoverage:i,branchCoverage:c,methodCoverage:a,primaryCoverage:d}=e,f=i?s.lines:void 0,m=c?s.branches:void 0,_=a?s.methods:void 0,L=Be(s,d),w=L?L.percent:100,v=[`<div class="file_list_container" id="${n}" data-total-files="${o.length}">`,`<span class="group_name hide">${T(r)}</span>`,`<span class="covered_percent hide"><span class="${F(w)}">${D(w)}%</span></span>`,'<div class="file_list--responsive"><table class="file_list"><thead><tr>','<th class="cell--left" data-sort-key="file"><div class="th-with-filter"><span class="th-label">File Name</span><input type="search" class="col-filter col-filter--name" placeholder="Filter paths\u2026"></div></th>'];f&&v.push(Fe("Line Coverage","line","Covered","Lines")),c&&v.push(Fe("Branch Coverage","branch","Covered","Branches")),a&&v.push(Fe("Method Coverage","method","Covered","Methods")),e.production&&v.push('<th class="cell--production" data-sort-key="production"><span class="th-label">Last Run in Production</span></th>'),v.push("</tr>");let k=o.length===1?"file":"files";return v.push(`<tr class="totals-row"><td class="strong t-file-count">${O(o.length)} ${k}</td>`),f&&v.push(oe(f.percent,f.covered,f.total,"line",!0,t)),m&&v.push(oe(m.percent,m.covered,m.total,"branch",!0)),_&&v.push(oe(_.percent,_.covered,_.total,"method",!0)),e.production&&v.push('<td class="cell--production"></td>'),v.push("</tr></thead><tbody>"),v.join("")}function oo(e,t){let n=t.files[e];if(!n)return'<td class="cell--production t-file__production t-file__production--never" data-order="-1">never</td>';let r=String(n.last_seen),o=Date.parse(r);return Number.isNaN(o)?'<td class="cell--production t-file__production" data-order="0">ran</td>':`<td class="cell--production t-file__production" data-order="${o}"><abbr class="timeago" title="${T(r)}">${T(r.slice(0,10))}</abbr></td>`}function io(e){let{filename:t,coverage:n,lineCoverage:r,branchCoverage:o,methodCoverage:s,outsideLines:i,production:c}=e,a=ue(t),d=[];r&&(d.push(`data-covered-lines="${n.covered_lines||0}"`,`data-relevant-lines="${n.total_lines||0}"`),i!==void 0&&d.push(`data-covered-outside-lines="${i}"`)),o&&d.push(`data-covered-branches="${n.covered_branches||0}"`,`data-total-branches="${n.total_branches||0}"`),s&&d.push(`data-covered-methods="${n.covered_methods||0}"`,`data-total-methods="${n.total_methods||0}"`);let f=[`<tr class="t-file" ${d.join(" ")}>`,`<td class="strong t-file__name"><a href="#${a}" class="src_link" title="${T(t)}">${T(t)}</a></td>`];if(r){let m=n.lines_covered_percent===void 0?100:n.lines_covered_percent;f.push(oe(m,n.covered_lines||0,n.total_lines||0,"line",!1,i))}if(o){let m=n.branches_covered_percent===void 0?100:n.branches_covered_percent;f.push(oe(m,n.covered_branches||0,n.total_branches||0,"branch",!1))}if(s){let m=n.methods_covered_percent===void 0?100:n.methods_covered_percent;f.push(oe(m,n.covered_methods||0,n.total_methods||0,"method",!1))}return c&&f.push(oo(t,c)),f.push("</tr>"),f.join("")}function lt(e){let{filenames:t,allCoverage:n,lineCoverage:r,branchCoverage:o,methodCoverage:s,contextsEnabled:i,production:c}=e,a=i&&r?new Map(t.flatMap(m=>{let _=n[m];return _?[[m,rn(_.contexts,_.lines)]]:[]})):void 0,d=a?[...a.values()].reduce((m,_)=>m+_,0):void 0,f=[ro(e,d)];for(let m of t){let _=n[m];_&&f.push(io({filename:m,coverage:_,lineCoverage:r,branchCoverage:o,methodCoverage:s,outsideLines:a==null?void 0:a.get(m),production:c}))}return f.push("</tbody></table></div></div>"),f.join("")}function so(e){let{lineIndex:t,lineCov:n,branchesReport:r,missedMethodLines:o,branchCoverage:s,methodCoverage:i}=e,c=t+1;if(n==="ignored")return"skipped";if(s){let a=r[c];if(a&&a.some(([,d])=>d===0))return"missed-branch"}return i&&o.has(c)?"missed-method":n==null?"never":n===0?"missed":"covered"}function co(e){let t={};if(!e)return t;for(let{coverage:n,report_line:r,type:o}of e){if(n==="ignored")continue;(t[r]||(t[r]=[])).push([o,n])}return t}function ao(e){let t=new Set;if(!e)return t;for(let n of e)if(n.coverage===0&&n.start_line&&n.end_line)for(let r=n.start_line;r<=n.end_line;r++)t.add(r);return t}var lo={erb:"erb",haml:"haml",slim:"slim"};function uo(e){return lo[e.split(".").pop().toLowerCase()]||"ruby"}function fo(e){let{index:t,source:n,language:r,lineCov:o,status:s,branchCoverage:i,lineBranches:c,testCount:a,productionRan:d}=e,f=t+1,m=typeof o=="number"?o:null,_=m===null?"":` data-hits="${m}"`,w=[`<li class="${s}${d===void 0?"":d?" production-ran":" production-never"}"${_} data-linenumber="${f}">`];if(m?w.push(`<span class="hits" data-content="${m}"></span>`):o==="ignored"&&w.push('<span class="hits" data-content="skipped"></span>'),d&&o===0&&w.push('<span class="hits hits--production" data-content="runs in production"></span>'),a!==void 0){let v=a===0?" hits--tests-none":"",k=a===1?"1 test":`${a} tests`;w.push(`<button type="button" class="hits hits--tests${v}" data-content="${k}" data-tests-line="${f}" title="List the tests covering this line" aria-expanded="false"></button>`)}if(i&&c)for(let[v,k]of c){let J=T(v);w.push(`<span class="hits" data-content="${J}: ${k}" title="${J} branch hit ${k} times"></span>`)}return w.push(`<code class="${r}">${T(n)}</code></li>`),w.join("")}function go(e,t,n){let r=`<div class="t-production-summary">
|
|
89
89
|
Production: <b>${e}</b>/${t} relevant lines ran`,o=n&&n.last_seen;return o&&(r+=`<span class="coverage-cell__fraction">, last run <span title="${T(o)}">${T(o.slice(0,10))}</span></span>`),r+`
|
|
90
|
-
</div>`}function cn(e,t,n,r,o,i,s){var ce,Q,Ae;let c=ue(e),a=n&&t.covered_lines||0,d=n&&t.total_lines||0,f=r&&t.covered_branches||0,m=r&&t.total_branches||0,_=o&&t.covered_methods||0,L=o&&t.total_methods||0,x=(Q=(ce=t.methods)==null?void 0:ce.filter(I=>I.coverage===0))!=null?Q:[],v=o&&x.length>0,k=io(t.branches),J=co(t.methods),Ce=lo(e),Z=i?Pe(t.contexts,t.source.length):null,j=0,Ee=s===void 0?null:new Set(s==null?void 0:s.lines),q=0,_e=[];for(let I=0;I<t.source.length;I++){let ae=(Ae=t.lines)==null?void 0:Ae[I],ee=typeof ae=="number"?ae:null,ye=so({lineIndex:I,lineCov:ae,branchesReport:k,missedMethodLines:J,branchCoverage:r,methodCoverage:o}),l;Z&&ee&&(l=Z.perLine[I].length,l===0&&(j++,ye==="covered"&&(ye="outside-tests")));let g;Ee&&ee!==null&&(g=Ee.has(I+1),g&&q++),_e.push(uo({index:I,source:t.source[I],language:Ce,lineCov:ae,status:ye,branchCoverage:r,lineBranches:r?k[I+1]:void 0,testCount:l,productionRan:g}))}let N=[`<div class="source_table" id="${c}">`,'<div class="header">',`<h2>${T(e)}</h2>`,sn({coveredLines:a,totalLines:d,coveredBranches:f,totalBranches:m,coveredMethods:_,totalMethods:L,lineCoverage:n,branchCoverage:r,methodCoverage:o,showMethodToggle:v,coveredByTests:Z?a-j:void 0,coveredOutsideTests:Z?j:void 0})];return s!==void 0&&N.push('<div class="summary-stats summary-stats--production">',fo(q,d,s),"</div>"),v&&N.push('<div class="t-missed-method-list" style="display: none"><ul>',x.map(I=>`<li><tt>${T(I.name)}</tt></li>`).join(""),"</ul></div>"),N.push("</div>","<pre><ol>"),N.push(..._e),N.push("</ol></pre></div>"),N.join("")}ge.registerLanguage("ruby",en);ge.registerLanguage("erb",st);ge.registerLanguage("haml",tn);ge.registerLanguage("slim",it);var an;function we(){let e=getComputedStyle(document.documentElement).getPropertyValue(`--${an}`).trim(),t=document.createElement("canvas");t.width=t.height=16;let n=t.getContext("2d");if(!e||!n)return;n.fillStyle=e,n.fillRect(0,0,16,16);let r=document.querySelector('link[rel="icon"]');r||(r=document.createElement("link"),r.rel="icon",r.type="image/png",document.head.appendChild(r)),r.href=t.toDataURL("image/png")}var ln;function un(){return ln}var go=3;function po(e){let t=e.command_names&&e.command_names.length?e.command_names:[e.command_name];return t.length<=go?T(t.join(", ")):`<details class="footer-runs"><summary>${T(t[0])} and ${t.length-1} other runs</summary><span class="footer-runs__list">${T(t.join(", "))}</span></details>`}function dn(e){let t=e.meta,n=t.line_coverage,r=t.branch_coverage,o=t.method_coverage,i=nn(t);document.title=`Code coverage for ${t.project_name}`;let s=Object.keys(e.coverage),c=Be(e.total,i),a=c&&c.total>0?c.percent:100;an=F(a),we(),r&&document.body.setAttribute("data-branch-coverage","true");let d=document.getElementById("content"),f=[lt({containerId:"g-total",title:"All Files",filenames:s,stats:e.total,allCoverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,primaryCoverage:i,contextsEnabled:!!e.contexts,production:e.production})];for(let v of Object.keys(e.groups)){let k=e.groups[v];f.push(lt({containerId:Ct(`group-${v}`),title:v,filenames:k.files||[],stats:k,allCoverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,primaryCoverage:i,contextsEnabled:!!e.contexts,production:e.production}))}d.innerHTML=f.join("");let m={};for(let v of s)m[ue(v)]=v;ln={idToFilename:m,coverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,contexts:e.contexts||null,production:e.production||null};let _=new Date(t.timestamp),L=`Generated <abbr class="timeago" title="${_.toISOString()}">${_.toISOString()}</abbr> by <a href="https://github.com/simplecov-ruby/simplecov">simplecov</a> v${T(t.simplecov_version)} using ${po(t)}`;document.getElementById("footer").innerHTML=L,document.getElementById("source-dialog-footer").innerHTML=L;let x=[];if(n){let v=e.contexts?[K("covered","Covered by tests"),K("outside-tests","Covered outside tests")]:[K("covered","Covered")];x.push(qe("line",[...v,K("skipped","Skipped"),K("missed","Missed line")]))}e.production&&n&&x.push(qe("production",[K("production-never","Never ran in production"),K("production-ran","Untested, runs in production")])),r&&x.push(qe("branch",[K("missed-branch","Missed branch")])),o&&x.push(qe("method",[K("missed-method","Missed method")])),document.getElementById("source-legend").innerHTML=x.join("")}function qe(e,t){return`<div class="source-legend__row source-legend__row--${e}">${t.join("")}</div>`}function K(e,t){return`<span class="source-legend__item"><span class="source-legend__swatch source-legend__swatch--${e}"></span>${t}</span>`}function fn(e){let t=document.getElementById(e);if(t)return t;let{idToFilename:n,coverage:r,lineCoverage:o,branchCoverage:i,methodCoverage:s,contexts:c,production:a}=un(),d=n[e];if(!d)return null;let f=cn(d,r[d],o,i,s,c||void 0,a?a.files[d]||null:void 0),m=document.querySelector(".source_files"),_=document.createElement("div");_.innerHTML=f;let L=_.firstElementChild;return m.appendChild(L),y("pre code",L).forEach(x=>ge.highlightElement(x)),L}function gn(e,t){let{contexts:n,idToFilename:r,coverage:o}=un();if(!n)return null;let i=r[e];if(!i)return null;let s=o[i],c=Pe(s.contexts,s.source.length);return on(c,n,t)}var ut=1e3,mo="t-window-hidden",pn=new WeakSet;function ho(e,t){let n=e.querySelector("tr.t-show-all");if(!n){n=document.createElement("tr"),n.className="t-show-all";let r=document.createElement("td");r.colSpan=t,n.appendChild(r),n.addEventListener("click",o=>{o.preventDefault(),pn.add(e),pe(e.closest("table"))})}return n}function pe(e){let t=e.querySelector("tbody");if(!t)return;let n=t.querySelectorAll("tr.t-file"),r=pn.has(t),o=0;if(n.forEach(s=>{let c=s.style.display==="none";c||(o+=1),s.classList.toggle(mo,!r&&!c&&o>ut)}),r||o<=ut){let s=t.querySelector("tr.t-show-all");s&&(s.style.display="none");return}let i=ho(t,n[0].children.length);i.style.removeProperty("display"),i.firstElementChild.innerHTML=`Showing the first ${O(ut)} of ${O(o)} files. <a href="#" class="t-show-all__link">Show all</a>`,t.appendChild(i)}function We(e){try{return localStorage.getItem(e)}catch(t){return null}}function xe(e,t){try{localStorage.setItem(e,t)}catch(n){}}var ft=new WeakMap,vn="simplecov-sort";function bo(){var e;try{return(e=JSON.parse(String(We(vn))))!=null?e:{}}catch(t){return{}}}function vo(){let e=bo();return e.direction!=="asc"&&e.direction!=="desc"?null:{column:e.column,direction:e.direction}}function Eo(e){xe(vn,JSON.stringify(e))}function _o(e,t){let n=0,r=e.children;for(let o=0;o<r.length;o++)if(r[o].style.display!=="none"){if(n===t)return o;n+=1}return-1}function mn(e){if(!e)return"";let t=e.getAttribute("data-order");if(t!==null)return Number.parseFloat(t);let n=e.textContent.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?n:r}function yo(e){return Number.parseFloat(String(e==null?void 0:e.getAttribute("data-order-2")))}var So=new Intl.Collator(void 0,{sensitivity:"accent"});function hn(e,t){return typeof e=="number"&&typeof t=="number"?e-t:So.compare(String(e),String(t))}function En(e,t,n){let r=e.map(i=>({row:i,value:mn(i.children[t]),tiebreak:yo(i.children[t]),filename:mn(i.children[0])})),o=(i,s)=>hn(i.value,s.value)||i.tiebreak-s.tiebreak||hn(i.filename,s.filename);return r.sort(n==="asc"?o:(i,s)=>o(s,i)),r.map(({row:i})=>i)}function dt(e,t,n){ft.set(e,{colIndex:t,direction:n});let r=0;y("thead tr:first-child th",e).forEach(o=>{let i=Number.parseInt(o.getAttribute("colspan")||"1",10);o.classList.remove("sorting_asc","sorting_desc","sorting");let s=t>=r&&t<r+i;o.classList.add(s?n==="asc"?"sorting_asc":"sorting_desc":"sorting"),r+=i})}function _n(e,t){let n=document.createDocumentFragment();t.forEach(r=>n.appendChild(r)),e.appendChild(n)}function bn(e,t,n){let r=ft.get(e),o=e.querySelector("tbody"),i=Array.from(o.querySelectorAll("tr.t-file"));if(i.length===0){dt(e,t,n);return}r&&r.colIndex===t?i.reverse():i=En(i,_o(i[0],t),n),_n(o,i),pe(e),dt(e,t,n)}var Mo=500,me=null;function wo(){me||(me=document.createElement("div"),me.id="sort-overlay",me.innerHTML='<span id="sort-overlay-label">Sorting\u2026</span>',document.body.appendChild(me));let e=me;return e.style.transition="none",e.style.opacity="1",e.style.display="flex",e}function xo(e){e.style.transition="opacity 0.15s",e.style.opacity="0",setTimeout(()=>{e.style.display="none"},150)}function Lo(e,t){let n=yn(e,t),r=ft.get(e),o=r&&r.colIndex===n&&r.direction==="asc"?"desc":"asc",i=t.getAttribute("data-sort-key");if(i&&Eo({column:i,direction:o}),e.querySelectorAll("tbody tr.t-file").length<Mo){bn(e,n,o);return}let c=wo();requestAnimationFrame(()=>requestAnimationFrame(()=>{bn(e,n,o),xo(c)}))}function yn(e,t){let n=0;for(let r of y("thead tr:first-child th",e)){let o=Number.parseInt(r.getAttribute("colspan")||"1",10);if(r===t)return n+o-1;n+=o}return n}function To(e,t){let n=Array.from(e.children),r=n.findIndex(i=>i.classList.contains(`cell--${t}-pct`)),o=r===-1?n.findIndex(i=>i.hasAttribute("data-order")):r;return o===-1?null:o}function Co(e,t,n){let r=e.querySelector("tbody");if(!r)return;let o=Array.from(r.querySelectorAll("tr.t-file"));if(o.length===0)return;let i=n&&y("thead tr:first-child th[data-sort-key]",e).find(a=>a.getAttribute("data-sort-key")===n.column),s=i?yn(e,i):To(o[0],t);if(s===null)return;let c=i?n.direction:"asc";_n(r,En(o,s,c)),dt(e,s,c)}function Sn(e){let t=vo();y("table.file_list").forEach(n=>{y("thead tr:first-child th",n).forEach(r=>{r.classList.add("sorting"),r.style.cursor="pointer",r.addEventListener("click",()=>Lo(n,r))}),Co(n,e,t),pe(n)})}var Le=null;function ze(){Le=null}function Mn(){if(Le)return Le;let e=y(".file_list_container").filter(t=>t.style.display!=="none");return e.length?(Le=y("tbody tr.t-file",e[0]).filter(t=>t.style.display!=="none"),Le):[]}var Ao=240,No=160;function wn(e,t){e.style.setProperty("--bar-sizer-width",t+"px")}var Ro=8;function $o(e,t){let n=No,r=Ao;for(;r-n>Ro;){let o=Math.ceil((n+r)/2);wn(e,o),e.offsetWidth,e.scrollWidth<=t?n=o:r=o-1}return n}function pt(){y(".file_list_container").forEach(e=>{if(e.style.display==="none"||e.offsetWidth===0)return;let t=$("table.file_list",e);if(!t||!$(".bar-sizer",t))return;let n=t.closest(".file_list--responsive");n&&(n.style.visibility="hidden",wn(t,$o(t,n.clientWidth)),n.style.visibility="")})}var gt=0;function he(){gt||(gt=requestAnimationFrame(()=>{gt=0,pt()}))}var Ue={line:{covered:"coveredLines",total:"relevantLines"},branch:{covered:"coveredBranches",total:"totalBranches"},method:{covered:"coveredMethods",total:"totalMethods"}};function xn(e){let t=y("tbody tr.t-file",e).filter(i=>i.style.display!=="none");function n(i){return t.reduce((s,c)=>s+(Number(c.dataset[i])||0),0)}let r=$(".t-file-count",e),o=Number(e.getAttribute("data-total-files"));if(r){let i=t.length===1?" file":" files";r.textContent=t.length===o?O(o)+i:O(t.length)+"/"+O(o)+i}for(let i of Object.keys(Ue)){let s=Ue[i],c=i==="line"?n("coveredOutsideLines"):0;Oo(e,`.t-totals__${i}`,n(s.covered),n(s.total),c)}}function Oo(e,t,n,r,o){let i=$(t+"-pct",e),s=$(t+"-num",e),c=$(t+"-den",e);if(r===0){i&&(i.innerHTML="",i.classList.remove("green","yellow","red")),s&&(s.textContent=""),c&&(c.textContent="");return}let a=n*100/r;i&&(i.innerHTML=`<div class="coverage-cell">${at(a,o*100/r)}<span class="coverage-pct">${D(a)}%</span></div>`,i.classList.remove("green","yellow","red"),i.classList.add(F(a))),s&&(s.textContent=O(n)+"/"),c&&(c.textContent=O(r))}var ko={gt:(e,t)=>e>t,gte:(e,t)=>e>=t,eq:(e,t)=>e===t,lte:(e,t)=>e<=t,lt:(e,t)=>e<t};function Io(e,t,n){let r=ko[e];return r?r(t,n):!0}function Ho(e){let t=[];for(let n of y(".col-filter__value",e)){let r=n,o=Number.parseFloat(r.value);if(Number.isNaN(o))continue;let i=r.dataset.type,s=i&&Ue[i],c=$(`.col-filter__op[data-type="${i}"]`,e);s&&c&&t.push({attrs:s,op:c.value,threshold:o})}return t}var Ln=new WeakMap;function Do(e){let t=Ln.get(e);return t===void 0&&(t=e.children[0].textContent.toLowerCase(),Ln.set(e,t)),t}function Bo(e){let t=$("table.file_list",e);if(!t)return;let n=$(".col-filter--name",e),r=n?n.value.trim().toLowerCase():"",o=Ho(e);y("tbody tr.t-file",t).forEach(i=>{let s=i,c=(!r||Do(i).includes(r))&&o.every(a=>{let d=Number(s.dataset[a.attrs.covered])||0,f=Number(s.dataset[a.attrs.total])||0,m=f>0?d*100/f:100;return Io(a.op,m,a.threshold)});s.style.display=c?"":"none"}),pe(t),ze(),xn(e),he()}function Cn(e){let t=Number.parseFloat(e.value),n=e.closest(".col-filter__coverage"),r=n?n.querySelector(".col-filter__op"):null;if(!r)return;let o=r.querySelector('option[value="gt"]'),i=r.querySelector('option[value="lt"]');if(o&&(o.disabled=t>=100),i&&(i.disabled=t<=0),r.selectedOptions[0]&&r.selectedOptions[0].disabled){let s=r.querySelector("option:not(:disabled)");s&&(r.value=s.value)}}function Tn(){this.classList.contains("col-filter__value")&&Cn(this),Bo(this.closest(".file_list_container"))}function An(){y(".col-filter__value").forEach(e=>Cn(e)),y(".col-filter--name, .col-filter__op, .col-filter__value, .col-filter__coverage").forEach(e=>{e.addEventListener("click",t=>t.stopPropagation())}),U(document,"input",".col-filter--name, .col-filter__op, .col-filter__value",Tn),U(document,"change",".col-filter__op, .col-filter__value",Tn)}var B=null;function Nn(){return B!==null}function be(e){B&&B.classList.remove("keyboard-focus"),B=e,B&&(B.classList.add("keyboard-focus"),B.scrollIntoView({block:"nearest"}))}function mt(e){let t=Mn();if(!t.length)return;if(!B||t.indexOf(B)===-1){be(e===1?t[0]:t[t.length-1]);return}let n=t.indexOf(B)+e;n>=0&&n<t.length&&be(t[n])}function Rn(){if(!B)return;let e=B.querySelector("a.src_link");e&&(window.location.hash=e.getAttribute("href"))}var Y,se,ht,Te=null,je=null;function bt(){return Y.open}function vt(){return se}function On(){if(!Te)return;je&&(Te.prepend(je),je=null);let e=document.querySelector(".source_files");e&&e.appendChild(Te),Te=null}function Po(e,t){On();let n=fn(e);if(!n)return;let r=n.querySelector(".header");r&&(je=r,ht.innerHTML=r.innerHTML,r.remove()),Te=n,se.appendChild(n),Y.open||Y.showModal(),document.documentElement.style.overflow="hidden",se.focus();let o=se.querySelector(`li[data-linenumber="${t}"]`);o&&(se.scrollTop=o.offsetTop)}function $n(e){if(be(null),ze(),On(),Y.close(),se.innerHTML="",ht.innerHTML="",document.documentElement.style.overflow="",e){let n=document.querySelector(".group_tabs a."+e);n&&(y(".group_tabs li").forEach(r=>r.classList.remove("active")),n.parentElement.classList.add("active"),y(".file_list_container").forEach(r=>r.style.display="none"),document.getElementById(e).style.display="")}let t=document.getElementById("wrapper");t&&!t.classList.contains("hide")&&he()}function Ke(){let e=window.location.hash.substring(1);if(!e){let t=document.querySelector(".group_tabs a");t&&$n(t.getAttribute("href").replace("#",""));return}if(e.charAt(0)==="_")$n(e.substring(1));else{let t=e.split("-L");if(!document.querySelector(".group_tabs li.active")){let n=document.querySelector(".group_tabs li");n&&n.classList.add("active")}Po(t[0],t[1])}}function Ge(){let e=document.querySelector(".group_tabs li.active a");e&&(window.location.hash=e.getAttribute("href").replace("#","#_"))}function kn(){Y=document.getElementById("source-dialog"),se=document.getElementById("source-dialog-body"),ht=document.getElementById("source-dialog-title"),Y.querySelector(".source-dialog__close").addEventListener("click",Ge),Y.addEventListener("click",e=>{e.target===Y&&Ge()})}var ie=null,ve=null;function Fo(e){return e.length===0?'<div class="tests-peek__title">No recorded test covers this line</div><div class="tests-peek__note">It ran outside any test: at load time, in suite setup, or from a helper.</div>':`<div class="tests-peek__title">${e.length===1?"Covered by 1 test":`Covered by ${e.length} tests`}</div><ul class="tests-peek__list">${e.map(n=>`<li><code>${T(n)}</code></li>`).join("")}</ul>`}function Et(){ie&&ie.remove(),ve&&ve.setAttribute("aria-expanded","false"),ie=null,ve=null}function In(e,t){let n=e.closest("li"),r=e.closest(".source_table");if(!n||!r)return;let o=ve===e;if(Et(),o)return;let i=Number(e.getAttribute("data-tests-line")),s=t(r.id,i);if(!s)return;let c=document.createElement("li");c.className="tests-peek",c.innerHTML=Fo(s),n.after(c),e.setAttribute("aria-expanded","true"),ie=c,ve=e}function Hn(){document.addEventListener("keydown",e=>{!ie||e.key!=="Escape"||(e.preventDefault(),e.stopPropagation(),Et())},!0),document.addEventListener("click",e=>{if(!ie)return;let t=e.target;ie.contains(t)||ve.contains(t)||Et()},!0)}function qo(){return y(".source-dialog .source_table li.missed, .source-dialog .source_table li.missed-branch, .source-dialog .source_table li.missed-method")}function _t(e){let t=qo();if(!t.length)return;let n=vt(),r=n.scrollTop+n.clientHeight/2,o=e===1?t.find(i=>i.offsetTop>r)||t[0]:t.findLast(i=>i.offsetTop<r-10)||t[t.length-1];n.scrollTop=o.offsetTop-n.clientHeight/3}function Dn(){U(document,"click",".t-missed-method-toggle",function(e){e.preventDefault();let t=this.closest(".header")||this.closest(".source-dialog__title")||this.closest(".source-dialog__header"),n=t?t.querySelector(".t-missed-method-list"):null;n&&(n.style.display=n.style.display==="none"?"":"none")}),U(document,"click","table.file_list tbody tr",function(){let e=this.querySelector("a.src_link");e&&(window.location.hash=e.getAttribute("href"))}),U(document,"click","button.hits--tests",function(e){e.preventDefault(),In(this,gn)}),U(document,"click",".source-dialog .source_table li[data-linenumber]",function(e){if(e.target.closest(".hits--tests, .tests-peek"))return;e.preventDefault(),vt().scrollTop=this.offsetTop;let t=this.dataset.linenumber,n=window.location.hash.substring(1).replace(/-L.*/,"");window.location.replace(window.location.href.replace(/#.*/,"#"+n+"-L"+t))}),window.addEventListener("hashchange",Ke),Hn()}var Bn="simplecov-dark-mode",Wo="simplecov-colorblind-mode";function zo(){return We(Bn)}function Pn(e){return Array.from(document.querySelectorAll(`[data-toggle="${e}"]`))}function Fn(){let e=Pn("colorblind"),t=document.documentElement,n=()=>{let r=String(t.classList.contains("colorblind-mode"));e.forEach(o=>o.setAttribute("aria-pressed",r))};n(),e.forEach(r=>r.addEventListener("click",()=>{let o=t.classList.toggle("colorblind-mode");xe(Wo,o?"on":"off"),n(),we()}))}function qn(){let e=Pn("dark"),t=document.documentElement;function n(){return t.classList.contains("dark-mode")||!t.classList.contains("light-mode")&&window.matchMedia("(prefers-color-scheme: dark)").matches}function r(){let o=n();e.forEach(i=>{i.textContent=o?"\u2600\uFE0F Light":"\u{1F319} Dark",i.setAttribute("aria-label",o?"Switch to light mode":"Switch to dark mode")})}r(),e.forEach(o=>o.addEventListener("click",()=>{let i=n();t.classList.toggle("light-mode",i),t.classList.toggle("dark-mode",!i),xe(Bn,i?"light":"dark"),r(),we()})),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{zo()||r(),we()})}function Uo(){let e=y(".file_list_container").find(t=>t.style.display!=="none");e&&$(".col-filter--name",e).focus()}function jo(e,t){bt()?(e.preventDefault(),Ge()):t?e.target.blur():be(null)}function Go(e){e.key==="n"&&!e.shiftKey&&(e.preventDefault(),_t(1)),(e.key==="N"||e.key==="n"&&e.shiftKey||e.key==="p")&&(e.preventDefault(),_t(-1))}function Ko(e){e.key==="j"&&(e.preventDefault(),mt(1)),e.key==="k"&&(e.preventDefault(),mt(-1)),e.key==="Enter"&&Nn()&&(e.preventDefault(),Rn())}function Wn(e){let t=e.target instanceof Element&&e.target.matches("input, select, textarea");e.key==="/"&&!t?(e.preventDefault(),Uo()):e.key==="Escape"?jo(e,t):t||(bt()?Go(e):Ko(e))}function zn(){let e=$(".group_tabs");if(!e)return;let t=()=>{e.classList.toggle("is-scrolled",e.scrollLeft>0)};e.addEventListener("scroll",t),window.addEventListener("resize",t),t()}function Un(){let e=1/0;y("abbr.timeago").forEach(t=>{let n=t.getAttribute("title");if(!n)return;let r=new Date(n);Number.isNaN(r.getTime())||(t.textContent=Nt(r),e=Math.min(e,Rt(r)))}),e<1/0&&setTimeout(Un,e)}function Zo(){y(".file_list_container").forEach(e=>e.style.display="none"),y(".file_list_container").forEach(e=>{let t=document.createElement("li");t.setAttribute("role","tab");let n=document.createElement("a");n.href="#"+e.id,n.className=e.id,n.innerHTML=`${e.querySelector(".group_name").innerHTML} (${e.querySelector(".covered_percent").innerHTML})`,t.appendChild(n),document.querySelector(".group_tabs").appendChild(t)}),U(document.querySelector(".group_tabs"),"click","a",function(e){e.preventDefault(),window.location.hash=this.getAttribute("href").replace("#","#_")})}function Xo(e){e.style.transition="opacity 0.3s",e.style.opacity="0",setTimeout(()=>{e.style.display="none"},300),document.getElementById("wrapper").classList.remove("hide"),pt()}function Vo(){return le(this,null,function*(){let e=window.SIMPLECOV_DATA,t=document.getElementById("loading");t.style.display="",yield $t(Object.keys(e.coverage)),dn(e),Un(),qn(),Fn(),Sn(e.meta.primary_coverage),An(),document.addEventListener("keydown",Wn),kn(),Dn(),Zo(),zn(),window.addEventListener("resize",he),Ke(),Xo(t)})}document.addEventListener("DOMContentLoaded",Vo);})();
|
|
90
|
+
</div>`}function an(e,t,n,r,o,s,i){var ce,Q,Ae;let c=ue(e),a=n&&t.covered_lines||0,d=n&&t.total_lines||0,f=r&&t.covered_branches||0,m=r&&t.total_branches||0,_=o&&t.covered_methods||0,L=o&&t.total_methods||0,w=(Q=(ce=t.methods)==null?void 0:ce.filter(I=>I.coverage===0))!=null?Q:[],v=o&&w.length>0,k=co(t.branches),J=ao(t.methods),Ce=uo(e),Z=s?Pe(t.contexts,t.source.length):null,j=0,Ee=i===void 0?null:new Set(i==null?void 0:i.lines),q=0,_e=[];for(let I=0;I<t.source.length;I++){let ae=(Ae=t.lines)==null?void 0:Ae[I],ee=typeof ae=="number"?ae:null,ye=so({lineIndex:I,lineCov:ae,branchesReport:k,missedMethodLines:J,branchCoverage:r,methodCoverage:o}),l;Z&&ee&&(l=Z.perLine[I].length,l===0&&(j++,ye==="covered"&&(ye="outside-tests")));let g;Ee&&ee!==null&&(g=Ee.has(I+1),g&&q++),_e.push(fo({index:I,source:t.source[I],language:Ce,lineCov:ae,status:ye,branchCoverage:r,lineBranches:r?k[I+1]:void 0,testCount:l,productionRan:g}))}let N=[`<div class="source_table" id="${c}">`,'<div class="header">',`<h2>${T(e)}</h2>`,cn({coveredLines:a,totalLines:d,coveredBranches:f,totalBranches:m,coveredMethods:_,totalMethods:L,lineCoverage:n,branchCoverage:r,methodCoverage:o,showMethodToggle:v,coveredByTests:Z?a-j:void 0,coveredOutsideTests:Z?j:void 0,linePercent:n?t.lines_covered_percent:void 0,branchPercent:r?t.branches_covered_percent:void 0,methodPercent:o?t.methods_covered_percent:void 0})];return i!==void 0&&N.push('<div class="summary-stats summary-stats--production">',go(q,d,i),"</div>"),v&&N.push('<div class="t-missed-method-list" style="display: none"><ul>',w.map(I=>`<li><tt>${T(I.name)}</tt></li>`).join(""),"</ul></div>"),N.push("</div>","<pre><ol>"),N.push(..._e),N.push("</ol></pre></div>"),N.join("")}ge.registerLanguage("ruby",en);ge.registerLanguage("erb",it);ge.registerLanguage("haml",tn);ge.registerLanguage("slim",st);var ln;function xe(){let e=getComputedStyle(document.documentElement).getPropertyValue(`--${ln}`).trim(),t=document.createElement("canvas");t.width=t.height=16;let n=t.getContext("2d");if(!e||!n)return;n.fillStyle=e,n.fillRect(0,0,16,16);let r=document.querySelector('link[rel="icon"]');r||(r=document.createElement("link"),r.rel="icon",r.type="image/png",document.head.appendChild(r)),r.href=t.toDataURL("image/png")}var un;function dn(){return un}var po=3;function mo(e){let t=e.command_names&&e.command_names.length?e.command_names:[e.command_name];return t.length<=po?T(t.join(", ")):`<details class="footer-runs"><summary>${T(t[0])} and ${t.length-1} other runs</summary><span class="footer-runs__list">${T(t.join(", "))}</span></details>`}function fn(e){let t=e.meta,n=t.line_coverage,r=t.branch_coverage,o=t.method_coverage,s=nn(t);document.title=`Code coverage for ${t.project_name}`;let i=Object.keys(e.coverage),c=Be(e.total,s),a=c&&c.total>0?c.percent:100;ln=F(a),xe(),r&&document.body.setAttribute("data-branch-coverage","true");let d=document.getElementById("content"),f=[lt({containerId:"g-total",title:"All Files",filenames:i,stats:e.total,allCoverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,primaryCoverage:s,contextsEnabled:!!e.contexts,production:e.production})];for(let v of Object.keys(e.groups)){let k=e.groups[v];f.push(lt({containerId:Ct(`group-${v}`),title:v,filenames:k.files||[],stats:k,allCoverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,primaryCoverage:s,contextsEnabled:!!e.contexts,production:e.production}))}d.innerHTML=f.join("");let m={};for(let v of i)m[ue(v)]=v;un={idToFilename:m,coverage:e.coverage,lineCoverage:n,branchCoverage:r,methodCoverage:o,contexts:e.contexts||null,production:e.production||null};let _=new Date(t.timestamp),L=`Generated <abbr class="timeago" title="${_.toISOString()}">${_.toISOString()}</abbr> by <a href="https://github.com/simplecov-ruby/simplecov">simplecov</a> v${T(t.simplecov_version)} using ${mo(t)}`;document.getElementById("footer").innerHTML=L,document.getElementById("source-dialog-footer").innerHTML=L;let w=[];if(n){let v=e.contexts?[K("covered","Covered by tests"),K("outside-tests","Covered outside tests")]:[K("covered","Covered")];w.push(qe("line",[...v,K("skipped","Skipped"),K("missed","Missed line")]))}e.production&&n&&w.push(qe("production",[K("production-never","Never ran in production"),K("production-ran","Untested, runs in production")])),r&&w.push(qe("branch",[K("missed-branch","Missed branch")])),o&&w.push(qe("method",[K("missed-method","Missed method")])),document.getElementById("source-legend").innerHTML=w.join("")}function qe(e,t){return`<div class="source-legend__row source-legend__row--${e}">${t.join("")}</div>`}function K(e,t){return`<span class="source-legend__item"><span class="source-legend__swatch source-legend__swatch--${e}"></span>${t}</span>`}function gn(e){let t=document.getElementById(e);if(t)return t;let{idToFilename:n,coverage:r,lineCoverage:o,branchCoverage:s,methodCoverage:i,contexts:c,production:a}=dn(),d=n[e];if(!d)return null;let f=an(d,r[d],o,s,i,c||void 0,a?a.files[d]||null:void 0),m=document.querySelector(".source_files"),_=document.createElement("div");_.innerHTML=f;let L=_.firstElementChild;return m.appendChild(L),y("pre code",L).forEach(w=>ge.highlightElement(w)),L}function pn(e,t){let{contexts:n,idToFilename:r,coverage:o}=dn();if(!n)return null;let s=r[e];if(!s)return null;let i=o[s],c=Pe(i.contexts,i.source.length);return on(c,n,t)}var ut=1e3,ho="t-window-hidden",mn=new WeakSet;function bo(e,t){let n=e.querySelector("tr.t-show-all");if(!n){n=document.createElement("tr"),n.className="t-show-all";let r=document.createElement("td");r.colSpan=t,n.appendChild(r),n.addEventListener("click",o=>{o.preventDefault(),mn.add(e),pe(e.closest("table"))})}return n}function pe(e){let t=e.querySelector("tbody");if(!t)return;let n=t.querySelectorAll("tr.t-file"),r=mn.has(t),o=0;if(n.forEach(i=>{let c=i.style.display==="none";c||(o+=1),i.classList.toggle(ho,!r&&!c&&o>ut)}),r||o<=ut){let i=t.querySelector("tr.t-show-all");i&&(i.style.display="none");return}let s=bo(t,n[0].children.length);s.style.removeProperty("display"),s.firstElementChild.innerHTML=`Showing the first ${O(ut)} of ${O(o)} files. <a href="#" class="t-show-all__link">Show all</a>`,t.appendChild(s)}function We(e){try{return localStorage.getItem(e)}catch(t){return null}}function we(e,t){try{localStorage.setItem(e,t)}catch(n){}}var ft=new WeakMap,En="simplecov-sort";function vo(){var e;try{return(e=JSON.parse(String(We(En))))!=null?e:{}}catch(t){return{}}}function Eo(){let e=vo();return e.direction!=="asc"&&e.direction!=="desc"?null:{column:e.column,direction:e.direction}}function _o(e){we(En,JSON.stringify(e))}function yo(e,t){let n=0,r=e.children;for(let o=0;o<r.length;o++)if(r[o].style.display!=="none"){if(n===t)return o;n+=1}return-1}function hn(e){if(!e)return"";let t=e.getAttribute("data-order");if(t!==null)return Number.parseFloat(t);let n=e.textContent.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?n:r}function So(e){return Number.parseFloat(String(e==null?void 0:e.getAttribute("data-order-2")))}var Mo=new Intl.Collator(void 0,{sensitivity:"accent"});function bn(e,t){return typeof e=="number"&&typeof t=="number"?e-t:Mo.compare(String(e),String(t))}function _n(e,t,n){let r=e.map(s=>({row:s,value:hn(s.children[t]),tiebreak:So(s.children[t]),filename:hn(s.children[0])})),o=(s,i)=>bn(s.value,i.value)||s.tiebreak-i.tiebreak||bn(s.filename,i.filename);return r.sort(n==="asc"?o:(s,i)=>o(i,s)),r.map(({row:s})=>s)}function dt(e,t,n){ft.set(e,{colIndex:t,direction:n});let r=0;y("thead tr:first-child th",e).forEach(o=>{let s=Number.parseInt(o.getAttribute("colspan")||"1",10);o.classList.remove("sorting_asc","sorting_desc","sorting");let i=t>=r&&t<r+s;o.classList.add(i?n==="asc"?"sorting_asc":"sorting_desc":"sorting"),r+=s})}function yn(e,t){let n=document.createDocumentFragment();t.forEach(r=>n.appendChild(r)),e.appendChild(n)}function vn(e,t,n){let r=ft.get(e),o=e.querySelector("tbody"),s=Array.from(o.querySelectorAll("tr.t-file"));if(s.length===0){dt(e,t,n);return}r&&r.colIndex===t?s.reverse():s=_n(s,yo(s[0],t),n),yn(o,s),pe(e),dt(e,t,n)}var xo=500,me=null;function wo(){me||(me=document.createElement("div"),me.id="sort-overlay",me.innerHTML='<span id="sort-overlay-label">Sorting\u2026</span>',document.body.appendChild(me));let e=me;return e.style.transition="none",e.style.opacity="1",e.style.display="flex",e}function Lo(e){e.style.transition="opacity 0.15s",e.style.opacity="0",setTimeout(()=>{e.style.display="none"},150)}function To(e,t){let n=Sn(e,t),r=ft.get(e),o=r&&r.colIndex===n&&r.direction==="asc"?"desc":"asc",s=t.getAttribute("data-sort-key");if(s&&_o({column:s,direction:o}),e.querySelectorAll("tbody tr.t-file").length<xo){vn(e,n,o);return}let c=wo();requestAnimationFrame(()=>requestAnimationFrame(()=>{vn(e,n,o),Lo(c)}))}function Sn(e,t){let n=0;for(let r of y("thead tr:first-child th",e)){let o=Number.parseInt(r.getAttribute("colspan")||"1",10);if(r===t)return n+o-1;n+=o}return n}function Co(e,t){let n=Array.from(e.children),r=n.findIndex(s=>s.classList.contains(`cell--${t}-pct`)),o=r===-1?n.findIndex(s=>s.hasAttribute("data-order")):r;return o===-1?null:o}function Ao(e,t,n){let r=e.querySelector("tbody");if(!r)return;let o=Array.from(r.querySelectorAll("tr.t-file"));if(o.length===0)return;let s=n&&y("thead tr:first-child th[data-sort-key]",e).find(a=>a.getAttribute("data-sort-key")===n.column),i=s?Sn(e,s):Co(o[0],t);if(i===null)return;let c=s?n.direction:"asc";yn(r,_n(o,i,c)),dt(e,i,c)}function Mn(e){let t=Eo();y("table.file_list").forEach(n=>{y("thead tr:first-child th",n).forEach(r=>{r.classList.add("sorting"),r.style.cursor="pointer",r.addEventListener("click",()=>To(n,r))}),Ao(n,e,t),pe(n)})}var Le=null;function ze(){Le=null}function xn(){if(Le)return Le;let e=y(".file_list_container").filter(t=>t.style.display!=="none");return e.length?(Le=y("tbody tr.t-file",e[0]).filter(t=>t.style.display!=="none"),Le):[]}var No=240,Ro=160;function wn(e,t){e.style.setProperty("--bar-sizer-width",t+"px")}var $o=8;function Oo(e,t){let n=Ro,r=No;for(;r-n>$o;){let o=Math.ceil((n+r)/2);wn(e,o),e.offsetWidth,e.scrollWidth<=t?n=o:r=o-1}return n}function pt(){y(".file_list_container").forEach(e=>{if(e.style.display==="none"||e.offsetWidth===0)return;let t=$("table.file_list",e);if(!t||!$(".bar-sizer",t))return;let n=t.closest(".file_list--responsive");n&&(n.style.visibility="hidden",wn(t,Oo(t,n.clientWidth)),n.style.visibility="")})}var gt=0;function he(){gt||(gt=requestAnimationFrame(()=>{gt=0,pt()}))}var Ue={line:{covered:"coveredLines",total:"relevantLines"},branch:{covered:"coveredBranches",total:"totalBranches"},method:{covered:"coveredMethods",total:"totalMethods"}};function Ln(e){let t=y("tbody tr.t-file",e).filter(s=>s.style.display!=="none");function n(s){return t.reduce((i,c)=>i+(Number(c.dataset[s])||0),0)}let r=$(".t-file-count",e),o=Number(e.getAttribute("data-total-files"));if(r){let s=t.length===1?" file":" files";r.textContent=t.length===o?O(o)+s:O(t.length)+"/"+O(o)+s}for(let s of Object.keys(Ue)){let i=Ue[s],c=s==="line"?n("coveredOutsideLines"):0;ko(e,`.t-totals__${s}`,n(i.covered),n(i.total),c)}}function ko(e,t,n,r,o){let s=$(t+"-pct",e),i=$(t+"-num",e),c=$(t+"-den",e);if(r===0){s&&(s.innerHTML="",s.classList.remove("green","yellow","red")),i&&(i.textContent=""),c&&(c.textContent="");return}let a=n*100/r;s&&(s.innerHTML=`<div class="coverage-cell">${at(a,o*100/r)}<span class="coverage-pct">${D(a)}%</span></div>`,s.classList.remove("green","yellow","red"),s.classList.add(F(a))),i&&(i.textContent=O(n)+"/"),c&&(c.textContent=O(r))}var Io={gt:(e,t)=>e>t,gte:(e,t)=>e>=t,eq:(e,t)=>e===t,lte:(e,t)=>e<=t,lt:(e,t)=>e<t};function Ho(e,t,n){let r=Io[e];return r?r(t,n):!0}function Do(e){let t=[];for(let n of y(".col-filter__value",e)){let r=n,o=Number.parseFloat(r.value);if(Number.isNaN(o))continue;let s=r.dataset.type,i=s&&Ue[s],c=$(`.col-filter__op[data-type="${s}"]`,e);i&&c&&t.push({attrs:i,op:c.value,threshold:o})}return t}var Tn=new WeakMap;function Bo(e){let t=Tn.get(e);return t===void 0&&(t=e.children[0].textContent.toLowerCase(),Tn.set(e,t)),t}function Po(e){let t=$("table.file_list",e);if(!t)return;let n=$(".col-filter--name",e),r=n?n.value.trim().toLowerCase():"",o=Do(e);y("tbody tr.t-file",t).forEach(s=>{let i=s,c=(!r||Bo(s).includes(r))&&o.every(a=>{let d=Number(i.dataset[a.attrs.covered])||0,f=Number(i.dataset[a.attrs.total])||0,m=f>0?d*100/f:100;return Ho(a.op,m,a.threshold)});i.style.display=c?"":"none"}),pe(t),ze(),Ln(e),he()}function An(e){let t=Number.parseFloat(e.value),n=e.closest(".col-filter__coverage"),r=n?n.querySelector(".col-filter__op"):null;if(!r)return;let o=r.querySelector('option[value="gt"]'),s=r.querySelector('option[value="lt"]');if(o&&(o.disabled=t>=100),s&&(s.disabled=t<=0),r.selectedOptions[0]&&r.selectedOptions[0].disabled){let i=r.querySelector("option:not(:disabled)");i&&(r.value=i.value)}}function Cn(){this.classList.contains("col-filter__value")&&An(this),Po(this.closest(".file_list_container"))}function Nn(){y(".col-filter__value").forEach(e=>An(e)),y(".col-filter--name, .col-filter__op, .col-filter__value, .col-filter__coverage").forEach(e=>{e.addEventListener("click",t=>t.stopPropagation())}),U(document,"input",".col-filter--name, .col-filter__op, .col-filter__value",Cn),U(document,"change",".col-filter__op, .col-filter__value",Cn)}var B=null;function Rn(){return B!==null}function be(e){B&&B.classList.remove("keyboard-focus"),B=e,B&&(B.classList.add("keyboard-focus"),B.scrollIntoView({block:"nearest"}))}function mt(e){let t=xn();if(!t.length)return;if(!B||t.indexOf(B)===-1){be(e===1?t[0]:t[t.length-1]);return}let n=t.indexOf(B)+e;n>=0&&n<t.length&&be(t[n])}function $n(){if(!B)return;let e=B.querySelector("a.src_link");e&&(window.location.hash=e.getAttribute("href"))}var Y,ie,ht,Te=null,je=null;function bt(){return Y.open}function vt(){return ie}function kn(){if(!Te)return;je&&(Te.prepend(je),je=null);let e=document.querySelector(".source_files");e&&e.appendChild(Te),Te=null}function Fo(e,t){kn();let n=gn(e);if(!n)return;let r=n.querySelector(".header");r&&(je=r,ht.innerHTML=r.innerHTML,r.remove()),Te=n,ie.appendChild(n),Y.open||Y.showModal(),document.documentElement.style.overflow="hidden",ie.focus();let o=ie.querySelector(`li[data-linenumber="${t}"]`);o&&(ie.scrollTop=o.offsetTop)}function On(e){if(be(null),ze(),kn(),Y.close(),ie.innerHTML="",ht.innerHTML="",document.documentElement.style.overflow="",e){let n=document.querySelector(".group_tabs a."+e);n&&(y(".group_tabs li").forEach(r=>r.classList.remove("active")),n.parentElement.classList.add("active"),y(".file_list_container").forEach(r=>r.style.display="none"),document.getElementById(e).style.display="")}let t=document.getElementById("wrapper");t&&!t.classList.contains("hide")&&he()}function Ke(){let e=window.location.hash.substring(1);if(!e){let t=document.querySelector(".group_tabs a");t&&On(t.getAttribute("href").replace("#",""));return}if(e.charAt(0)==="_")On(e.substring(1));else{let t=e.split("-L");if(!document.querySelector(".group_tabs li.active")){let n=document.querySelector(".group_tabs li");n&&n.classList.add("active")}Fo(t[0],t[1])}}function Ge(){let e=document.querySelector(".group_tabs li.active a");e&&(window.location.hash=e.getAttribute("href").replace("#","#_"))}function In(){Y=document.getElementById("source-dialog"),ie=document.getElementById("source-dialog-body"),ht=document.getElementById("source-dialog-title"),Y.querySelector(".source-dialog__close").addEventListener("click",Ge),Y.addEventListener("click",e=>{e.target===Y&&Ge()})}var se=null,ve=null;function qo(e){return e.length===0?'<div class="tests-peek__title">No recorded test covers this line</div><div class="tests-peek__note">It ran outside any test: at load time, in suite setup, or from a helper.</div>':`<div class="tests-peek__title">${e.length===1?"Covered by 1 test":`Covered by ${e.length} tests`}</div><ul class="tests-peek__list">${e.map(n=>`<li><code>${T(n)}</code></li>`).join("")}</ul>`}function Et(){se&&se.remove(),ve&&ve.setAttribute("aria-expanded","false"),se=null,ve=null}function Hn(e,t){let n=e.closest("li"),r=e.closest(".source_table");if(!n||!r)return;let o=ve===e;if(Et(),o)return;let s=Number(e.getAttribute("data-tests-line")),i=t(r.id,s);if(!i)return;let c=document.createElement("li");c.className="tests-peek",c.innerHTML=qo(i),n.after(c),e.setAttribute("aria-expanded","true"),se=c,ve=e}function Dn(){document.addEventListener("keydown",e=>{!se||e.key!=="Escape"||(e.preventDefault(),e.stopPropagation(),Et())},!0),document.addEventListener("click",e=>{if(!se)return;let t=e.target;se.contains(t)||ve.contains(t)||Et()},!0)}function Wo(){return y(".source-dialog .source_table li.missed, .source-dialog .source_table li.missed-branch, .source-dialog .source_table li.missed-method")}function _t(e){let t=Wo();if(!t.length)return;let n=vt(),r=n.scrollTop+n.clientHeight/2,o=e===1?t.find(s=>s.offsetTop>r)||t[0]:t.findLast(s=>s.offsetTop<r-10)||t[t.length-1];n.scrollTop=o.offsetTop-n.clientHeight/3}function Bn(){U(document,"click",".t-missed-method-toggle",function(e){e.preventDefault();let t=this.closest(".header")||this.closest(".source-dialog__title")||this.closest(".source-dialog__header"),n=t?t.querySelector(".t-missed-method-list"):null;n&&(n.style.display=n.style.display==="none"?"":"none")}),U(document,"click","table.file_list tbody tr",function(){let e=this.querySelector("a.src_link");e&&(window.location.hash=e.getAttribute("href"))}),U(document,"click","button.hits--tests",function(e){e.preventDefault(),Hn(this,pn)}),U(document,"click",".source-dialog .source_table li[data-linenumber]",function(e){if(e.target.closest(".hits--tests, .tests-peek"))return;e.preventDefault(),vt().scrollTop=this.offsetTop;let t=this.dataset.linenumber,n=window.location.hash.substring(1).replace(/-L.*/,"");window.location.replace(window.location.href.replace(/#.*/,"#"+n+"-L"+t))}),window.addEventListener("hashchange",Ke),Dn()}var Pn="simplecov-dark-mode",zo="simplecov-colorblind-mode";function Uo(){return We(Pn)}function Fn(e){return Array.from(document.querySelectorAll(`[data-toggle="${e}"]`))}function qn(){let e=Fn("colorblind"),t=document.documentElement,n=()=>{let r=String(t.classList.contains("colorblind-mode"));e.forEach(o=>o.setAttribute("aria-pressed",r))};n(),e.forEach(r=>r.addEventListener("click",()=>{let o=t.classList.toggle("colorblind-mode");we(zo,o?"on":"off"),n(),xe()}))}function Wn(){let e=Fn("dark"),t=document.documentElement;function n(){return t.classList.contains("dark-mode")||!t.classList.contains("light-mode")&&window.matchMedia("(prefers-color-scheme: dark)").matches}function r(){let o=n();e.forEach(s=>{s.textContent=o?"\u2600\uFE0F Light":"\u{1F319} Dark",s.setAttribute("aria-label",o?"Switch to light mode":"Switch to dark mode")})}r(),e.forEach(o=>o.addEventListener("click",()=>{let s=n();t.classList.toggle("light-mode",s),t.classList.toggle("dark-mode",!s),we(Pn,s?"light":"dark"),r(),xe()})),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Uo()||r(),xe()})}function jo(){let e=y(".file_list_container").find(t=>t.style.display!=="none");e&&$(".col-filter--name",e).focus()}function Go(e,t){bt()?(e.preventDefault(),Ge()):t?e.target.blur():be(null)}function Ko(e){e.key==="n"&&!e.shiftKey&&(e.preventDefault(),_t(1)),(e.key==="N"||e.key==="n"&&e.shiftKey||e.key==="p")&&(e.preventDefault(),_t(-1))}function Zo(e){e.key==="j"&&(e.preventDefault(),mt(1)),e.key==="k"&&(e.preventDefault(),mt(-1)),e.key==="Enter"&&Rn()&&(e.preventDefault(),$n())}function zn(e){let t=e.target instanceof Element&&e.target.matches("input, select, textarea");e.key==="/"&&!t?(e.preventDefault(),jo()):e.key==="Escape"?Go(e,t):t||(bt()?Ko(e):Zo(e))}function Un(){let e=$(".group_tabs");if(!e)return;let t=()=>{e.classList.toggle("is-scrolled",e.scrollLeft>0)};e.addEventListener("scroll",t),window.addEventListener("resize",t),t()}function jn(){let e=1/0;y("abbr.timeago").forEach(t=>{let n=t.getAttribute("title");if(!n)return;let r=new Date(n);Number.isNaN(r.getTime())||(t.textContent=Nt(r),e=Math.min(e,Rt(r)))}),e<1/0&&setTimeout(jn,e)}function Xo(){y(".file_list_container").forEach(e=>e.style.display="none"),y(".file_list_container").forEach(e=>{let t=document.createElement("li");t.setAttribute("role","tab");let n=document.createElement("a");n.href="#"+e.id,n.className=e.id,n.innerHTML=`${e.querySelector(".group_name").innerHTML} (${e.querySelector(".covered_percent").innerHTML})`,t.appendChild(n),document.querySelector(".group_tabs").appendChild(t)}),U(document.querySelector(".group_tabs"),"click","a",function(e){e.preventDefault(),window.location.hash=this.getAttribute("href").replace("#","#_")})}function Vo(e){e.style.transition="opacity 0.3s",e.style.opacity="0",setTimeout(()=>{e.style.display="none"},300),document.getElementById("wrapper").classList.remove("hide"),pt()}function Yo(){return le(this,null,function*(){let e=window.SIMPLECOV_DATA,t=document.getElementById("loading");t.style.display="",yield $t(Object.keys(e.coverage)),fn(e),jn(),Wn(),qn(),Mn(e.meta.primary_coverage),Nn(),document.addEventListener("keydown",zn),In(),Bn(),Xo(),Un(),window.addEventListener("resize",he),Ke(),Vo(t)})}document.addEventListener("DOMContentLoaded",Yo);})();
|
|
91
91
|
</script>
|
|
92
92
|
</body>
|
|
93
93
|
</html>
|
data/lib/simplecov/production.rb
CHANGED
|
@@ -90,7 +90,7 @@ module SimpleCov
|
|
|
90
90
|
raise Error, "max_buffered_lines must be positive" unless max_buffered_lines.positive?
|
|
91
91
|
return unless sample_rate < 1 && !Coverage.respond_to?(:suspend)
|
|
92
92
|
|
|
93
|
-
raise Error, "sample_rate below 1.0 needs Coverage.suspend
|
|
93
|
+
raise Error, "sample_rate below 1.0 needs Coverage.suspend, which this Ruby does not provide"
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def validate_jitter!(flush_jitter)
|
|
@@ -6,14 +6,14 @@ SimpleCov.profiles.define "rails" do
|
|
|
6
6
|
skip %r{\Aconfig/}
|
|
7
7
|
skip %r{\Adb/}
|
|
8
8
|
|
|
9
|
-
group "Controllers", "app/controllers"
|
|
10
9
|
group "Channels", "app/channels"
|
|
11
|
-
group "
|
|
12
|
-
group "Mailers", "app/mailers"
|
|
10
|
+
group "Controllers", "app/controllers"
|
|
13
11
|
group "Helpers", "app/helpers"
|
|
14
|
-
group "Views", "app/views"
|
|
15
12
|
group "Jobs", %w[app/jobs app/workers]
|
|
16
13
|
group "Libraries", "lib/"
|
|
14
|
+
group "Mailers", "app/mailers"
|
|
15
|
+
group "Models", "app/models"
|
|
16
|
+
group "Views", "app/views"
|
|
17
17
|
|
|
18
18
|
@tracked_files = "{app,lib}/**/*.rb"
|
|
19
19
|
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
# lookups for criteria not in the stats, so only `:line` is enforced there.
|
|
10
10
|
#
|
|
11
11
|
# `:eval` is guarded on `coverage_for_eval_supported?` so the profile stays
|
|
12
|
-
# quiet on
|
|
12
|
+
# quiet on engines without it, where enabling it would warn every time it loads.
|
|
13
13
|
|
|
14
14
|
SimpleCov.profiles.define "strict" do
|
|
15
15
|
enable_coverage :branch
|
|
16
16
|
enable_coverage :method
|
|
17
|
-
# simplecov:disable branch — dogfood runs on
|
|
18
|
-
# the else arm (eval coverage not supported) is unreachable from CI.
|
|
17
|
+
# simplecov:disable branch — dogfood branch coverage runs on CRuby only,
|
|
18
|
+
# so the else arm (eval coverage not supported) is unreachable from CI.
|
|
19
19
|
enable_coverage :eval if coverage_for_eval_supported?
|
|
20
20
|
# simplecov:enable
|
|
21
21
|
minimum_coverage line: 100, branch: 100, method: 100
|
data/lib/simplecov/result.rb
CHANGED
|
@@ -84,6 +84,12 @@ module SimpleCov
|
|
|
84
84
|
@groups ||= SimpleCov.grouped(files, groups: @groups_config)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
+
# True for a group the configuration defines, whether or not any file
|
|
88
|
+
# matched it; `groups` omits the ones that matched nothing.
|
|
89
|
+
def configured_group?(group_name)
|
|
90
|
+
@groups_config.key?(group_name)
|
|
91
|
+
end
|
|
92
|
+
|
|
87
93
|
# Returns nil if formatting has been opted out of (`SimpleCov.formatter
|
|
88
94
|
# false` / `SimpleCov.formatters []`), the cheap path for non-final
|
|
89
95
|
# processes in a parallel CI run, which only need their `.resultset.json`
|
|
@@ -60,7 +60,9 @@ module SimpleCov
|
|
|
60
60
|
FileList.new result
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
# Files matched by no group fall into the implicit "Ungrouped" bucket.
|
|
63
|
+
# Files matched by no group fall into the implicit "Ungrouped" bucket. Any
|
|
64
|
+
# group left empty, Ungrouped included, is dropped so a profile's unused
|
|
65
|
+
# groups (#1293) don't pad the report as 100% covered.
|
|
64
66
|
def grouped(files, groups: default_groups)
|
|
65
67
|
return {} if GroupNames.validate!(groups.keys).empty?
|
|
66
68
|
|
|
@@ -69,10 +71,9 @@ module SimpleCov
|
|
|
69
71
|
end
|
|
70
72
|
|
|
71
73
|
in_group = grouped_file_set(grouped)
|
|
72
|
-
|
|
73
|
-
grouped[GroupNames::UNGROUPED] = FileList.new(ungrouped) if ungrouped.any?
|
|
74
|
+
grouped[GroupNames::UNGROUPED] = FileList.new(files.reject { |source_file| in_group.include?(source_file) })
|
|
74
75
|
|
|
75
|
-
grouped
|
|
76
|
+
grouped.reject { |_name, group_files| group_files.empty? }
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
def load_profile(name)
|
|
@@ -129,9 +130,23 @@ module SimpleCov
|
|
|
129
130
|
# nobody loaded without needing this process's `cover` / `track_files`
|
|
130
131
|
# configuration. A standalone `collate` never ran `SimpleCov.start` (#1250).
|
|
131
132
|
def tracked_file_paths
|
|
132
|
-
UnloadedFileInjector.discover(
|
|
133
|
+
paths = UnloadedFileInjector.discover(
|
|
133
134
|
unloaded_file_discovery_globs, root: root, reject: filters.select(&:path_only?)
|
|
134
135
|
)
|
|
136
|
+
templates = paths.select { |path| Directive::Template.template?(path) }
|
|
137
|
+
return paths if templates.empty?
|
|
138
|
+
|
|
139
|
+
warn_templates_tracked(templates)
|
|
140
|
+
paths - templates
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Simulating a template means classifying its lines as Ruby and parsing it
|
|
144
|
+
# for branches, both of which produce a wrong shape, whereas `cover_views`
|
|
145
|
+
# compiles it and measures the real thing.
|
|
146
|
+
def warn_templates_tracked(templates)
|
|
147
|
+
names = templates.map { |path| path.delete_prefix(root).sub(%r{\A[/\\]}, "") }
|
|
148
|
+
warn "[SimpleCov]: `cover` matched templates it cannot simulate (#{names.join(", ")}). " \
|
|
149
|
+
"Add `cover_views` to measure templates."
|
|
135
150
|
end
|
|
136
151
|
|
|
137
152
|
# The legacy `track_files` glob (additive only) plus every string glob
|
|
@@ -22,8 +22,8 @@ module SimpleCov
|
|
|
22
22
|
# left both as empty hashes, which made unloaded files invisible to the
|
|
23
23
|
# branch/method denominators while their lines did count, so a glob that
|
|
24
24
|
# picked up files without specs silently inflated branch% relative to
|
|
25
|
-
# line% (#1059). When
|
|
26
|
-
#
|
|
25
|
+
# line% (#1059). When the file can't be parsed, fall back to the old empty
|
|
26
|
+
# hashes.
|
|
27
27
|
#
|
|
28
28
|
# Pass `synthesize: false` to skip the static analysis. Callers use it when
|
|
29
29
|
# neither branch nor method coverage is enabled, since nothing will read
|
|
@@ -11,8 +11,15 @@ module SimpleCov
|
|
|
11
11
|
# unavailable or parsing fails, signaling callers to keep every Coverage entry
|
|
12
12
|
# rather than risk false drops. The `defined?` guard preserves a nil
|
|
13
13
|
# memoization across calls.
|
|
14
|
+
#
|
|
15
|
+
# Nil for a template too, without parsing: every entry a template reports
|
|
16
|
+
# is eval-generated by construction, so the filter has nothing to
|
|
17
|
+
# distinguish there, and a template whose text happens to parse as Ruby
|
|
18
|
+
# (a Haml `#id` tag reads as a comment) would otherwise lose its real
|
|
19
|
+
# branches to a confident wrong parse.
|
|
14
20
|
def real_source_positions
|
|
15
21
|
return @real_source_positions if instance_variable_defined?(:@real_source_positions)
|
|
22
|
+
return @real_source_positions = nil if Directive::Template.template?(filename)
|
|
16
23
|
|
|
17
24
|
@real_source_positions = StaticCoverageExtractor.real_source_positions(src.join)
|
|
18
25
|
end
|
|
@@ -30,16 +30,25 @@ module SimpleCov
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def directive_chunks
|
|
33
|
-
@directive_chunks ||= Directive.disabled_ranges(
|
|
33
|
+
@directive_chunks ||= Directive.disabled_ranges(ruby_lines)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
private
|
|
37
37
|
|
|
38
|
+
# The Ruby the file holds, which for a template means the Ruby inside its
|
|
39
|
+
# tags or script lines with its own comments turned into Ruby comments.
|
|
40
|
+
# Both kinds of marker are found there, so a toggle in a template's
|
|
41
|
+
# comment syntax gets the same treatment, and the same deprecation
|
|
42
|
+
# warning, as one in a Ruby file.
|
|
43
|
+
def ruby_lines
|
|
44
|
+
@ruby_lines ||= Directive::Template.ruby_lines(@filename, @src)
|
|
45
|
+
end
|
|
46
|
+
|
|
38
47
|
# An uneven number of nocovs is assumed to run to the end of the file. It
|
|
39
48
|
# cannot be handled inside the each_slice because JRuby behaves differently
|
|
40
49
|
# there (jruby/jruby#6048).
|
|
41
50
|
def build_nocov_chunks
|
|
42
|
-
no_cov_lines =
|
|
51
|
+
no_cov_lines = ruby_lines.filter_map.with_index(1) do |line_src, index|
|
|
43
52
|
index if LinesClassifier.no_cov_line?(line_src)
|
|
44
53
|
end
|
|
45
54
|
|
|
@@ -30,15 +30,11 @@ module SimpleCov
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# Files added via track_files but never loaded have no branch or method data,
|
|
34
|
-
# and report 0% instead of the empty-set default of 100% (#902). A file with
|
|
35
|
-
# missed entries and none covered already computes to 0%, so only a file that
|
|
36
|
-
# really has covered entries keeps its computed percentage.
|
|
37
33
|
def branch_statistics
|
|
38
34
|
sf = @source_file
|
|
39
35
|
covered = sf.covered_branches
|
|
40
36
|
missed = sf.missed_branches
|
|
41
|
-
percent = 0.0 if
|
|
37
|
+
percent = 0.0 if covered.empty? && unaccounted?(sf, "branches")
|
|
42
38
|
|
|
43
39
|
{branch: coverage_statistics(covered, missed, percent: percent)}
|
|
44
40
|
end
|
|
@@ -47,11 +43,25 @@ module SimpleCov
|
|
|
47
43
|
sf = @source_file
|
|
48
44
|
covered = sf.covered_methods
|
|
49
45
|
missed = sf.missed_methods
|
|
50
|
-
percent = 0.0 if
|
|
46
|
+
percent = 0.0 if covered.empty? && unaccounted?(sf, "methods")
|
|
51
47
|
|
|
52
48
|
{method: coverage_statistics(covered, missed, percent: percent)}
|
|
53
49
|
end
|
|
54
50
|
|
|
51
|
+
# A file tracked but never loaded once carried no branch or method tuples
|
|
52
|
+
# at all, so an empty set meant "nobody knows", and answering the
|
|
53
|
+
# empty-set default of 100% overstated it (#902). Simulation now
|
|
54
|
+
# synthesizes those tuples statically, so a file carrying a table at all,
|
|
55
|
+
# empty or not, has been accounted for: it has no branches, or a
|
|
56
|
+
# directive skipped the ones it has, and it is as covered as a loaded
|
|
57
|
+
# file with none. Only a file carrying no table for the criterion is
|
|
58
|
+
# still unaccounted for. A file with missed entries and none covered
|
|
59
|
+
# already computes to 0% either way, so only one that really has covered
|
|
60
|
+
# entries keeps its computed percentage.
|
|
61
|
+
def unaccounted?(source_file, table)
|
|
62
|
+
source_file.not_loaded? && source_file.coverage_data[table].nil?
|
|
63
|
+
end
|
|
64
|
+
|
|
55
65
|
def coverage_statistics(covered, missed, omitted: 0, percent: nil)
|
|
56
66
|
CoverageStatistics.new(
|
|
57
67
|
total_strength: covered.sum { |item| item.coverage.to_i },
|