colorls 1.4.3.pre.775 → 1.4.3.pre.801

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +19 -11
  3. data/lib/colorls/core.rb +13 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c8823a85931d7bb843c8389c63dffc368f5e98324a4c5119045a0ec6ce885b0
4
- data.tar.gz: ae496670677fefa0c647d2b7e8eef704ea50640dbf92d04526588ffaa33e58b6
3
+ metadata.gz: 2505bfb33ca4e7aa00cc804d283a8f60e3be7477ecd428d365e1c3a0d41a1e40
4
+ data.tar.gz: 784cab859c93aa8d6499f15655ec29db306a01c1b1eeb2ad2bd652063e1b4c36
5
5
  SHA512:
6
- metadata.gz: a09991ebb8e84a732a729fe6f06bde0b671b00a07b4ea749c829d2d62a53b8f3e71770423d02427fd4197a3843a41dda792b680e0d3e8c0e337b56727a897980
7
- data.tar.gz: 0d213e4ad76b85b77c4bdab07860549a497256a3de28681bc61211d36191c346bafc37954a57857bf350d117520af43d74ee87524f1b659ed9e8b630cc573d8f
6
+ metadata.gz: 467ff43b04c5c26c20fb531bd9cd77cc21682f27f1faf7a0053aa421d7014c2a334d2f460ac5c1c47ea81bec3195488a22fac5b4370db3258c5d6107c7ddaec2
7
+ data.tar.gz: 04f016ba06f91d799f0b382099c3b9b3f6712058ec39191691b8d3b6e9021721eaf5ce8829916ffb7f7d181196cd38df97148b4a842f61a7d1567854a817c5e6
@@ -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/
@@ -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
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.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-10-07 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