On Windows, MRI Ruby uses the `FindFirstFileW` et. al. kind of functions with
wide character paths and constantly converts from multi-byte to wide character
encoding back and forth when calling any methods on `File` or `Dir`.
This means that when using `Encoding::ASCII_8BIT` for reading directory entries,
that this does not round trip properly, if a file name contains unicode
characters. That is because Ruby assumes the path string is encoded in Windows
Codepage 1252[1].
* skip symlink test if files were checked out from git as textual symlinks on
Windows
* use UTF-8 encoding on Windows, since this properly round-trips between
multi-byte and wide character encoding
* travis: windows job no longer is allowed to fail
[1]: 946cd6c534/win32/file.c (L131-L134)
A *file* is assigned a generic icon / glyph in `files.yaml`, so looking up
`:file` in the corresponding hash always succeeds, but `:file` is also used as
the fallback key if a file's extension is not recognized.
First determining the color and group of a given file before falling back to
the `:file` key fixes this issue.
* Style/MultilineWhenThen: Do not use then for multiline when statement
* Style/StringConcatenation: Prefer string interpolation to string concatenation
* Style/OptionalBooleanParameter: Use keyword arguments when defining method with boolean argument
* Style/GlobalStdStream: Use $stderr instead of STDERR
* Style/GlobalStdStream: Use $stdout instead of STDOUT
On Unix systems the encoding of file names is specified by the user via the
locale settings.
In order to avoid encoding problems simply read file names in ASCII 8 bit
encoding and try to convert to the external encoding while replacing undefined
characters.
Also, does not show an icon if the external encoding does not support it and
shows a `=` instead of a check mark for git status.
Fixes#352.
* add and wire up `VerticalLayout` which is now the default
* adapt flags spec to use single-column layout for testing sort order
since the output is hard to verify when in vertical format
Fixes#189.
* add `Layout` base class which contains the base (binary) algorithm
for finding the maximum amount of columns fitting the given limit
* add `HorizontalLayout` and use it in `Core`
* add `SingleColumnLayout` and use it in `Core`
* make `-h` an alias for `--human-readable`
* both options are simply ignored when used with an argument or another option
* running `colorls -h` still shows the help text since just as before
When using secret variables in Travis CI, the output gets filtered through a
helper process by default (called `redirect_io` strategy) and hence the `STDOUT`
is no longer a real TTY when running the specs. See [1].
[1]: https://github.com/travis-ci/travis-ci/issues/6018
Both are also supported by GNU ls, although currently not all formats are
supported.
This change lays ground for implementing column based formatting and also
supports using a pager with colorls keeping the formatting intact:
`colorls --color -x | less --tabs=4 -RFX`
Listing the fixtures folder sorting by size, expected the files at the beginning
followed by the `symlinks` folder. But on travis, the folder is 4KiB which is
larger than any one of the files.
Keep the folder first by adding the `--group-directories-first` flag.
This generates `file://` links using ANSI escape sequences which opens the
given file using the default application for the file type on your system.
A terminal emulator supporting hyperlinks is required, otherwise the links
will be ignored.
These special permission bits should cause the executable bit in the current
group to be replaced with an uppercase letter if the executable bit itself is
*not* set, with a lower case character otherwise.
When not using any sort options, sort the output by name.
This is in line with what `ls` does, too.
Revert "Disable failing test"
This reverts commit 9e41d60956.