colorls 1.4.3.pre.773 → 1.4.3.pre.808

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99f198ac8a3e7f2d71f62a6adfbf214253cbef8653597096d7879d1515400d98
4
- data.tar.gz: cd669c0c3a9671905e40961f1d30fdebb7a30267133fd9306cd216d8e18d6f4a
3
+ metadata.gz: 0676ffe485c1a032ca9ed8008988e16645cf4803eb9661d5a8c974d4639cfd5e
4
+ data.tar.gz: f2d5c975e556ab42735db900d66e807987ea141f7726f69c614630bbb8d50863
5
5
  SHA512:
6
- metadata.gz: aae55d1624789599bb902cf945483cb85402e508eb7ba25c89681786fa96977ebe3c5c2068799445d3ce20693f035df844c914d4f442dd455d21070c4c1d22d0
7
- data.tar.gz: d76fa70f1c02ac115851cee9627db77bf6d5fb6513065cc98d27afac7596c37dcdbe63fb522463c856cc1bab731f7d5bbf584ea9e317df6b7e9b4d80868ee124
6
+ metadata.gz: bd8b4ebcfade1d320d2820776a9f373d2d46f785d33581db54b868673b046c333857aa65a6c953003dbd9b34ff93e97cc1faf51a07acdbd4bfe86235a6363f16
7
+ data.tar.gz: 6e02ec60ad4d07aa8098c52fa4a77cda1bc5d6125185419aaecdbc5fc08f2350a7fe08bfdf8dd30d971a27d669166b43cff548d06cd9273ee23ce2b3eda27655
@@ -8,11 +8,7 @@ language:
8
8
  os:
9
9
  - linux
10
10
 
11
- cache:
12
- bundler: true
13
- directories:
14
- - $HOME/AppData/Local/Temp/chocolatey
15
- - /C/tools/msys64
11
+ cache: bundler
16
12
 
17
13
  rvm:
18
14
  - '2.5'
@@ -25,7 +21,6 @@ jobs:
25
21
 
26
22
  allow_failures:
27
23
  - rvm: truffleruby-head
28
- - os: windows
29
24
 
30
25
  include:
31
26
  - os: osx
@@ -36,14 +31,27 @@ jobs:
36
31
  before_cache:
37
32
  - |-
38
33
  # https://unix.stackexchange.com/a/137322/107554
39
- $msys2 pacman --sync --clean --noconfirm
34
+ pacman --sync --clean --noconfirm
35
+ - bundle clean
40
36
  before_install:
41
37
  - ruby --version
42
38
  - gem --version
43
- - choco install msys2 --params /NoUpdate
44
- - powershell -Command 'Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass ; & c:\tools\ruby27\bin\ridk.ps1' install dev_tools
39
+ - |
40
+ if [[ ! -f /C/tools/msys64/--msys2-- ]]; then
41
+ rm -rf /C/tools/msys64
42
+ choco uninstall -y mingw
43
+ choco upgrade --no-progress -y msys2 --params /NoUpdate
44
+ ridk.cmd install dev_tools
45
+ fi
46
+ - touch /C/tools/msys64/--msys2--
45
47
  install:
46
- - bundle install --retry=3
48
+ - bundle install --path vendor/bundle --retry=3
49
+ - export MSYS=winsymlinks:nativestrict
50
+ cache:
51
+ directories:
52
+ - $HOME/AppData/Local/Temp/chocolatey
53
+ - /C/tools/msys64
54
+ - vendor/bundle
47
55
 
48
56
  before_install:
49
57
  - gem --version
@@ -85,10 +93,21 @@ script:
85
93
  - colorls --color=auto
86
94
  - colorls --color=never
87
95
  - colorls --color=always
88
- - colorls --tree
96
+ - colorls --tree spec
89
97
  - colorls --tree=1
90
98
  - LC_ALL=C colorls spec/fixtures/
91
99
  - LC_ALL=C colorls --git spec/fixtures/
100
+ - |
101
+ if colorls does-not-exist; then
102
+ echo "expected error!"
103
+ exit 1
104
+ else
105
+ ret=$?
106
+ if [ $ret -ne 2 ]; then
107
+ echo "unexpected error: $ret"
108
+ exit 1
109
+ fi
110
+ fi
92
111
 
93
112
  deploy:
94
113
  provider: rubygems
@@ -72,7 +72,7 @@ Gem::Specification.new do |spec|
72
72
  spec.add_development_dependency 'ronn', '~> 0'
73
73
  spec.add_development_dependency 'rspec', '~> 3.7'
74
74
  spec.add_development_dependency 'rspec-its', '~> 1.2'
75
- spec.add_development_dependency 'rubocop', '~> 0.92.0'
75
+ spec.add_development_dependency 'rubocop', '~> 0.93.1'
76
76
  spec.add_development_dependency 'rubocop-performance', '~> 1.8.0'
77
77
  spec.add_development_dependency 'rubocop-rspec', '~> 1.27'
78
78
  spec.add_development_dependency 'rubygems-tasks', '~> 0'
@@ -23,4 +23,4 @@ require 'colorls'
23
23
  $loading = false
24
24
  # rubocop:enable Style/GlobalVars
25
25
 
