colorls 1.4.3.pre.747 → 1.4.3.pre.801

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: 6a7951522bc03cc9a29373d1e40b97bfaf1ec003a4dff66a9f75b9ef2c5e4740
4
- data.tar.gz: 365ff0c92dc521435e437540f2c2bbed3207c84ebd59b8653e5d865cea350fe3
3
+ metadata.gz: 2505bfb33ca4e7aa00cc804d283a8f60e3be7477ecd428d365e1c3a0d41a1e40
4
+ data.tar.gz: 784cab859c93aa8d6499f15655ec29db306a01c1b1eeb2ad2bd652063e1b4c36
5
5
  SHA512:
6
- metadata.gz: 9acae1cd2bdfe84ac5b088c1c4ae3d17e4b5076b107e0f7507001a1ac10302dc7d8952087a74316757ac950998731e451d45e5ba60eaa6061faefaeadcc2b7ca
7
- data.tar.gz: da8436074eaaa53281948f0d0df153e7e53af8273104d181ffa1b6d412da40c201a9e437312e41e9773055f4742f1f2abfbc4703643e0a3deab08be67e273351
6
+ metadata.gz: 467ff43b04c5c26c20fb531bd9cd77cc21682f27f1faf7a0053aa421d7014c2a334d2f460ac5c1c47ea81bec3195488a22fac5b4370db3258c5d6107c7ddaec2
7
+ data.tar.gz: 04f016ba06f91d799f0b382099c3b9b3f6712058ec39191691b8d3b6e9021721eaf5ce8829916ffb7f7d181196cd38df97148b4a842f61a7d1567854a817c5e6
@@ -5,8 +5,10 @@ if: branch = master OR tag IS present
5
5
  language:
6
6
  ruby
7
7
 
8
- cache:
9
- bundler
8
+ os:
9
+ - linux
10
+
11
+ cache: bundler
10
12
 
11
13
  rvm:
12
14
  - '2.5'
@@ -16,9 +18,41 @@ rvm:
16
18
 
17
19
  jobs:
18
20
  fast_finish: true
21
+
19
22
  allow_failures:
20
23
  - rvm: truffleruby-head
21
24
 
25
+ include:
26
+ - os: osx
27
+ rvm: '2.7'
28
+
29
+ - os: windows
30
+ language: bash
31
+ before_cache:
32
+ - |-
33
+ # https://unix.stackexchange.com/a/137322/107554
34
+ pacman --sync --clean --noconfirm
35
+ - bundle clean
36
+ before_install:
37
+ - ruby --version
38
+ - gem --version
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--
47
+ install:
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
55
+
22
56
  before_install:
23
57
  - gem --version
24
58
  - gem install bundler -v '~> 2'
@@ -59,10 +93,21 @@ script:
59
93
  - colorls --color=auto
60
94
  - colorls --color=never
61
95
  - colorls --color=always
62
- - colorls --tree
96
+ - colorls --tree spec
63
97
  - colorls --tree=1
64
98
  - LC_ALL=C colorls spec/fixtures/
65
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
66
111
 
67
112
  deploy:
68
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.91.0'
75
+ spec.add_development_dependency 'rubocop', '~> 0.92.0'
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,6 +1,13 @@
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,
@@ -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,7 @@ 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)}"
294
305
 
295
306
  "#{long_info(content)} #{git_info(content)} #{entry.colorize(color)}#{symlink_info(content)}"
296
307
  end
@@ -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.747
4
+ version: 1.4.3.pre.801
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-25 00:00:00.000000000 Z
11
+ date: 2020-10-09 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.91.0
193
+ version: 0.92.0
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.91.0
200
+ version: 0.92.0
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: rubocop-performance
203
203
  requirement: !ruby/object:Gem::Requirement