Skip to content

Instantly share code, notes, and snippets.

@jakeonrails
Created April 11, 2015 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakeonrails/c2f302bce7b1e4707faa to your computer and use it in GitHub Desktop.
Save jakeonrails/c2f302bce7b1e4707faa to your computer and use it in GitHub Desktop.
Circle CI Failure Bookmarklet
$(window.open().document.body).html(
"<style>textarea { font-size: large; font-family: monospace;}</style>" +
"<h4>Cucumber failures</h4><textarea style='height: 25%;width: 100%'>cucumber " +
$.makeArray($.unique(
$('span.red').filter(function() {
return (this.textContent).match(/cucumber .+:\d+/)
}).map(function() {
return $(this).text().match(/cucumber (.+)/)[1]
})
).sort()).join(' ') +
"</textarea></textarea><h4>Rspec Failures</h4><textarea style='height: 25%; width: 100%'>rspec " +
$.makeArray($.unique(
$('span.red').filter(function() {
return (this.textContent).match(/rspec .+:\d+/)
}).map(function() {
return $(this).text().match(/rspec (.+)/)[1]
})
).sort()).join(' ') +
"</textarea></textarea><h4>Rubocop Failures</h4><textarea style='height: 25%; width: 100%'>rubocop " +
$.makeArray($.unique(
$('span.cyan').filter(function() {
return (this.textContent).match(/^[a-z\/_]+.rb$/)
}).map(function() {
return $(this).text()
})
).sort()).join(' ') +
"</textarea><script type='text/javascript'>document.getElementsByTagName('textarea')[0].select();</script>"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment