Skip to content

Commit

Permalink
Make things private
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Mar 30, 2024
1 parent 22bfd9b commit 61df7d8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/cmd/deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def run
puts all_deps
end

private

def sorted_dependents(formulae_or_casks)
dependents(formulae_or_casks).sort_by(&:name)

Check warning on line 169 in Library/Homebrew/cmd/deps.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/deps.rb#L169

Added line #L169 was not covered by tests
end
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/cmd/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def run
end
end

private

def fetch_resource(resource)
puts "Resource: #{resource.name}"
fetch_fetchable resource

Check warning on line 190 in Library/Homebrew/cmd/fetch.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/fetch.rb#L189-L190

Added lines #L189 - L190 were not covered by tests
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/cmd/gist-logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def run
gistify_logs(args.named.to_resolved_formulae.first)

Check warning on line 36 in Library/Homebrew/cmd/gist-logs.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/gist-logs.rb#L34-L36

Added lines #L34 - L36 were not covered by tests
end

private

def gistify_logs(formula)
files = load_logs(formula.logs)
build_time = formula.logs.ctime
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/cmd/home.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def run
exec_browser(*T.unsafe(homepages))
end

private

def name_of(formula_or_cask)
if formula_or_cask.is_a? Formula
"Formula #{formula_or_cask.name}"
Expand Down
18 changes: 10 additions & 8 deletions Library/Homebrew/cmd/info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ def run
end
end

def github_remote_path(remote, path)
if remote =~ %r{^(?:https?://|git(?:@|://))github\.com[:/](.+)/(.+?)(?:\.git)?$}
"https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/blob/HEAD/#{path}"
else
"#{remote}/#{path}"
end
end

private

sig { void }
def print_statistics
return unless HOMEBREW_CELLAR.exist?
Expand Down Expand Up @@ -230,14 +240,6 @@ def print_json(all)
puts JSON.pretty_generate(json)
end

def github_remote_path(remote, path)
if remote =~ %r{^(?:https?://|git(?:@|://))github\.com[:/](.+)/(.+?)(?:\.git)?$}
"https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/blob/HEAD/#{path}"
else
"#{remote}/#{path}"
end
end

def github_info(formula_or_cask)
return formula_or_cask.path if formula_or_cask.tap.blank? || formula_or_cask.tap.remote.blank?

Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/cmd/leaves.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def run
.each(&method(:puts))
end

private

def installed_on_request?(formula)
Tab.for_keg(formula.any_installed_keg).installed_on_request

Check warning on line 43 in Library/Homebrew/cmd/leaves.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/leaves.rb#L43

Added line #L43 was not covered by tests
end
Expand Down

0 comments on commit 61df7d8

Please sign in to comment.