New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use TTY::Cursor.hide instead of constants #39
Conversation
lib/tty/spinner.rb
Outdated
ECMA_CSI = "\x1b[" | ||
ECMA_CSI = "\x1b[".freeze | ||
DEC_TCEM = '?25'.freeze | ||
DEC_RST = 'l'.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
lib/tty/spinner.rb
Outdated
@@ -17,7 +17,9 @@ class Spinner | |||
# @raised when attempting to join dead thread | |||
NotSpinningError = Class.new(StandardError) | |||
|
|||
ECMA_CSI = "\x1b[" | |||
ECMA_CSI = "\x1b[".freeze | |||
DEC_TCEM = '?25'.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
lib/tty/spinner.rb
Outdated
@@ -17,7 +17,9 @@ class Spinner | |||
# @raised when attempting to join dead thread | |||
NotSpinningError = Class.new(StandardError) | |||
|
|||
ECMA_CSI = "\x1b[" | |||
ECMA_CSI = "\x1b[".freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RedundantFreeze: Do not freeze immutable objects, as freezing them has no effect.
Hi, Thanks for contributing! These constants are remnants from my refactorings. In this case, they should be replaced by tty-cursor, you can see it here. |
Hey! Thanks for updating your PR. Would it possible for yourself to add a test for this as well so I don't break things in the future? That would be a cherry on a cake! |
I'll take a look at creating a test, but I have some other work to complete first |
@piotrmurach i'm not really used to the style you're using for your specs, hopefully context blocks are acceptable |
Thanks for making this change and adding tests! 🙇 |
Describe the change
fixes issue #38
Why are we doing this?
crashing is not desirable