colorls 1.4.3.pre.775 → 1.4.3.pre.811

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: 6c8823a85931d7bb843c8389c63dffc368f5e98324a4c5119045a0ec6ce885b0
4
- data.tar.gz: ae496670677fefa0c647d2b7e8eef704ea50640dbf92d04526588ffaa33e58b6
3
+ metadata.gz: 97cd65cf999c31c827853a8193487937844a8b5e363acb9cdcea95efc9fcd960
4
+ data.tar.gz: 292a06dba83f5648f6d93b7552349b5d2df7e21765399128ed77d9c2834a2830
5
5
  SHA512:
6
- metadata.gz: a09991ebb8e84a732a729fe6f06bde0b671b00a07b4ea749c829d2d62a53b8f3e71770423d02427fd4197a3843a41dda792b680e0d3e8c0e337b56727a897980
7
- data.tar.gz: 0d213e4ad76b85b77c4bdab07860549a497256a3de28681bc61211d36191c346bafc37954a57857bf350d117520af43d74ee87524f1b659ed9e8b630cc573d8f
6
+ metadata.gz: b9ba32dd908b8c0251c0baf2c7857638dec3939275264fe5e1f38f1b18c629cfe5838d0ec905d06017f8b60012b309cfed0f999a10952e9f06bda8547fa1fae8
7
+ data.tar.gz: 97d80d822ce105a9f2295b237da64242011d0acf80cdb76f5db989db0d418cce90ccee9a58caab0063d1188b9cb09297f0a94d6d7653a458a7cb59a7ecd80983
@@ -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,7 +93,7 @@ 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/
@@ -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', '~> 1.1.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'
@@ -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
 
@@ -157,7 +157,7 @@ module ColorLS
157
157
  options.separator ''
158
158
  options.separator 'options for compatiblity with ls (ignored):'
159
159
  options.separator ''
160
- options.on('-h', '--human-readable') {}
160
+ options.on('-h', '--human-readable') {} # always active
161
161
  end
162
162
 
163
163
  def show_help
@@ -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" "September 2020" "colorls 1.4.2" "colorls Manual"
4
+ .TH "COLORLS" "1" "October 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.775
4
+ version: 1.4.3.pre.811
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-10-07 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: 1.1.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.92.0
200
+ version: 1.1.0
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: rubocop-performance
203
203
  requirement: !ruby/object:Gem::Requirement