Commit graph

103 commits

Author SHA1 Message Date
Claudio Bley
6679c38998 Fix test running on CI with small terminal width 2024-09-05 23:03:51 +02:00
Ayush Poddar
cc659b6eda spec adjustments 2024-08-01 02:14:30 +05:30
Ayush Poddar
07d456005d test cases 2024-08-01 02:14:30 +05:30
Claudio Bley
597a8c6807
Merge pull request #595 from ayushpoddar/color-hidden-files
Colorise hidden files and directories
2024-07-12 14:19:26 +02:00
Claudio Bley
c8a0401a61 Disable codecov
The uploader was deprecated and is no longer working.

There is a new uploader that should be used instead: https://docs.codecov.com/docs/codecov-uploader
2024-07-12 08:13:35 +02:00
Ayush Poddar
6f7f4ab47d modify the instance doubles ensuring green specs 2023-06-07 17:40:15 +05:30
Ayush Poddar
c5fdcf6e92 relevant feature spec 2023-04-30 02:45:55 +05:30
Ayush Poddar
86daeef7ec rubocop fixes 2023-04-30 02:43:41 +05:30
Ayush Poddar
1001aa2832 refactor: DRY the fileinfo stub for spec readability 2023-04-30 02:31:39 +05:30
Ayush Poddar
4c5ef39093 fix the stubs in specs 2023-04-30 02:31:39 +05:30
Ayush Poddar
5f3b8807d3 spec fix: not more than 3 lines in the spec output 2023-04-26 18:42:22 +05:30
Ayush Poddar
69988e1b2e improve the regex 2023-04-19 16:48:38 +05:30
Ayush Poddar
81ced364a4 fix: fix failing spec due to new fixture file 2023-04-19 16:33:08 +05:30
Ayush Poddar
7eda794a07 spec: add spec to flags spec 2023-04-19 16:32:11 +05:30
t-mangoe
cbad7578a9 change the option name from '-H' to '-L' 2023-02-11 13:39:46 +09:00
t-mangoe
0e2bed11ad Merge branch 'master' into issue_515 2023-02-11 09:47:22 +09:00
Claudio Bley
33d4ac066a Auto-correct rubocop offenses 2023-01-25 21:08:12 +01:00
t-mangoe
77cf0b0770 add '-H' option 2023-01-07 10:36:26 +09:00
Claudio Bley
b053d33309 Workaround NameError in diffy 3.4.2
See https://github.com/samg/diffy#119
2022-07-04 17:11:19 +02:00
Claudio Bley
3ffea2976a Correct Style/OpenStructUse offenses
Replace with `Struct`, or use `instance_double` in tests.
2022-05-13 21:47:03 +02:00
Claudio Bley
60cf569776 Pass a null device instead of explicitly closing stderr
When calling git any error messages should be suppressed (e.g. if an directory
is not inside a git repository).

Closing the stderr output when calling `IO.popen` works fine on POSIX systems,
but on Windows it does not and spits out a warning for every invocation:

```
git.rb:44: warning: cannot close fd before spawn
```

Fixes #517.
2022-04-30 09:13:56 +02:00
Claudio Bley
c7aa167952
Merge pull request #519 from athityakumar/ci-on-windows 2022-04-29 16:14:46 +02:00
Claudio Bley
6d8e229cb3 Fix "shows the file in the linked directory" test on Windows
When running on Windows this test failed with:

```
Failures:

  1) ColorLS::Flags symlinked directory with trailing separator shows the file in the linked directory
     Failure/Error: expect { subject }.to output(/yaml_sort_checker.rb/).to_stdout

       expected block to output /yaml_sort_checker.rb/ to stdout, but output "       Supportlink \n"
       Diff:
       @@ -1 +1 @@
       -/yaml_sort_checker.rb/
       +       Supportlink
     # ./spec/color_ls/flags_spec.rb:329:in `block (3 levels) in <top (required)>'
