crystallabs / tput.cr

Low-level component for building term/console applications in Crystal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

building example code failed

spTorin opened this issue · comments

$ crystal version
Crystal 0.32.0 [6952aacb3] (2019-12-11)

LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu

$ crystal build

In lib/tput/src/methods.cr:521:22

 521 | _write("\x1b[" + param + "A")
                      ^
Error: no overload matches 'String#+' with type Int32

Overloads are:
 - String#+(other : self)
 - String#+(char : Char)

Thanks for the report, the issue should be fixed at this time.

The quick solution was to just add #to_s.

A better solution for later, when the overall functionality gets some more testing in practice, will be to replace literal string concatenation with direct writing to String.builder or to an IO.

The README was also updated with instructions where to find the list of all available term methods.