colorls 1.4.5.pre.875 → 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: 69c7fa254c9d4833031ac4cdf64643bf2c3873b2654e82e3420762fd34261928
4
- data.tar.gz: c6658c1eb2da5abdadaa2582373aba1eca7b757fa53940ae5d650f4579423903
3
+ metadata.gz: 98c2972fd70e2af553dd6db317edd6a5b1c7359c877bbc123fa9ece3db1c1036
4
+ data.tar.gz: c744972885038bebadcbacda38b99fd3a74c4135825d1e09ff4dbd0584880df2
5
5
  SHA512:
6
- metadata.gz: 27d79f71201501b2e4d4fb7566977abed7dbd0ba3daf0ed172c3b4a755306adf593cb8e17b1b8e0e735a24878796ce8afb22a8c5ea01fd5eabbe5919b783fc76
7
- data.tar.gz: 1e123393958faec03d8217d31374d91fd6d46621734c4d7c6886852a21314645aac18229ae881c9db78b6189da4be453a821a0d92ed2c0180c26ba1db7dcf6cc
6
+ metadata.gz: 6203ef3679f228c9498bc7fca1ffd952f1df986254326a4574ceeeccf2862ab2993a7e820d194fd7b236daf3bd12e63d7df652755ea25d6ed070828395fa532d
7
+ data.tar.gz: 7fe63d9d88a07f7a5567c9142a5f3fac4db6ce7061d16b0829514ce4e487ad2981f14e066c0a63ada8f4111c7f9eebf144cd5c9271a57c6458d425b41ba8ab8c
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "23:30"
8
+ open-pull-requests-limit: 10
@@ -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/colorls.gemspec CHANGED
@@ -76,8 +76,8 @@ Gem::Specification.new do |spec|
76
76
  spec.add_development_dependency 'ronn', '~> 0'
77
77
  spec.add_development_dependency 'rspec', '~> 3.7'
78
78
  spec.add_development_dependency 'rspec-its', '~> 1.2'
79
- spec.add_development_dependency 'rubocop', '~> 1.11.0'
80
- spec.add_development_dependency 'rubocop-performance', '~> 1.10.1'
79
+ spec.add_development_dependency 'rubocop', '~> 1.13.0'
80
+ spec.add_development_dependency 'rubocop-performance', '~> 1.11.0'
81
81
  spec.add_development_dependency 'rubocop-rake', '~> 0.5'
82
82
  spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
83
83
  spec.add_development_dependency 'rubygems-tasks', '~> 0'
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
@@ -6,6 +6,6 @@ class String
6
6
  end
7
7
 
8
8
  def uniq
9
- split('').uniq.join
9
+ chars.uniq.join
10
10
  end
11
11
  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.5.pre.875
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-03-24 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
@@ -224,28 +224,28 @@ dependencies:
224
224
  requirements:
225
225
  - - "~>"
226
226
  - !ruby/object:Gem::Version
227
- version: 1.11.0
227
+ version: 1.13.0
228
228
  type: :development
229
229
  prerelease: false
230
230
  version_requirements: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - "~>"
233
233
  - !ruby/object:Gem::Version
234
- version: 1.11.0
234
+ version: 1.13.0
235
235
  - !ruby/object:Gem::Dependency
236
236
  name: rubocop-performance
237
237
  requirement: !ruby/object:Gem::Requirement
238
238
  requirements:
239
239
  - - "~>"
240
240
  - !ruby/object:Gem::Version
241
- version: 1.10.1
241
+ version: 1.11.0
242
242
  type: :development
243
243
  prerelease: false
244
244
  version_requirements: !ruby/object:Gem::Requirement
245
245
  requirements:
246
246
  - - "~>"
247
247
  - !ruby/object:Gem::Version
248
- version: 1.10.1
248
+ version: 1.11.0
249
249
  - !ruby/object:Gem::Dependency
250
250
  name: rubocop-rake
251
251
  requirement: !ruby/object:Gem::Requirement
@@ -310,6 +310,8 @@ executables:
310
310
  extensions: []
311
311
  extra_rdoc_files: []
312
312
  files:
313
+ - ".github/dependabot.yml"
314
+ - ".github/workflows/ruby.yml"
313
315
  - ".gitignore"
314
316
  - ".rubocop.yml"
315
317
  - ".travis.yml"