```

This is due to the different handling of paths to a symlink with a trailing
slash / backslash.

`File.lstat(x).directory?` returns

OS      |     x    | value
----------------------------
Windows | symlink\ | false
Windows | symlink  | false
Linux   | symlink/ | true
Linux   | symlink  | false

This could be fixed in colorls by handling a trailing (back)slash specifically,
but I am unsure whether that is the right thing to do on Windows.
2022-04-29 15:58:03 +02:00
Claudio Bley
ef86bcf66e Fix rubocop offense for RSpec/VerifiedDoubleReference
RSpec/VerifiedDoubleReference: Use a constant class reference for verified doubles.
2022-04-26 22:06:50 +02:00
Claudio Bley
dbdcd142a0 Fix --inode check
The range of inodes is roughly 2 to 2^32 (depending on the filesystem).

The test failed on CI, since the inode number was a 6-digit number.
2022-04-04 21:52:22 +02:00
t-mangoe
67459d0ef9 Merge branch 'master' into no-hardlinks 2022-03-26 16:25:05 +09:00
Claudio Bley
d5691d69c0 Fix arguments of with --inode flag check 2022-03-21 09:09:01 +01:00
goar5670
c1469a4196 Cover the new --inode flag with tests 2022-03-20 02:33:01 +03:00
bl7awy
e9166e8c15 Resolve long line offense 2022-03-18 23:41:36 +03:00
bl7awy
f43c9b9e7e Add tests for --report flag 2022-03-18 22:28:26 +03:00
Claudio Bley
6b35f942aa Fix offenses newly reported by rubocop-rspec
The pessimistic version contraint on rubocop-rspec permitted minor version
updates of the dependency, which broke the tests again since version 2.9.0
introduced / changed offenses.

Allow only the patch version to increase automatically to avoid this in the future.
2022-02-28 21:37:11 +01:00
t-mangoe
ced1cfebff add --no-hardlinks option 2022-02-19 09:28:10 +09:00
t-mangoe
90aaa4d0b6 change time/date format in '+FORMAT' 2021-11-13 09:21:15 +09:00
t-mangoe
d7e7ddd01e add --time-style option in long style format 2021-10-02 08:40:48 +09:00
t-mangoe
566ea3b45a add '--indicator-style' option 2021-07-19 10:24:25 +02:00
Claudio Bley
17b2142c48 Use File.extname to determine file extension
Fixes #441.
2021-01-29 10:21:24 +01:00
Claudio Bley
0048e3883a Group and process arguments in groups of files and directories
Fixes #233
2021-01-15 11:03:21 +01:00
Claudio Bley
2eeb30fc44 Refactor git_subdir_status
Instead of simply returning the opened pipe, consume the output
and yield the `mode, file` tuple to the given block.
2021-01-15 11:03:21 +01:00
Claudio Bley
373fb67003 Fix error when git is not installed 2021-01-15 11:03:21 +01:00
Claudio Bley
0ad630da4c Properly encode hyperlinks with special characters
This also works on Windows now, since absolute paths include a colon after the
drive letter, the `file:` URI needs to start with a triple slash.
2021-01-15 11:03:21 +01:00
Claudio Bley
e39703a3b5 Fix rubocop-rspec offenses or disable them 2020-12-23 22:32:36 +01:00
Claudio Bley
7f0af24ada Use rubocop's default include configuration and fix all offenses 2020-12-23 22:32:36 +01:00
Claudio Bley
d0df25d35d Re-use CoreLS::Core instance
Only initialize colors and flags once.
2020-12-22 14:01:55 +01:00
Claudio Bley
64a42c105d
Merge pull request #417 from t-mangoe/add-option-o-g
add -o and -g options.
2020-12-07 22:54:17 +01:00
Claudio Bley
175f2dc225
Correct description of -G -l check 2020-12-07 21:32:13 +01:00
t-mangoe
0d0a1d96ca add -G option 2020-12-05 09:14:12 +09:00
t-mangoe
39be15c6aa add -o and -g options. 2020-11-21 10:17:32 +09:00
Claudio Bley
a59258b749 Clean up monkey patches
* delete `#remove` method
* remove `#delete_prefix` spec, it was only used for Ruby < 2.5 (see 86cfa2f5cf)
* add specifications for `#colorize` and `#uniq`
2020-11-02 08:45:07 +01:00
Claudio Bley
8035deaab0 Ensure to use file_encoding for arguments
Fixes #377
2020-10-31 21:54:45 +01:00
t-mangoe
9992218ea4 make executables bold 2020-10-17 15:15:39 +09:00