Skip to content

#86 Save file when specs are run.#90

Open
vanboom wants to merge 8 commits intofcoury:masterfrom
vanboom:master
Open

#86 Save file when specs are run.#90
vanboom wants to merge 8 commits intofcoury:masterfrom
vanboom:master

Conversation

@vanboom
Copy link
Contributor

@vanboom vanboom commented Aug 13, 2016

Save file when specs are run. See #86.

@vanboom vanboom force-pushed the master branch 2 times, most recently from e30c0d8 to e89e2fa Compare May 15, 2019 03:04
vanboom and others added 2 commits August 12, 2019 14:48
Adding detection for 256 color ASCII color codes.
Copy link
Contributor Author

@vanboom vanboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved regex handling of extended colors, issue #104

text = text.replace /\[(3[0-7])m/, (match, colorCode) =>
"<p class=\"rspec-color tty-#{colorCode}\">"
text = text.replace /\[0m/g, '</p>'
text = text.replace /\x1B/g, ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [] character is caused by byte code 0x18. Strip it out and everything looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colorize gem allows console colors, but uses the 256 color ASCII format: \u001b[38;5;${ID}m

This line will detect the color code from the 256 color mode and works with all of the primary colors: yellow, red, cyan, green, blue, etc. I have not extensively tested this with all colors in the 256 color table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant