aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/update.rb24
-rw-r--r--Library/Homebrew/test/test_updater.rb2
2 files changed, 19 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 042214ee3..7bced13a9 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -31,7 +31,7 @@ module Homebrew
ensure
link_tap_formula(tapped_formulae)
end
- report.merge!(master_updater.report)
+ report.update(master_updater.report)
# rename Taps directories
# this procedure will be removed in the future if it seems unnecessasry
@@ -46,7 +46,7 @@ module Homebrew
rescue
onoe "Failed to update tap: #{user.basename}/#{repo.basename.sub("homebrew-", "")}"
else
- report.merge!(updater.report) do |key, oldval, newval|
+ report.update(updater.report) do |key, oldval, newval|
oldval.concat(newval)
end
end
@@ -207,7 +207,22 @@ class Updater
end
-class Report < Hash
+class Report
+ def initialize
+ @hash = {}
+ end
+
+ def fetch(*args, &block)
+ @hash.fetch(*args, &block)
+ end
+
+ def update(*args, &block)
+ @hash.update(*args, &block)
+ end
+
+ def empty?
+ @hash.empty?
+ end
def dump
# Key Legend: Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)
@@ -216,8 +231,6 @@ class Report < Hash
dump_formula_report :M, "Updated Formulae"
dump_formula_report :D, "Deleted Formulae"
dump_formula_report :R, "Renamed Formulae"
-# dump_new_commands
-# dump_deleted_commands
end
def tapped_formula_for key
@@ -268,5 +281,4 @@ class Report < Hash
puts_columns formula.uniq
end
end
-
end
diff --git a/Library/Homebrew/test/test_updater.rb b/Library/Homebrew/test/test_updater.rb
index 410e54423..48ad066d7 100644
--- a/Library/Homebrew/test/test_updater.rb
+++ b/Library/Homebrew/test/test_updater.rb
@@ -54,7 +54,7 @@ class UpdaterTests < Homebrew::TestCase
@updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef")
@updater.in_repo_expect("git diff-tree -r --raw -M85% 1234abcd 3456cdef", diff_output)
@updater.pull!
- @report.merge!(@updater.report)
+ @report.update(@updater.report)
end
end