module

Smith::FileKind

Is this file text, or is it bytes we have no business putting in a prompt?

One test, two callers: @-mentions skip such a file, read_file refuses it. Both need the same answer, and a second copy of the rule is how the two drift apart.

Constants

SNIFF_BYTES = 1024

How much of a file to look at when deciding whether it is text.

Class methods

binary?(path : String) : Bool

Null bytes in the first block. Crude, and the same test grep uses. An empty file has none of them and is text.

Source