Cleanup
This commit is contained in:
parent
eb0aa2105c
commit
b8b7cc8d12
3 changed files with 5 additions and 5 deletions
|
@ -57,7 +57,7 @@ parser = OptionParser.new do |opt|
|
|||
puts FormatStaged::VERSION
|
||||
exit
|
||||
end
|
||||
|
||||
|
||||
opt.on('--[no-]color', 'Colorizes output') do |value|
|
||||
parameters[:color_output] = value
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|||
s.homepage = 'https://github.com/5sw/format-staged'
|
||||
s.license = 'MIT'
|
||||
s.required_ruby_version = '~> 2.7'
|
||||
|
||||
|
||||
s.add_dependency 'colorize'
|
||||
|
||||
s.add_development_dependency 'rake', '~> 13.0'
|
||||
|
|
|
@ -31,15 +31,15 @@ class FormatStaged
|
|||
[pid, r]
|
||||
end
|
||||
|
||||
def read_output(r, lines: true, silent: false)
|
||||
result = r.read
|
||||
def read_output(output, lines: true, silent: false)
|
||||
result = output.read
|
||||
splits = result.split("\n")
|
||||
if @verbose && !silent
|
||||
splits.each do |line|
|
||||
puts "< #{line}"
|
||||
end
|
||||
end
|
||||
r.close
|
||||
output.close
|
||||
|
||||
lines ? splits : result
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue