diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/gist-logs.rb | 16 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/list.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 2 |
3 files changed, 13 insertions, 14 deletions
diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 5cacd50b6..fecdc25a0 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -94,13 +94,15 @@ module Homebrew def load_logs(dir) logs = {} - dir.children.sort.each do |file| - contents = file.size? ? file.read : "empty log" - # small enough to avoid GitHub "unicorn" page-load-timeout errors - max_file_size = 1_000_000 - contents = truncate_text_to_approximate_size(contents, max_file_size, front_weight: 0.2) - logs[file.basename.to_s] = { content: contents } - end if dir.exist? + if dir.exist? + dir.children.sort.each do |file| + contents = file.size? ? file.read : "empty log" + # small enough to avoid GitHub "unicorn" page-load-timeout errors + max_file_size = 1_000_000 + contents = truncate_text_to_approximate_size(contents, max_file_size, front_weight: 0.2) + logs[file.basename.to_s] = { content: contents } + end + end raise "No logs." if logs.empty? logs end diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 3496580f4..7bbcb4799 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -146,7 +146,7 @@ class PrettyListing (pnn.extname == ".dylib" || pnn.extname == ".pc") && !pnn.symlink? end when ".brew" - # Ignore .brew + next # Ignore .brew else if pn.directory? if pn.symlink? @@ -187,12 +187,9 @@ class PrettyListing end def print_remaining_files(files, root, other = "") - case files.length - when 0 - # noop - when 1 + if files.length == 1 puts files - else + elsif files.length > 1 puts "#{root}/ (#{files.length} #{other}files)" end end diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 08eb111a5..8b6793e77 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -47,7 +47,7 @@ module Homebrew def check_style_impl(files, output_type, options = {}) fix = options[:fix] - Homebrew.install_gem_setup_path! "rubocop", "0.43.0" + Homebrew.install_gem_setup_path! "rubocop", "0.45.0" args = %w[ --force-exclusion |
