Commit graph

273 commits

Author SHA1 Message Date
Claudio Bley
d93cd2c308 Fix warning in gemspec
```
colorls.gemspec:5: warning: already initialized constant ColorLS::POST_INSTALL_MESSAGE
/home/claudio/src/colorls/colorls.gemspec:5: warning: previous definition of POST_INSTALL_MESSAGE was here
```
2018-08-13 23:22:53 +02:00
Claudio Bley
159649ab65
Merge pull request #200 from avdv/sort-by-extension
Add `-X` / `--sort=extension` flags
2018-08-12 18:33:04 +02:00
Claudio Bley
eb9a499426
Merge pull request #195 from mashehu/add-docker
added icon for Dockerfiles
2018-08-12 18:01:42 +02:00
Claudio Bley
1b71184fac Fix rubocop offense Metrics/LineLength: Line is too long 2018-08-12 16:22:27 +02:00
Claudio Bley
c35ad864c3 Regenerate zsh completion file and man page 2018-08-12 16:22:27 +02:00
Claudio Bley
1389d9d8fa Require date in Rakefile to avoid error
```
NameError: uninitialized constant Date
```
2018-08-12 16:22:27 +02:00
Claudio Bley
f979ce281c spec: Use multi-line regex mode for matching
This avoids test failures on small terminals (e.g. on Travis) when multiple
lines are generated.
2018-08-12 16:22:27 +02:00
Claudio Bley
012aeb8493 Add -X / --sort=extension flags
This allows the listing to be sorted alphabetically by file extension.

Fixes #199.
2018-08-12 16:22:27 +02:00
Claudio Bley
6cecaf4654
Merge pull request #169 from avdv/fix-open-ended-dependencies
Avoid open-ended dependencies
2018-08-12 08:19:00 +02:00
Claudio Bley
95e8730be3 Avoid open-ended dependencies
Running `rake install` always resulted in these warnings:
```
WARNING:  open-ended dependency on clocale (>= 0) is not recommended
  if clocale is semantically versioned, use:
    add_runtime_dependency 'clocale', '~> 0'
WARNING:  open-ended dependency on filesize (>= 0) is not recommended
  if filesize is semantically versioned, use:
    add_runtime_dependency 'filesize', '~> 0'
WARNING:  open-ended dependency on manpages (>= 0) is not recommended
  if manpages is semantically versioned, use:
    add_runtime_dependency 'manpages', '~> 0'
WARNING:  open-ended dependency on rainbow (>= 0) is not recommended
  if rainbow is semantically versioned, use:
    add_runtime_dependency 'rainbow', '~> 0'
WARNING:  open-ended dependency on diffy (>= 0, development) is not recommended
  if diffy is semantically versioned, use:
    add_development_dependency 'diffy', '~> 0'
WARNING:  open-ended dependency on rake (>= 0, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0'
WARNING:  open-ended dependency on ronn (>= 0, development) is not recommended
  if ronn is semantically versioned, use:
    add_development_dependency 'ronn', '~> 0'
WARNING:  open-ended dependency on rspec (>= 0, development) is not recommended
  if rspec is semantically versioned, use:
    add_development_dependency 'rspec', '~> 0'
WARNING:  open-ended dependency on rspec-its (>= 0, development) is not recommended
  if rspec-its is semantically versioned, use:
    add_development_dependency 'rspec-its', '~> 0'
WARNING:  open-ended dependency on rubocop (>= 0, development) is not recommended
  if rubocop is semantically versioned, use:
    add_development_dependency 'rubocop', '~> 0'
WARNING:  open-ended dependency on rubocop-rspec (>= 0, development) is not recommended
  if rubocop-rspec is semantically versioned, use:
    add_development_dependency 'rubocop-rspec', '~> 0'
WARNING:  open-ended dependency on rubygems-tasks (>= 0, development) is not recommended
  if rubygems-tasks is semantically versioned, use:
    add_development_dependency 'rubygems-tasks', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
```

- use pessimistic version constraints for all dependencies in the gemspec
2018-07-19 22:50:34 +02:00
mashehu
8d9a3a83f7 added icon for dockerfiles 2018-06-08 15:47:22 +02:00
Athitya Kumar
95319c37d7
Merge pull request #188 from avdv/fix-user-long-listing
Always return user info
2018-04-20 10:38:54 +00:00
Claudio Bley
d7e12246e3 Always colorize user info
In a long listing, the user was only shown when owning the file. Originally, the
user was only colorized when owning the file.

Change that to always colorize the user using the defined `:user` color.

Fixes #187.
2018-04-20 11:58:09 +02:00
Athitya
3aab256ab5 Ships v1.1.1 for release 2018-04-09 00:25:04 +05:30
Athitya Kumar
e07f1b9341
Merge pull request #183 from avdv/git-status
Improve git-status processing
2018-04-08 18:46:24 +00:00
Claudio Bley
8f9a5f9409 Fix Style/ExpandPathArguments cop error 2018-03-28 08:23:55 +02:00
Claudio Bley
8b0ea26c01 Skip next NUL separated git status field for renames
In the `-z` git status format, a NUL follows each file name. When files are
renamed, the status field is followed by a space, the "to" path, a NUL
character, the "from" path and a terminating NUL.