26
- ColorLS::Flags.new(*ARGV).process
26
+ exit ColorLS::Flags.new(*ARGV).process
@@ -1,11 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ColorLS
4
+ # on Windows (were the special 'nul' device exists) we need to use UTF-8
5
+ @file_encoding = File.exist?('nul') ? Encoding::UTF_8 : Encoding::ASCII_8BIT
6
+
7
+ def self.file_encoding
8
+ @file_encoding
9
+ end
10
+
4
11
  class Core
5
12
  def initialize(input, all: false, report: false, sort: false, show: false,
6
13
  mode: nil, git_status: false, almost_all: false, colors: [], group: nil,
7
14
  reverse: false, hyperlink: false, tree_depth: nil)
8
- @input = File.absolute_path(input)
15
+ @input = (+input).force_encoding(ColorLS.file_encoding)
9
16
  @count = {folders: 0, recognized_files: 0, unrecognized_files: 0}
10
17
  @all = all
11
18
  @almost_all = almost_all
@@ -26,7 +33,7 @@ module ColorLS
26
33
 
27
34
  init_colors colors
28
35
 
29
- @contents = init_contents(input)
36
+ @contents = init_contents(@input)
30
37
  init_icons
31
38
  end
32
39
 
@@ -79,7 +86,7 @@ module ColorLS
79
86
  info = FileInfo.new(path, link_info: @long)
80
87
 
81
88
  if info.directory?
82
- @contents = Dir.entries(path, encoding: Encoding::ASCII_8BIT)
89
+ @contents = Dir.entries(path, encoding: ColorLS.file_encoding)
83
90
 
84
91
  filter_hidden_contents
85
92
 
@@ -283,6 +290,10 @@ module ColorLS
283
290
  end
284
291
  end
285
292
 
293
+ def out_encode(str)
294
+ str.encode(Encoding.default_external, undef: :replace, replace: '')
295
+ end
296
+
286
297
  def fetch_string(path, content, key, color, increment)
287
298
  @count[increment] += 1
288
299
  value = increment == :folders ? @folders[key] : @files[key]
@@ -290,7 +301,8 @@ module ColorLS
290
301
  name = content.show
291
302
  name = make_link(path, name) if @hyperlink
292
303
  name += content.directory? ? '/' : ' '
293
- entry = "#{logo.encode(Encoding.default_external, undef: :replace, replace: '')} #{name}"
304
+ entry = "#{out_encode(logo)} #{out_encode(name)}"
305
+ entry = entry.bright if !content.directory? && content.executable?
294
306
 
295
307
  "#{long_info(content)} #{git_info(content)} #{entry.colorize(color)}#{symlink_info(content)}"
296
308
  end
@@ -359,7 +371,7 @@ module ColorLS
359
371
  end
360
372
 
361
373
  def make_link(path, name)
362
- href = "file://#{path}/#{name}"
374
+ href = "file://#{File.absolute_path(path)}/#{name}"
363
375
  "\033]8;;#{href}\007#{name}\033]8;;\007"
364
376
  end
365
377
  end
@@ -62,7 +62,8 @@ module ColorLS
62
62
  name
63
63
  end
64
64
 
65
- def_delegators :@stats, :directory?, :socket?, :chardev?, :symlink?, :blockdev?, :mtime, :nlink, :size, :owned?
65
+ def_delegators :@stats, :directory?, :socket?, :chardev?, :symlink?, :blockdev?, :mtime, :nlink, :size, :owned?,\
66
+ :executable?
66
67
 
67
68
  private
68
69
 
@@ -40,8 +40,13 @@ module ColorLS
40
40
  init_locale
41
41
 
42
42
  @args = ['.'] if @args.empty?
43
+ exit_status_code = 0
43
44
  @args.sort!.each_with_index do |path, i|
44
- next $stderr.puts "\n Specified path '#{path}' doesn't exist.".colorize(:red) unless File.exist?(path)
45
+ unless File.exist?(path)
46
+ $stderr.puts "\n Specified path '#{path}' doesn't exist.".colorize(:red)
47
+ exit_status_code = 2
48
+ next
49
+ end
45
50
 
46
51
  puts '' if i.positive?
47
52
  puts "\n#{path}:" if Dir.exist?(path) && @args.size > 1
@@ -49,6 +54,7 @@ module ColorLS
49
54
  rescue SystemCallError => e
50
55
  $stderr.puts "#{path}: #{e}".colorize(:red)
51
56
  end
57
+ exit_status_code
52
58
  end
53
59
 
54
60
  def options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "COLORLS" "1" "May 2020" "colorls 1.4.2" "colorls Manual"
4
+ .TH "COLORLS" "1" "September 2020" "colorls 1.4.2" "colorls Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBcolorls\fR \- list directory contents with colors and icons
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3.pre.773
4
+ version: 1.4.3.pre.808
5
5
  platform: ruby
6
6
  authors:
7
7
  - Athitya Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-26 00:00:00.000000000 Z
11
+ date: 2020-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clocale
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: 0.92.0
193
+ version: 0.93.1
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: 0.92.0
200
+ version: 0.93.1
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: rubocop-performance
203
203
  requirement: !ruby/object:Gem::Requirement