colorls 1.4.5.pre.885 → 1.4.5.pre.888

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: '0811afee3542df0c51b991c50d8060e79060cbf36e148440159d52ee0b78ba19'
4
- data.tar.gz: 8e61f0c16ce635567c30aa08f0882d9cf4627a9d2abff1334379f8688b52e043
3
+ metadata.gz: 98c2972fd70e2af553dd6db317edd6a5b1c7359c877bbc123fa9ece3db1c1036
4
+ data.tar.gz: c744972885038bebadcbacda38b99fd3a74c4135825d1e09ff4dbd0584880df2
5
5
  SHA512:
6
- metadata.gz: ab470e8b720d63c101c728fd7296485045fe26ab56ba6b559b49dcf749ebf39cbcae9350a3c10e211f7f3db8a7bf80cfcaab4e1848974cd9b927e08db458f220
7
- data.tar.gz: b7605f8bf5aff12917a8fa85c000697edb97c8ac708eadaedd133cff83fadb51e26813e4bdc205f8e337f26bc660bb9610546261c97a28094825407708eab358
6
+ metadata.gz: 6203ef3679f228c9498bc7fca1ffd952f1df986254326a4574ceeeccf2862ab2993a7e820d194fd7b236daf3bd12e63d7df652755ea25d6ed070828395fa532d
7
+ data.tar.gz: 7fe63d9d88a07f7a5567c9142a5f3fac4db6ce7061d16b0829514ce4e487ad2981f14e066c0a63ada8f4111c7f9eebf144cd5c9271a57c6458d425b41ba8ab8c
@@ -0,0 +1,32 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.6', '2.7', '3.0']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Run tests
32
+ run: bundle exec rake
data/lib/colorls.rb CHANGED
@@ -5,6 +5,7 @@ require 'etc'
5
5
  require 'English'
6
6
  require 'filesize'
7
7
  require 'io/console'
8
+ require 'io/console/size'
8
9
  require 'rainbow/ext/string'
9
10
  require 'clocale'
10
11
  require 'unicode/display_width'
data/lib/colorls/core.rb CHANGED
@@ -8,8 +8,17 @@ module ColorLS
8
8
  @file_encoding
9
9
  end
10
10
 
11
- @screen_width = IO.console.winsize[1]
12
- @screen_width = 80 if @screen_width.zero?
11
+ def self.terminal_width
12
+ console = IO.console
13
+
14
+ width = IO.console_size[1]
15
+
16
+ return width if console.nil? || console.winsize[1].zero?
17
+
18
+ console.winsize[1]
19
+ end
20
+
21
+ @screen_width = terminal_width
13
22
 
14
23
  def self.screen_width
15
24
  @screen_width
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.5.pre.885
4
+ version: 1.4.5.pre.888
5
5
  platform: ruby
6
6
  authors:
7
7
  - Athitya Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-29 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -311,6 +311,7 @@ extensions: []
311
311
  extra_rdoc_files: []
312
312
  files:
313
313
  - ".github/dependabot.yml"
314
+ - ".github/workflows/ruby.yml"
314
315
  - ".gitignore"
315
316
  - ".rubocop.yml"
316
317
  - ".travis.yml"