mirror of
https://github.com/athityakumar/colorls.git
synced 2024-09-19 05:31:23 +02:00
Merge pull request #388 from athityakumar/dependabot/bundler/rubocop-tw-0.90.0
This commit is contained in:
commit
662ff02e34
6 changed files with 13 additions and 13 deletions
|
@ -72,7 +72,7 @@ Gem::Specification.new do |spec|
|
|||
spec.add_development_dependency 'ronn', '~> 0'
|
||||
spec.add_development_dependency 'rspec', '~> 3.7'
|
||||
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
||||
spec.add_development_dependency 'rubocop', '~> 0.88.0'
|
||||
spec.add_development_dependency 'rubocop', '~> 0.90.0'
|
||||
spec.add_development_dependency 'rubocop-performance', '~> 1.7.0'
|
||||
spec.add_development_dependency 'rubocop-rspec', '~> 1.27'
|
||||
spec.add_development_dependency 'rubygems-tasks', '~> 0'
|
||||
|
|
|
@ -34,7 +34,7 @@ module ColorLS
|
|||
return print "\n Nothing to show here\n".colorize(@colors[:empty]) if @contents.empty?
|
||||
|
||||
layout = case
|
||||
when @tree[:mode] then
|
||||
when @tree[:mode]
|
||||
print "\n"
|
||||
return tree_traverse(@input, 0, 1, 2)
|
||||
when @horizontal
|
||||
|
@ -76,14 +76,14 @@ module ColorLS
|
|||
end
|
||||
|
||||
def init_contents(path)
|
||||
info = FileInfo.new(path, link_info = @long)
|
||||
info = FileInfo.new(path, link_info: @long)
|
||||
|
||||
if info.directory?
|
||||
@contents = Dir.entries(path, encoding: Encoding::ASCII_8BIT)
|
||||
|
||||
filter_hidden_contents
|
||||
|
||||
@contents.map! { |e| FileInfo.new(File.join(path, e), link_info = @long) }
|
||||
@contents.map! { |e| FileInfo.new(File.join(path, e), link_info: @long) }
|
||||
|
||||
filter_contents if @show
|
||||
sort_contents if @sort
|
||||
|
@ -290,7 +290,7 @@ module ColorLS
|
|||
name = content.show
|
||||
name = make_link(path, name) if @hyperlink
|
||||
name += content.directory? ? '/' : ' '
|
||||
entry = logo.encode(Encoding.default_external, undef: :replace, replace: '') + ' ' + name
|
||||
entry = "#{logo.encode(Encoding.default_external, undef: :replace, replace: '')} #{name}"
|
||||
|
||||
"#{long_info(content)} #{git_info(content)} #{entry.colorize(color)}#{symlink_info(content)}"
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ module ColorLS
|
|||
|
||||
attr_reader :stats, :name
|
||||
|
||||
def initialize(path, link_info=true)
|
||||
def initialize(path, link_info: true)
|
||||
@name = File.basename(path)
|
||||
@stats = File.lstat(path)
|
||||
|
||||
|
@ -70,7 +70,7 @@ module ColorLS
|
|||
@target = File.readlink(path)
|
||||
@dead = !File.exist?(path)
|
||||
rescue SystemCallError => e
|
||||
STDERR.puts "cannot read symbolic link: #{e}"
|
||||
$stderr.puts "cannot read symbolic link: #{e}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@ module ColorLS
|
|||
sort: true,
|
||||
reverse: false,
|
||||
group: nil,
|
||||
mode: STDOUT.tty? ? :vertical : :one_per_line,
|
||||
mode: STDOUT.tty? ? :vertical : :one_per_line, # rubocop:disable Style/GlobalStdStream
|
||||
all: false,
|
||||
almost_all: false,
|
||||
report: false,
|
||||
|
@ -41,13 +41,13 @@ module ColorLS
|
|||
|
||||
@args = ['.'] if @args.empty?
|
||||
@args.sort!.each_with_index do |path, i|
|
||||
next STDERR.puts "\n Specified path '#{path}' doesn't exist.".colorize(:red) unless File.exist?(path)
|
||||
next $stderr.puts "\n Specified path '#{path}' doesn't exist.".colorize(:red) unless File.exist?(path)
|
||||
|
||||
puts '' if i.positive?
|
||||
puts "\n#{path}:" if Dir.exist?(path) && @args.size > 1
|
||||
Core.new(path, **@opts).ls
|
||||
rescue SystemCallError => e
|
||||
STDERR.puts "#{path}: #{e}".colorize(:red)
|
||||
$stderr.puts "#{path}: #{e}".colorize(:red)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "COLORLS" "1" "May 2020" "colorls 1.4.1" "colorls Manual"
|
||||
.TH "COLORLS" "1" "May 2020" "colorls 1.4.2" "colorls Manual"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBcolorls\fR \- list directory contents with colors and icons
|
||||
|
|
|
@ -83,7 +83,7 @@ RSpec.describe ColorLS::Flags do
|
|||
)
|
||||
)
|
||||
|
||||
allow(ColorLS::FileInfo).to receive(:new).with("#{FIXTURES}/a.txt", true) { fileInfo }
|
||||
allow(ColorLS::FileInfo).to receive(:new).with("#{FIXTURES}/a.txt", link_info: true) { fileInfo }
|
||||
|
||||
expect { subject }.to output(/r-Sr-Sr-T .* a.txt/mx).to_stdout
|
||||
end
|
||||
|
@ -111,7 +111,7 @@ RSpec.describe ColorLS::Flags do
|
|||
)
|
||||
)
|
||||
|
||||
allow(ColorLS::FileInfo).to receive(:new).with("#{FIXTURES}/a.txt", true) { fileInfo }
|
||||
allow(ColorLS::FileInfo).to receive(:new).with("#{FIXTURES}/a.txt", link_info: true) { fileInfo }
|
||||
|
||||
expect { subject }.to output(/\S+\s+ 5 .* a.txt/mx).to_stdout
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue