Skip to content

Commit 6b0afa3

Browse files
committed
Remove puts_hash, require pp
I wasn’t aware this existed when I created puts_hash so: may as well remove it.
1 parent ceb1629 commit 6b0afa3

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

Library/Homebrew/global.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
require "set"
1111
require "rbconfig"
1212
require "official_taps"
13+
require "pp"
1314

1415
ARGV.extend(HomebrewArgvExtension)
1516

Library/Homebrew/test/utils_spec.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,4 @@ def esc(code)
270270
}.to raise_error(MethodDeprecatedError, %r{method.*replacement.*homebrew/homebrew-core.*homebrew/core}m)
271271
end
272272
end
273-
274-
describe "#puts_hash" do
275-
it "outputs a hash" do
276-
expect {
277-
puts_hash(a: 1, b: 2, c: [3, { "d"=>4 }])
278-
}.to output("a: 1\nb: 2\nc: [3, {\"d\"=>4}]\n").to_stdout
279-
end
280-
end
281273
end

Library/Homebrew/utils.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -526,19 +526,3 @@ def migrate_legacy_keg_symlinks_if_necessary
526526
end
527527
FileUtils.rm_rf legacy_pinned_kegs
528528
end
529-
530-
def puts_hash(hash, indent: 0)
531-
return hash unless hash.is_a? Hash
532-
hash.each do |key, value|
533-
indent_spaces = " " * (indent * 2)
534-
printf "#{indent_spaces}#{key}:"
535-
if value.is_a? Hash
536-
puts
537-
puts_hash(value, indent: indent+1)
538-
else
539-
puts " #{value}"
540-
end
541-
end
542-
hash
543-
end
544-
alias ph puts_hash

0 commit comments

Comments
 (0)