This fixes #185.
2018-03-28 08:23:55 +02:00
Claudio Bley
51fe55cc8f Simplify git mode padding 2018-03-27 19:51:13 +02:00
Claudio Bley
b362fa1eb8 Improve git-status processing
* no longer traverse complete directory trees to determine git status for
  directories

* properly report status for folders with changed files

* skip the parent folder since we do not have git status about it
2018-03-27 19:50:52 +02:00
Andy
bb270b319a Adds some media types (#180)
* add some media types

* alphabetize the media types
2018-02-01 21:43:38 +05:30
Andy
99b94da2f6 add jupyter notebooks to file aliases (#181) 2018-01-30 01:16:55 +05:30
Athitya
0ed7f76b14 Updates to version v1.1.0 2018-01-15 23:46:58 +05:30
Athitya Kumar
5dc9840c44
Merge pull request #170 from avdv/reduce-syscalls
Reduce syscalls and simplify code
2018-01-12 22:33:03 +05:30
Sam Umbach
848e3b7c64 Fix minor typo (#173) 2018-01-12 21:39:39 +05:30
Claudio Bley
c78bf3bd73 Add SimpleCov code coverage tool
See [SimpleCov](https://github.com/colszowka/simplecov).
2018-01-11 11:32:44 +01:00
Claudio Bley
ab21ee6976 Add Ruby 2.5.0 to travis CI config 2018-01-08 14:18:28 +01:00
Claudio Bley
ab544414c0 Fix rubocop issue, re-enable cop
```
colorls.gemspec:26:1: W: Lint/MissingCopEnableDirective: Re-enable Metrics/BlockLength cop with # rubocop:enable after disabling it
# rubocop:disable Metrics/BlockLength
^
```
2018-01-02 11:02:36 +01:00
Claudio Bley
d12b95da6e Avoid reading link target when not needed
It is only needed in long listing mode.
2018-01-02 11:02:36 +01:00
Claudio Bley
038c15f53c Interprete path with trailing slash as a directory 2018-01-02 11:02:36 +01:00
Claudio Bley
fa803c6cb6 Simplify git info handling 2018-01-02 11:02:36 +01:00
Claudio Bley
68215c56b0 Use porcelain mode with git status, no chdir 2018-01-02 11:02:36 +01:00
Claudio Bley
694fdee03c Use git rev-parse to find git root path 2018-01-02 11:02:36 +01:00
Claudio Bley
f9db84a2b1 Avoid re-computing max_widths 2018-01-02 11:02:36 +01:00
Claudio Bley
a6879dc23d Avoid Time.now call 2018-01-02 11:02:36 +01:00
Claudio Bley
ff7dd59a8c Use information from stat call to colorize user 2018-01-02 11:02:36 +01:00
Claudio Bley
e0ebbdb3d0 Add FileInfo class, reduce syscalls 2018-01-02 11:02:36 +01:00
Athitya Kumar
445cfc3836
Merge pull request #166 from avdv/rescue-errors
Handle errors gracefully
2017-12-13 13:08:41 +05:30
Claudio Bley
60cc97bbd2 Simplify path handling in Core class 2017-12-10 22:50:13 +01:00
Claudio Bley
1d3bd49f5d Handle errors gracefully
Do not print a backtrace when a `SystemCallError` occurs and keep going to
process arguments afterwards.
2017-12-10 22:50:13 +01:00
Athitya Kumar
3ff4d701cb
Merge pull request #167 from avdv/improvements
Small improvements
2017-12-10 15:44:19 +05:30
Claudio Bley
0c6a174081 Avoid using count if size or length works
According to [1] one should prefer the latter over the former whenever possible.

[1]: http://batsov.com/articles/2014/02/17/the-elements-of-style-in-ruby-number-13-length-vs-size-vs-count/
2017-12-10 10:06:14 +01:00
Claudio Bley
fe78028949 Use IO#winsize instead of calling out to tput
If the window size cannot be determined, use a default of 80 columns, just like
tput.
2017-12-10 10:05:30 +01:00
Athitya Kumar
9cfc9190bc
Adds waffle badge 2017-12-08 19:06:26 +05:30
Athitya Kumar
3af19cc54a
Merge pull request #164 from avdv/collation
Proper sorting according to current LANG / locale
2017-12-01 18:00:52 +05:30
Claudio Bley
47b8f198f1 Use git author date of man page when generating 2017-12-01 11:04:08 +01:00
Claudio Bley
bebe09f5f7 Use clocale gem for proper sorting 2017-12-01 09:05:04 +01:00
Athitya Kumar
60012c93d9
Merge pull request #161 from rohitner/master
Removed bug of ignored files
2017-11-23 03:46:26 +05:30
Athitya Kumar
9df380607c
Merge pull request #160 from avdv/zsh-completion
Include Zsh completion file in the gem
2017-11-23 03:46:08 +05:30
Claudio Bley
96ec0d5276 Generate Zsh completion file
Add the `_colorls` completion file to the `zsh/` folder of the gem and make the
`tab_complete.sh` script work for Zsh too.
2017-11-22 22:32:20 +01:00
rohitner
1fefca92a9 fixed rubocop issue 2017-11-23 00:10:53 +05:30